43extern void Abc_ShowFile(
char * FileNameDot,
int fKeepDot );
44static void Abc_ShowGetFileName(
char * pName,
char * pBuffer );
63void Abc_NodeShowBddOne( DdManager * dd, DdNode * bFunc )
65 char * FileNameDot =
"temp.dot";
67 if ( (pFile = fopen( FileNameDot,
"w" )) == NULL )
69 fprintf( stdout,
"Cannot open the intermediate file \"%s\".\n", FileNameDot );
72 Cudd_DumpDot( dd, 1, (DdNode **)&bFunc, NULL, NULL, pFile );
92 char FileNameDot[200];
96 assert( Abc_NtkIsBddLogic(pNode->pNtk) );
98 Abc_ShowGetFileName(
Abc_ObjName(pNode), FileNameDot );
100 if ( (pFile = fopen( FileNameDot,
"w" )) == NULL )
102 fprintf( stdout,
"Cannot open the intermediate file \"%s\".\n", FileNameDot );
110 Cudd_DumpDot( dd, 1, (DdNode **)&pNode->pData, (
char **)vNamesIn->pArray, &pNameOut, pFile );
113 DdNode * bAdd = Cudd_BddToAdd( dd, (DdNode *)pNode->pData ); Cudd_Ref( bAdd );
114 Cudd_DumpDot( dd, 1, (DdNode **)&bAdd, (
char **)vNamesIn->pArray, &pNameOut, pFile );
115 Cudd_RecursiveDeref( dd, bAdd );
126 char FileNameDot[200];
127 char ** ppNamesIn, ** ppNamesOut;
128 DdManager * dd; DdNode * bFunc;
133 assert( Abc_NtkIsStrash(pNtk) );
137 printf(
"Construction of global BDDs has failed.\n" );
143 vFuncsGlob = Vec_PtrAlloc( Abc_NtkCoNum(pNtk) );
145 Vec_PtrPush( vFuncsGlob, Abc_ObjGlobalBdd(pObj) );
148 Abc_ShowGetFileName( pNtk->
pName, FileNameDot );
150 if ( (pFile = fopen( FileNameDot,
"w" )) == NULL )
152 fprintf( stdout,
"Cannot open the intermediate file \"%s\".\n", FileNameDot );
160 Cudd_DumpDot( dd, Abc_NtkCoNum(pNtk), (DdNode **)Vec_PtrArray(vFuncsGlob), ppNamesIn, ppNamesOut, pFile );
163 DdNode ** pbAdds =
ABC_ALLOC( DdNode *, Vec_PtrSize(vFuncsGlob) );
165 { pbAdds[i] = Cudd_BddToAdd( dd, bFunc ); Cudd_Ref( pbAdds[i] ); }
166 Cudd_DumpDot( dd, Abc_NtkCoNum(pNtk), pbAdds, ppNamesIn, ppNamesOut, pFile );
168 Cudd_RecursiveDeref( dd, pbAdds[i] );
178 Cudd_RecursiveDeref( dd, bFunc );
179 Vec_PtrFree( vFuncsGlob );
206 char FileNameDot[200];
231 Vec_PtrPushUnique( vInside, pTemp );
234 Abc_ShowGetFileName(
Abc_ObjName(pNode), FileNameDot );
236 if ( (pFile = fopen( FileNameDot,
"w" )) == NULL )
238 fprintf( stdout,
"Cannot open the intermediate file \"%s\".\n", FileNameDot );
242 Vec_PtrPush( vCutSmall, pNode );
270 char FileNameDot[200];
273 assert( Abc_NtkIsStrash(pNtk0) || Abc_NtkIsLogic(pNtk0) );
276 printf(
"Temporarily visualization of AIGs with choice nodes is disabled.\n" );
280 Abc_ShowGetFileName( pNtk0->
pName, FileNameDot );
282 if ( (pFile = fopen( FileNameDot,
"w" )) == NULL )
284 fprintf( stdout,
"Cannot open the intermediate file \"%s\".\n", FileNameDot );
292 if ( Abc_NtkIsLogic(pNtk) && !Abc_NtkHasMapping(pNtk) )
296 vNodes = Vec_PtrAlloc( 100 );
298 Vec_PtrPush( vNodes, pNode );
303 Io_WriteDotSeq( pNtk, vNodes, NULL, FileNameDot, fGateNames, fUseReverse );
305 Io_WriteDotNtk( pNtk, vNodes, NULL, FileNameDot, fGateNames, fUseReverse, fAigIds );
307 Vec_PtrFree( vNodes );
330 char FileNamePs[200];
331 char CommandDot[1000];
333 char * pDotNameWin =
"dot.exe";
334 char * pDotNameUnix =
"dot";
335 char * pGsNameWin =
"gsview32.exe";
336 char * pGsNameUnix =
"gv";
346 pDotName = pDotNameWin;
348 pDotName = pDotNameUnix;
352 if ( (pFile = fopen( FileNameDot,
"r" )) == NULL )
354 fprintf( stdout,
"Cannot open the intermediate file \"%s\".\n", FileNameDot );
361 sprintf( FileNamePs,
"%s.ps", FileGeneric );
365 sprintf( CommandDot,
"%s -Tps -o %s %s", pDotName, FileNamePs, FileNameDot );
369 RetValue =
system( CommandDot );
371 if ( RetValue == -1 )
373 fprintf( stdout,
"Command \"%s\" did not succeed.\n", CommandDot );
377 if ( (pFile = fopen( FileNamePs,
"r" )) == NULL )
379 fprintf( stdout,
"Cannot open intermediate file \"%s\".\n", FileNamePs );
393 if ( !fKeepDot ) _unlink( FileNameDot );
394 if ( _spawnl( _P_NOWAIT, pGsNameWin, pGsNameWin, FileNamePs, NULL ) == -1 )
395 if ( _spawnl( _P_NOWAIT,
"C:\\Program Files\\Ghostgum\\gsview\\gsview32.exe",
396 "C:\\Program Files\\Ghostgum\\gsview\\gsview32.exe", FileNamePs, NULL ) == -1 )
397 if ( _spawnl( _P_NOWAIT,
"C:\\Program Files\\Ghostgum\\gsview\\gsview64.exe",
398 "C:\\Program Files\\Ghostgum\\gsview\\gsview64.exe", FileNamePs, NULL ) == -1 )
400 fprintf( stdout,
"Cannot find \"%s\".\n", pGsNameWin );
405 char CommandPs[1000];
406 if ( !fKeepDot ) unlink( FileNameDot );
407 sprintf( CommandPs,
"%s %s &", pGsNameUnix, FileNamePs );
411 if (
system( CommandPs ) == -1 )
414 fprintf( stdout,
"Cannot execute \"%s\".\n", CommandPs );
432void Abc_ShowGetFileName(
char * pName,
char * pBuffer )
436 sprintf( pBuffer,
"%s.dot", pName );
438 for ( pCur = pBuffer; *pCur; pCur++ )
439 if ( !((*pCur >=
'0' && *pCur <=
'9') || (*pCur >=
'a' && *pCur <=
'z') ||
440 (*pCur >=
'A' && *pCur <=
'Z') || (*pCur ==
'.')) )
462 pFile = fopen( pFileName,
"w" );
465 printf(
"Cannot open input file %s.\n", pFileName );
468 fprintf( pFile,
"# Flop dependency for \"%s\" generated by ABC on %s\n", Abc_NtkName(pNtk),
Extra_TimeStamp() );
469 fprintf( pFile,
"digraph G {\n" );
470 fprintf( pFile,
" graph [splines=true overlap=false];\n" );
471 fprintf( pFile,
" size = \"7.5,10\";\n" );
472 fprintf( pFile,
" center = true;\n" );
474 fprintf( pFile,
" edge [dir=forward];\n" );
477 Abc_ObjFanout0( Abc_ObjFanout0(pObj) )->iTemp = i;
481 Count += Abc_ObjIsPi(pTemp);
482 Vec_PtrFree( vSupp );
483 fprintf( pFile,
" { rank = same; %d [label=\"%d(%d)\"]; }\n", i, i, Count );
490 if ( !Abc_ObjIsPi(pTemp) )
491 fprintf( pFile,
" %4d -> %4d\n", pTemp->
iTemp, i );
492 Vec_PtrFree( vSupp );
494 fprintf( pFile,
"}\n" );
513 char FileNameDot[200];
514 assert( Abc_NtkIsStrash(pNtk) || Abc_NtkIsLogic(pNtk) );
516 Abc_ShowGetFileName( pNtk->
pName, FileNameDot );
518 if ( (pFile = fopen( FileNameDot,
"w" )) == NULL )
520 fprintf( stdout,
"Cannot open the intermediate file \"%s\".\n", FileNameDot );
void Abc_NtkShow(Abc_Ntk_t *pNtk0, int fGateNames, int fSeq, int fUseReverse, int fKeepDot, int fAigIds)
void Abc_NodeShowBdd(Abc_Obj_t *pNode, int fCompl)
FUNCTION DEFINITIONS ///.
void Abc_NtkShowFlopDependency(Abc_Ntk_t *pNtk)
void Abc_NodeShowCut(Abc_Obj_t *pNode, int nNodeSizeMax, int nConeSizeMax)
ABC_NAMESPACE_IMPL_START void Abc_ShowFile(char *FileNameDot, int fKeepDot)
DECLARATIONS ///.
void Abc_NtkWriteFlopDependency(Abc_Ntk_t *pNtk, char *pFileName)
void Abc_NtkShowBdd(Abc_Ntk_t *pNtk, int fCompl, int fReorder)
struct Abc_Obj_t_ Abc_Obj_t
#define Abc_NtkForEachCo(pNtk, pCo, i)
ABC_DLL Vec_Ptr_t * Abc_NodeGetFaninNames(Abc_Obj_t *pNode)
ABC_DLL int Abc_NtkGetChoiceNum(Abc_Ntk_t *pNtk)
#define Abc_NtkForEachObj(pNtk, pObj, i)
ITERATORS ///.
ABC_DLL void Abc_NodeFreeNames(Vec_Ptr_t *vNames)
struct Abc_ManCut_t_ Abc_ManCut_t
ABC_DLL void Abc_NodeConeCollect(Abc_Obj_t **ppRoots, int nRoots, Vec_Ptr_t *vFanins, Vec_Ptr_t *vVisited, int fIncludeFanins)
ABC_DLL void Abc_NtkManCutStop(Abc_ManCut_t *p)
ABC_DLL char * Abc_ObjName(Abc_Obj_t *pNode)
DECLARATIONS ///.
struct Abc_Ntk_t_ Abc_Ntk_t
ABC_DLL Vec_Ptr_t * Abc_NtkNodeSupport(Abc_Ntk_t *pNtk, Abc_Obj_t **ppNodes, int nNodes)
ABC_DLL Vec_Ptr_t * Abc_NodeCollectTfoCands(Abc_ManCut_t *p, Abc_Obj_t *pRoot, Vec_Ptr_t *vFanins, int LevelMax)
ABC_DLL void * Abc_NtkFreeGlobalBdds(Abc_Ntk_t *pNtk, int fFreeMan)
ABC_DLL Vec_Ptr_t * Abc_NodeFindCut(Abc_ManCut_t *p, Abc_Obj_t *pRoot, int fContain)
#define Abc_NtkForEachLatchInput(pNtk, pObj, i)
ABC_DLL int Abc_NtkToSop(Abc_Ntk_t *pNtk, int fMode, int nCubeLimit)
ABC_DLL void * Abc_NtkBuildGlobalBdds(Abc_Ntk_t *pNtk, int fBddSizeMax, int fDropInternal, int fReorder, int fReverse, int fVerbose)
ABC_DLL Vec_Ptr_t * Abc_NtkManCutReadVisited(Abc_ManCut_t *p)
ABC_DLL Vec_Ptr_t * Abc_NtkManCutReadCutLarge(Abc_ManCut_t *p)
ABC_DLL char ** Abc_NtkCollectCioNames(Abc_Ntk_t *pNtk, int fCollectCos)
ABC_DLL void Abc_NtkDelete(Abc_Ntk_t *pNtk)
ABC_DLL void Abc_NtkCleanCopy(Abc_Ntk_t *pNtk)
ABC_DLL Abc_Ntk_t * Abc_NtkDup(Abc_Ntk_t *pNtk)
ABC_DLL Abc_ManCut_t * Abc_NtkManCutStart(int nNodeSizeMax, int nConeSizeMax, int nNodeFanStop, int nConeFanStop)
#define ABC_ALLOC(type, num)
#define ABC_INFINITY
MACRO DEFINITIONS ///.
#define ABC_NAMESPACE_IMPL_START
#define ABC_NAMESPACE_IMPL_END
ABC_DLL char * Abc_FrameReadFlag(char *pFlag)
void Io_WriteDotSeq(Abc_Ntk_t *pNtk, Vec_Ptr_t *vNodes, Vec_Ptr_t *vNodesShow, char *pFileName, int fGateNames, int fUseReverse)
void Io_WriteDotNtk(Abc_Ntk_t *pNtk, Vec_Ptr_t *vNodes, Vec_Ptr_t *vNodesShow, char *pFileName, int fGateNames, int fUseReverse, int fAigIds)
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.