Commit 675437b2 by Alan Mishchenko

Preventing 'show' from unmapping the network.

parent e37fb952
...@@ -179,25 +179,23 @@ void Abc_NodeShowCut( Abc_Obj_t * pNode, int nNodeSizeMax, int nConeSizeMax ) ...@@ -179,25 +179,23 @@ void Abc_NodeShowCut( Abc_Obj_t * pNode, int nNodeSizeMax, int nConeSizeMax )
SeeAlso [] SeeAlso []
***********************************************************************/ ***********************************************************************/
void Abc_NtkShow( Abc_Ntk_t * pNtk, int fGateNames, int fSeq, int fUseReverse ) void Abc_NtkShow( Abc_Ntk_t * pNtk0, int fGateNames, int fSeq, int fUseReverse )
{ {
FILE * pFile; FILE * pFile;
Abc_Ntk_t * pNtk;
Abc_Obj_t * pNode; Abc_Obj_t * pNode;
Vec_Ptr_t * vNodes; Vec_Ptr_t * vNodes;
char FileNameDot[200]; char FileNameDot[200];
int i; int i;
assert( Abc_NtkIsStrash(pNtk) || Abc_NtkIsLogic(pNtk) ); assert( Abc_NtkIsStrash(pNtk0) || Abc_NtkIsLogic(pNtk0) );
if ( Abc_NtkIsStrash(pNtk) && Abc_NtkGetChoiceNum(pNtk) ) if ( Abc_NtkIsStrash(pNtk0) && Abc_NtkGetChoiceNum(pNtk0) )
{ {
printf( "Temporarily visualization of AIGs with choice nodes is disabled.\n" ); printf( "Temporarily visualization of AIGs with choice nodes is disabled.\n" );
return; return;
} }
// convert to logic SOP
if ( Abc_NtkIsLogic(pNtk) )
Abc_NtkToSop( pNtk, 0 );
// create the file name // create the file name
Abc_ShowGetFileName( pNtk->pName, FileNameDot ); Abc_ShowGetFileName( pNtk0->pName, FileNameDot );
// check that the file can be opened // check that the file can be opened
if ( (pFile = fopen( FileNameDot, "w" )) == NULL ) if ( (pFile = fopen( FileNameDot, "w" )) == NULL )
{ {
...@@ -206,6 +204,12 @@ void Abc_NtkShow( Abc_Ntk_t * pNtk, int fGateNames, int fSeq, int fUseReverse ) ...@@ -206,6 +204,12 @@ void Abc_NtkShow( Abc_Ntk_t * pNtk, int fGateNames, int fSeq, int fUseReverse )
} }
fclose( pFile ); fclose( pFile );
// convert to logic SOP
pNtk = Abc_NtkDup( pNtk0 );
if ( Abc_NtkIsLogic(pNtk) && !Abc_NtkHasMapping(pNtk) )
Abc_NtkToSop( pNtk, 0 );
// collect all nodes in the network // collect all nodes in the network
vNodes = Vec_PtrAlloc( 100 ); vNodes = Vec_PtrAlloc( 100 );
Abc_NtkForEachObj( pNtk, pNode, i ) Abc_NtkForEachObj( pNtk, pNode, i )
...@@ -219,6 +223,7 @@ void Abc_NtkShow( Abc_Ntk_t * pNtk, int fGateNames, int fSeq, int fUseReverse ) ...@@ -219,6 +223,7 @@ void Abc_NtkShow( Abc_Ntk_t * pNtk, int fGateNames, int fSeq, int fUseReverse )
// visualize the file // visualize the file
Abc_ShowFile( FileNameDot ); Abc_ShowFile( FileNameDot );
Abc_NtkDelete( pNtk );
} }
......
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