Skip to content

Support primitive gates with names in Verilog netlist #412

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 18 additions & 4 deletions src/base/ver/verCore.c
Original file line number Diff line number Diff line change
Expand Up @@ -1339,12 +1339,26 @@ int Ver_ParseGateStandard( Ver_Man_t * pMan, Abc_Ntk_t * pNtk, Ver_GateType_t Ga
return 0;
Ver_StreamMove( p );

// this is gate name - throw it away
// assume there is a gate name if the current char is not '(', e.g. xor g1 (z, a, b);
if ( Ver_StreamPopChar(p) != '(' )
{
sprintf( pMan->sError, "Cannot parse a standard gate (expected opening parenthesis)." );
Ver_ParsePrintErrorMessage( pMan );
return 0;
// this is gate name - throw it away
pWord = Ver_ParseGetName( pMan );
if (pWord == NULL)
{
sprintf( pMan->sError, "Cannot parse a standard gate (expected a name before an opening parenthesis)." );
Ver_ParsePrintErrorMessage( pMan );
return 0;
}
else
{
if ( Ver_StreamPopChar(p) != '(' )
{
sprintf( pMan->sError, "Cannot parse a standard gate (expected opening parenthesis)." );
Ver_ParsePrintErrorMessage( pMan );
return 0;
}
}
}
Ver_ParseSkipComments( pMan );

Expand Down