Outputting the constant node in 'write_gml'.

This commit is contained in:
Alan Mishchenko 2021-12-06 13:38:09 -08:00
parent b7176ee3e5
commit 8e72ac36d7
1 changed files with 12 additions and 0 deletions

View File

@ -61,6 +61,18 @@ void Io_WriteGml( Abc_Ntk_t * pNtk, char * pFileName )
fprintf( pFile, "# GML for \"%s\" written by ABC on %s\n", pNtk->pName, Extra_TimeStamp() );
fprintf( pFile, "graph [\n" );
// output constant node in the AIG if it has fanouts
if ( Abc_NtkIsStrash(pNtk) )
{
pObj = Abc_AigConst1( pNtk );
if ( Abc_ObjFanoutNum(pObj) > 0 )
{
fprintf( pFile, "\n" );
fprintf( pFile, " node [ id %5d label \"%s\"\n", pObj->Id, Abc_ObjName(pObj) );
fprintf( pFile, " graphics [ type \"ellipse\" fill \"#CCCCFF\" ]\n" ); // grey
fprintf( pFile, " ]\n" );
}
}
// output the POs
fprintf( pFile, "\n" );
Abc_NtkForEachPo( pNtk, pObj, i )