summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2021-12-06 13:38:09 -0800
committerAlan Mishchenko <alanmi@berkeley.edu>2021-12-06 13:38:09 -0800
commit8e72ac36d718cd0dc27f181dfa10746ad4a101ed (patch)
tree84e5cb9bd9911abe6bb1c82d0a0c9aa5548667cc /src
parentb7176ee3e52c5068d93abd898be0639f9a648230 (diff)
downloadabc-8e72ac36d718cd0dc27f181dfa10746ad4a101ed.tar.gz
abc-8e72ac36d718cd0dc27f181dfa10746ad4a101ed.tar.bz2
abc-8e72ac36d718cd0dc27f181dfa10746ad4a101ed.zip
Outputting the constant node in 'write_gml'.
Diffstat (limited to 'src')
-rw-r--r--src/base/io/ioWriteGml.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/base/io/ioWriteGml.c b/src/base/io/ioWriteGml.c
index 49a90d9c..1164188f 100644
--- a/src/base/io/ioWriteGml.c
+++ b/src/base/io/ioWriteGml.c
@@ -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 )