Adding switch -x to &ps to disable color printout.

This commit is contained in:
Alan Mishchenko 2019-02-12 16:45:16 -08:00
parent 881b5a24a0
commit 7143ad4d87
3 changed files with 27 additions and 5 deletions

View File

@ -246,6 +246,7 @@ struct Gps_Par_t_
int fMiter;
int fSkipMap;
int fSlacks;
int fNoColor;
char * pDumpFile;
};

View File

@ -450,6 +450,13 @@ void Gia_ManPrintStats( Gia_Man_t * p, Gps_Par_t * pPars )
Gia_ManPrintStatsMiter( p, 0 );
return;
}
if ( pPars->fNoColor )
{
if ( p->pName )
Abc_Print( 1, "%-8s : ", p->pName );
}
else
{
#ifdef WIN32
SetConsoleTextAttribute( GetStdHandle(STD_OUTPUT_HANDLE), 15 ); // bright
if ( p->pName )
@ -459,6 +466,7 @@ void Gia_ManPrintStats( Gia_Man_t * p, Gps_Par_t * pPars )
if ( p->pName )
Abc_Print( 1, "%s%-8s%s : ", "\033[1;37m", p->pName, "\033[0m" ); // bright
#endif
}
Abc_Print( 1, "i/o =%7d/%7d",
Gia_ManPiNum(p) - Gia_ManBoxCiNum(p) - Gia_ManRegBoxNum(p),
Gia_ManPoNum(p) - Gia_ManBoxCoNum(p) - Gia_ManRegBoxNum(p) );
@ -468,7 +476,14 @@ void Gia_ManPrintStats( Gia_Man_t * p, Gps_Par_t * pPars )
Abc_Print( 1, " ff =%7d", Gia_ManRegNum(p) );
if ( Gia_ManRegBoxNum(p) )
Abc_Print( 1, " boxff =%d(%d)", Gia_ManRegBoxNum(p), Gia_ManClockDomainNum(p) );
if ( pPars->fNoColor )
{
Abc_Print( 1, " %s =%8d", p->pMuxes? "nod" : "and", Gia_ManAndNum(p) );
Abc_Print( 1, " lev =%5d", Gia_ManLevelNum(p) );
Abc_Print( 1, " (%.2f)", Gia_ManLevelAve(p) );
}
else
{
#ifdef WIN32
{
HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
@ -484,6 +499,7 @@ void Gia_ManPrintStats( Gia_Man_t * p, Gps_Par_t * pPars )
Abc_Print( 1, " %slev =%5d%s", "\033[1;35m", Gia_ManLevelNum(p), "\033[0m" ); // magenta
Abc_Print( 1, " %s(%.2f)%s", "\033[1;35m", Gia_ManLevelAve(p), "\033[0m" );
#endif
}
Vec_IntFreeP( &p->vLevels );
if ( pPars && pPars->fCut )
Abc_Print( 1, " cut = %d(%d)", Gia_ManCrossCut(p, 0), Gia_ManCrossCut(p, 1) );

View File

@ -13374,6 +13374,7 @@ int Abc_CommandTest( Abc_Frame_t * pAbc, int argc, char ** argv )
// Abc_NtkComputePaths( Abc_FrameReadNtk(pAbc) );
//Dau_NetworkEnumTest();
//Extra_SimulationTest( nDivMax, nNumOnes, fNewOrder );
//Mnist_ExperimentWithScaling( nDecMax );
return 0;
usage:
Abc_Print( -2, "usage: test [-CKDNM] [-aovwh] <file_name>\n" );
@ -30229,7 +30230,7 @@ int Abc_CommandAbc9Ps( Abc_Frame_t * pAbc, int argc, char ** argv )
int c, fBest = 0;
memset( pPars, 0, sizeof(Gps_Par_t) );
Extra_UtilGetoptReset();
while ( ( c = Extra_UtilGetopt( argc, argv, "Dtpcnlmaszbh" ) ) != EOF )
while ( ( c = Extra_UtilGetopt( argc, argv, "Dtpcnlmaszxbh" ) ) != EOF )
{
switch ( c )
{
@ -30260,6 +30261,9 @@ int Abc_CommandAbc9Ps( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'z':
pPars->fSkipMap ^= 1;
break;
case 'x':
pPars->fNoColor ^= 1;
break;
case 'D':
if ( globalUtilOptind >= argc )
{
@ -30299,7 +30303,7 @@ int Abc_CommandAbc9Ps( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
usage:
Abc_Print( -2, "usage: &ps [-tpcnlmaszbh] [-D file]\n" );
Abc_Print( -2, "usage: &ps [-tpcnlmaszxbh] [-D file]\n" );
Abc_Print( -2, "\t prints stats of the current AIG\n" );
Abc_Print( -2, "\t-t : toggle printing BMC tents [default = %s]\n", pPars->fTents? "yes": "no" );
Abc_Print( -2, "\t-p : toggle printing switching activity [default = %s]\n", pPars->fSwitch? "yes": "no" );
@ -30310,7 +30314,8 @@ usage:
Abc_Print( -2, "\t-a : toggle printing miter statistics [default = %s]\n", pPars->fMiter? "yes": "no" );
Abc_Print( -2, "\t-s : toggle printing slack distribution [default = %s]\n", pPars->fSlacks? "yes": "no" );
Abc_Print( -2, "\t-z : skip mapping statistics even if mapped [default = %s]\n", pPars->fSkipMap? "yes": "no" );
Abc_Print( -2, "\t-b : toggle printing saved AIG statistics [default = %s]\n", fBest? "yes": "no" );
Abc_Print( -2, "\t-n : toggle using no color in the printout [default = %s]\n", pPars->fNoColor? "yes": "no" );
Abc_Print( -2, "\t-x : toggle printing saved AIG statistics [default = %s]\n", fBest? "yes": "no" );
Abc_Print( -2, "\t-D file : file name to dump statistics [default = none]\n" );
Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
@ -45558,7 +45563,7 @@ usage:
Abc_Print( -2, "\t-L num : limit below which we randomize [default = %d]\n", Limit );
Abc_Print( -2, "\t-B num : select best fanins among this many tries [default = %d]\n", nBestTries );
Abc_Print( -2, "\t-M num : the multiplier type (1=array, 2=booth) [default = %d]\n", Multi );
Abc_Print( -2, "\t-x : toggle using XOR gates [default = %s]\n", fVerbose? "yes": "no" );
Abc_Print( -2, "\t-x : toggle using XOR gates [default = %s]\n", fXor? "yes": "no" );
Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
Abc_Print( -2, "\t-h : print the command usage\n");
return 1;