mirror of https://github.com/YosysHQ/abc.git
Merge pull request #412 from tklam/feature/support_verilog_gate_name
Support primitive gates with names in Verilog netlist
This commit is contained in:
commit
5cf5a8d9f5
|
|
@ -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 );
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue