Commit 02725c9e by Alan Mishchenko

An add-on to write Verilog for circuits mapped into simple gates.

parent 81dade19
......@@ -485,6 +485,7 @@ void Io_WriteVerilogLatches( FILE * pFile, Abc_Ntk_t * pNtk )
***********************************************************************/
void Io_WriteVerilogObjects( FILE * pFile, Abc_Ntk_t * pNtk )
{
int fUseSimpleGateNames = 0;
Vec_Vec_t * vLevels;
Abc_Ntk_t * pNtkBox;
Abc_Obj_t * pObj, * pTerm, * pFanin;
......@@ -529,6 +530,17 @@ void Io_WriteVerilogObjects( FILE * pFile, Abc_Ntk_t * pNtk )
continue;
}
// write the node
if ( fUseSimpleGateNames )
{
fprintf( pFile, "%-*s ", Length, Mio_GateReadName(pGate) );
fprintf( pFile, "( %s", Io_WriteVerilogGetName(Abc_ObjName( Abc_ObjFanout0(pObj) )) );
for ( pGatePin = Mio_GateReadPins(pGate), i = 0; pGatePin; pGatePin = Mio_PinReadNext(pGatePin), i++ )
fprintf( pFile, ", %s", Io_WriteVerilogGetName(Abc_ObjName( Abc_ObjFanin(pObj,i) )) );
assert ( i == Abc_ObjFaninNum(pObj) );
fprintf( pFile, " );\n" );
}
else
{
fprintf( pFile, " %-*s g%0*d", Length, Mio_GateReadName(pGate), nDigits, Counter++ );
fprintf( pFile, "(" );
for ( pGatePin = Mio_GateReadPins(pGate), i = 0; pGatePin; pGatePin = Mio_PinReadNext(pGatePin), i++ )
......@@ -542,6 +554,7 @@ void Io_WriteVerilogObjects( FILE * pFile, Abc_Ntk_t * pNtk )
fprintf( pFile, ");\n" );
}
}
}
else
{
vLevels = Vec_VecAlloc( 10 );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment