Commit 30b8c3d4 by Alan Mishchenko

Made print-out of frontier cut an option ('-c') in '&ps'.

parent 566c7d71
......@@ -856,7 +856,7 @@ extern void Gia_ManSolveProblem( Gia_Man_t * pGia, Emb_Par_t * pP
extern Gia_Man_t * Gia_ManStart( int nObjsMax );
extern void Gia_ManStop( Gia_Man_t * p );
extern void Gia_ManStopP( Gia_Man_t ** p );
extern void Gia_ManPrintStats( Gia_Man_t * p, int fTents, int fSwitch );
extern void Gia_ManPrintStats( Gia_Man_t * p, int fTents, int fSwitch, int fCut );
extern void Gia_ManPrintStatsShort( Gia_Man_t * p );
extern void Gia_ManPrintMiterStatus( Gia_Man_t * p );
extern void Gia_ManSetRegNum( Gia_Man_t * p, int nRegs );
......
......@@ -331,7 +331,7 @@ Abc_Cex_t * Gia_ManCexMin( Gia_Man_t * p, Abc_Cex_t * pCex, int iFrameStart, int
{
pNew = Gia_ManCreateUnate( p, pCex, iFrameStart, nRealPis, fUseAll );
printf( "%3d : ", iFrameStart );
Gia_ManPrintStats( pNew, 0, 0 );
Gia_ManPrintStats( pNew, 0, 0, 0 );
if ( fVerbose )
Gia_WriteAiger( pNew, "temp.aig", 0, 0 );
Gia_ManStop( pNew );
......@@ -342,7 +342,7 @@ Abc_Cex_t * Gia_ManCexMin( Gia_Man_t * p, Abc_Cex_t * pCex, int iFrameStart, int
{
pNew = Gia_ManCreateUnate( p, pCex, f, -1, fUseAll );
printf( "%3d : ", f );
Gia_ManPrintStats( pNew, 0, 0 );
Gia_ManPrintStats( pNew, 0, 0, 0 );
if ( fVerbose )
Gia_WriteAiger( pNew, "temp.aig", 0, 0 );
Gia_ManStop( pNew );
......
......@@ -863,7 +863,7 @@ Gia_Man_t * Gia_ManDupCofAllInt( Gia_Man_t * p, Vec_Int_t * vSigs, int fVerbose
if ( fVerbose )
{
printf( "Cofactoring %d signals.\n", Vec_IntSize(vSigs) );
Gia_ManPrintStats( p, 0, 0 );
Gia_ManPrintStats( p, 0, 0, 0 );
}
if ( Vec_IntSize( vSigs ) > 200 )
{
......@@ -889,7 +889,7 @@ Gia_Man_t * Gia_ManDupCofAllInt( Gia_Man_t * p, Vec_Int_t * vSigs, int fVerbose
if ( fVerbose )
printf( "Cofactored variable %d.\n", iVar );
if ( fVerbose )
Gia_ManPrintStats( pAig, 0, 0 );
Gia_ManPrintStats( pAig, 0, 0, 0 );
}
Vec_IntFree( vSigsNew );
return pAig;
......
......@@ -1665,7 +1665,7 @@ int Gia_CommandSpecI( Gia_Man_t * pGia, int nFramesInit, int nBTLimitInit, int f
}
// (spech)* where spech = &srm; restore save3; bmc2 -F 100 -C 25000; &resim
Gia_ManCleanMark0( pGia );
Gia_ManPrintStats( pGia, 0, 0 );
Gia_ManPrintStats( pGia, 0, 0, 0 );
for ( nIter = 0; ; nIter++ )
{
if ( Gia_ManHasNoEquivs(pGia) )
......
......@@ -950,7 +950,7 @@ Gia_Man_t * Gia_ManFramesInitSpecial( Gia_Man_t * pAig, int nFrames, int fVerbos
if ( fVerbose && (f % 100 == 0) )
{
printf( "%6d : ", f );
Gia_ManPrintStats( pFrames, 0, 0 );
Gia_ManPrintStats( pFrames, 0, 0, 0 );
}
Gia_ManForEachRo( pAig, pObj, i )
pObj->Value = f ? Gia_ObjRoToRi( pAig, pObj )->Value : 0;
......
......@@ -292,7 +292,7 @@ void Gia_ManPrintChoiceStats( Gia_Man_t * p )
SeeAlso []
***********************************************************************/
void Gia_ManPrintStats( Gia_Man_t * p, int fTents, int fSwitch )
void Gia_ManPrintStats( Gia_Man_t * p, int fTents, int fSwitch, int fCut )
{
if ( p->pName )
printf( "%-8s : ", p->pName );
......@@ -303,8 +303,8 @@ void Gia_ManPrintStats( Gia_Man_t * p, int fTents, int fSwitch )
printf( " ff =%7d", Gia_ManRegNum(p) );
printf( " and =%8d", Gia_ManAndNum(p) );
printf( " lev =%5d", Gia_ManLevelNum(p) ); Vec_IntFreeP( &p->vLevels );
if ( p->nPinTypes == 0 )
printf( " cut = %d(%d)", Gia_ManCrossCut(p, 0), Gia_ManCrossCut(p, 1) );
if ( fCut && p->nPinTypes == 0 )
printf( " cut = %d(%d)", Gia_ManCrossCut(p, 0), Gia_ManCrossCut(p, 1) );
// printf( " mem =%5.2f MB", 1.0*(sizeof(Gia_Obj_t)*p->nObjs + sizeof(int)*(Vec_IntSize(p->vCis) + Vec_IntSize(p->vCos)))/(1<<20) );
printf( " mem =%5.2f MB", 1.0*(sizeof(Gia_Obj_t)*p->nObjsAlloc + sizeof(int)*(Vec_IntCap(p->vCis) + Vec_IntCap(p->vCos)))/(1<<20) );
if ( Gia_ManHasDangling(p) )
......
......@@ -404,7 +404,7 @@ Gia_Man_t * Abc_NtkDeriveFlatGia2Derive( Abc_Ntk_t * pNtk, Vec_Ptr_t * vOrder )
Gia_ManStop( pGiaBox );
printf( "%8d -> ", Abc_NtkCountAndNodes(vOrder) );
Gia_ManPrintStats( pGia, 0, 0 );
Gia_ManPrintStats( pGia, 0, 0, 0 );
return pGia;
}
/*
......@@ -724,7 +724,7 @@ Gia_Man_t * Abc_NtkHieCecTest( char * pFileName, int fVerbose )
clk = clock();
pGia = Abc_NtkDeriveFlatGia2( pNtk, vOrder );
Abc_PrintTime( 1, "Deriving GIA", clock() - clk );
Gia_ManPrintStats( pGia, 0, 0 );
Gia_ManPrintStats( pGia, 0, 0, 0 );
// Gia_ManStop( pGia );
Vec_PtrFree( vOrder );
......@@ -740,7 +740,7 @@ Gia_Man_t * Abc_NtkHieCecTest( char * pFileName, int fVerbose )
clk = clock();
pGia = Abc_NtkDeriveFlatGia( pNtk );
Abc_PrintTime( 1, "Deriving GIA", clock() - clk );
Gia_ManPrintStats( pGia, 0, 0 );
Gia_ManPrintStats( pGia, 0, 0, 0 );
// clean nodes/boxes of all nodes
Vec_PtrForEachEntry( Abc_Ntk_t *, vMods, pModel, i )
......
......@@ -23438,10 +23438,11 @@ usage:
int Abc_CommandAbc9Ps( Abc_Frame_t * pAbc, int argc, char ** argv )
{
int c;
int fSwitch = 0;
int fTents = 0;
int fSwitch = 0;
int fCut = 0;
Extra_UtilGetoptReset();
while ( ( c = Extra_UtilGetopt( argc, argv, "tph" ) ) != EOF )
while ( ( c = Extra_UtilGetopt( argc, argv, "tpch" ) ) != EOF )
{
switch ( c )
{
......@@ -23451,6 +23452,9 @@ int Abc_CommandAbc9Ps( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'p':
fSwitch ^= 1;
break;
case 'c':
fCut ^= 1;
break;
case 'h':
goto usage;
default:
......@@ -23462,14 +23466,15 @@ int Abc_CommandAbc9Ps( Abc_Frame_t * pAbc, int argc, char ** argv )
Abc_Print( -1, "Abc_CommandAbc9Ps(): There is no AIG.\n" );
return 1;
}
Gia_ManPrintStats( pAbc->pGia, fTents, fSwitch );
Gia_ManPrintStats( pAbc->pGia, fTents, fSwitch, fCut );
return 0;
usage:
Abc_Print( -2, "usage: &ps [-tph]\n" );
Abc_Print( -2, "usage: &ps [-tpch]\n" );
Abc_Print( -2, "\t prints stats of the current AIG\n" );
Abc_Print( -2, "\t-t : toggle printing BMC tents [default = %s]\n", fTents? "yes": "no" );
Abc_Print( -2, "\t-p : toggle printing switching activity [default = %s]\n", fSwitch? "yes": "no" );
Abc_Print( -2, "\t-c : toggle printing the size of frontier cut [default = %s]\n", fCut? "yes": "no" );
Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
......
......@@ -486,7 +486,7 @@ void Gia_ManFromBridgeTest( char * pFileName )
p = Gia_ManFromBridge( pFile, NULL );
fclose ( pFile );
Gia_ManPrintStats( p, 0, 0 );
Gia_ManPrintStats( p, 0, 0, 0 );
Gia_WriteAiger( p, "temp.aig", 0, 0 );
Gia_ManToBridgeAbsNetlistTest( "par_.dump", p, BRIDGE_ABS_NETLIST );
......
......@@ -147,7 +147,7 @@ Gia_Man_t * Abs_RpmPerformOld( Gia_Man_t * p, int fVerbose )
if ( fVerbose )
{
printf( "Original AIG:\n" );
Gia_ManPrintStats( p, 0, 0 );
Gia_ManPrintStats( p, 0, 0, 0 );
}
// perform input trimming
......@@ -155,7 +155,7 @@ Gia_Man_t * Abs_RpmPerformOld( Gia_Man_t * p, int fVerbose )
if ( fVerbose )
{
printf( "After PI trimming:\n" );
Gia_ManPrintStats( pNew, 0, 0 );
Gia_ManPrintStats( pNew, 0, 0, 0 );
}
// transform GIA
pNew = Gia_ManDupIn2Ff( pTmp = pNew );
......@@ -163,7 +163,7 @@ Gia_Man_t * Abs_RpmPerformOld( Gia_Man_t * p, int fVerbose )
if ( fVerbose )
{
printf( "After PI-2-FF transformation:\n" );
Gia_ManPrintStats( pNew, 0, 0 );
Gia_ManPrintStats( pNew, 0, 0, 0 );
}
// derive AIG
......@@ -178,7 +178,7 @@ Gia_Man_t * Abs_RpmPerformOld( Gia_Man_t * p, int fVerbose )
if ( fVerbose )
{
printf( "After min-area retiming:\n" );
Gia_ManPrintStats( pNew, 0, 0 );
Gia_ManPrintStats( pNew, 0, 0, 0 );
}
// transform back
......@@ -187,7 +187,7 @@ Gia_Man_t * Abs_RpmPerformOld( Gia_Man_t * p, int fVerbose )
if ( fVerbose )
{
printf( "After FF-2-PI tranformation:\n" );
Gia_ManPrintStats( pNew, 0, 0 );
Gia_ManPrintStats( pNew, 0, 0, 0 );
}
return pNew;
}
......
......@@ -401,7 +401,7 @@ p->timeSim += clock() - clk;
// Gia_WriteAiger( pSrm, "gia_srm.aig", 0, 0 );
if ( pPars->fVeryVerbose )
Gia_ManPrintStats( pSrm, 0, 0 );
Gia_ManPrintStats( pSrm, 0, 0, 0 );
if ( Gia_ManCoNum(pSrm) == 0 )
{
Gia_ManStop( pSrm );
......
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