diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2014-03-28 15:32:29 -0700 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2014-03-28 15:32:29 -0700 |
commit | 4745eac3248a80d42789919f6a9271a3e5a7b807 (patch) | |
tree | 2ab4912d604529b3a75aff24557cba426ec2d8f6 /src | |
parent | c0f688349d1c23d329a4c4d0bc7bf77d55c329e1 (diff) | |
download | abc-4745eac3248a80d42789919f6a9271a3e5a7b807.tar.gz abc-4745eac3248a80d42789919f6a9271a3e5a7b807.tar.bz2 abc-4745eac3248a80d42789919f6a9271a3e5a7b807.zip |
Improving network visualization in show/&show.
Diffstat (limited to 'src')
-rw-r--r-- | src/aig/aig/aigShow.c | 10 | ||||
-rw-r--r-- | src/base/io/ioWriteDot.c | 28 |
2 files changed, 35 insertions, 3 deletions
diff --git a/src/aig/aig/aigShow.c b/src/aig/aig/aigShow.c index b14032d3..eac2a510 100644 --- a/src/aig/aig/aigShow.c +++ b/src/aig/aig/aigShow.c @@ -47,7 +47,7 @@ void Aig_WriteDotAig( Aig_Man_t * pMan, char * pFileName, int fHaig, Vec_Ptr_t * { FILE * pFile; Aig_Obj_t * pNode;//, * pTemp, * pPrev; - int LevelMax, Level, i; + int LevelMax, Prev, Level, i; if ( Aig_ManNodeNum(pMan) > 200 ) { @@ -252,6 +252,14 @@ void Aig_WriteDotAig( Aig_Man_t * pMan, char * pFileName, int fHaig, Vec_Ptr_t * fprintf( pFile, "title1 -> title2 [style = invis];\n" ); Aig_ManForEachCo( pMan, pNode, i ) fprintf( pFile, "title2 -> Node%d [style = invis];\n", pNode->Id ); + // generate invisible edges among the COs + Prev = -1; + Aig_ManForEachCo( pMan, pNode, i ) + { + if ( i > 0 ) + fprintf( pFile, "Node%d -> Node%d [style = invis];\n", Prev, pNode->Id ); + Prev = pNode->Id; + } // generate edges Aig_ManForEachObj( pMan, pNode, i ) diff --git a/src/base/io/ioWriteDot.c b/src/base/io/ioWriteDot.c index 1110e70e..24f3da63 100644 --- a/src/base/io/ioWriteDot.c +++ b/src/base/io/ioWriteDot.c @@ -73,7 +73,7 @@ void Io_WriteDotNtk( Abc_Ntk_t * pNtk, Vec_Ptr_t * vNodes, Vec_Ptr_t * vNodesSho FILE * pFile; Abc_Obj_t * pNode, * pFanin; char * pSopString; - int LevelMin, LevelMax, fHasCos, Level, i, k, fHasBdds, fCompl; + int LevelMin, LevelMax, fHasCos, Level, i, k, fHasBdds, fCompl, Prev; int Limit = 300; assert( Abc_NtkIsStrash(pNtk) || Abc_NtkIsLogic(pNtk) ); @@ -365,6 +365,18 @@ void Io_WriteDotNtk( Abc_Ntk_t * pNtk, Vec_Ptr_t * vNodes, Vec_Ptr_t * vNodesSho continue; fprintf( pFile, "title2 -> Node%d [style = invis];\n", pNode->Id ); } + // generate invisible edges among the COs + Prev = -1; + Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pNode, i ) + { + if ( (int)pNode->Level != LevelMax ) + continue; + if ( !Abc_ObjIsPo(pNode) ) + continue; + if ( Prev >= 0 ) + fprintf( pFile, "Node%d -> Node%d [style = invis];\n", Prev, pNode->Id ); + Prev = pNode->Id; + } // generate edges Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pNode, i ) @@ -424,7 +436,7 @@ void Io_WriteDotSeq( Abc_Ntk_t * pNtk, Vec_Ptr_t * vNodes, Vec_Ptr_t * vNodesSho FILE * pFile; Abc_Obj_t * pNode, * pFanin; char * pSopString; - int LevelMin, LevelMax, fHasCos, Level, i, k, fHasBdds, fCompl; + int LevelMin, LevelMax, fHasCos, Level, i, k, fHasBdds, fCompl, Prev; int Limit = 300; assert( Abc_NtkIsStrash(pNtk) || Abc_NtkIsLogic(pNtk) ); @@ -713,6 +725,18 @@ void Io_WriteDotSeq( Abc_Ntk_t * pNtk, Vec_Ptr_t * vNodes, Vec_Ptr_t * vNodesSho continue; fprintf( pFile, "title2 -> Node%d [style = invis];\n", pNode->Id ); } + // generate invisible edges among the COs + Prev = -1; + Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pNode, i ) + { + if ( (int)pNode->Level != LevelMax ) + continue; + if ( !Abc_ObjIsPo(pNode) ) + continue; + if ( Prev >= 0 ) + fprintf( pFile, "Node%d -> Node%d [style = invis];\n", Prev, pNode->Id ); + Prev = pNode->Id; + } // generate edges Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pNode, i ) |