Commit 77fde55b by Niklas Een

Added switch for netlist type to 'send_aig'. Changed defautl to &-space. Fixed…

Added switch for netlist type to 'send_aig'. Changed defautl to &-space. Fixed printf -> Abc_Print in some places.
parent 7da6ef1c
......@@ -2266,11 +2266,11 @@ int Abc_CommandPrintStatus( Abc_Frame_t * pAbc, int argc, char ** argv )
goto usage;
}
}
printf( "Status = %d Frames = %d ", pAbc->Status, pAbc->nFrames );
Abc_Print( 1,"Status = %d Frames = %d ", pAbc->Status, pAbc->nFrames );
if ( pAbc->pCex == NULL )
printf( "Cex is not defined.\n" );
Abc_Print( 1,"Cex is not defined.\n" );
else
printf( "Cex: PIs = %d Regs = %d PO = %d Frame = %d Bits = %d\n",
Abc_Print( 1,"Cex: PIs = %d Regs = %d PO = %d Frame = %d Bits = %d\n",
pAbc->pCex->nPis, pAbc->pCex->nRegs,
pAbc->pCex->iPo, pAbc->pCex->iFrame,
pAbc->pCex->nBits );
......@@ -4818,12 +4818,12 @@ int Abc_CommandTestDec( Abc_Frame_t * pAbc, int argc, char ** argv )
}
if ( argc != globalUtilOptind + 1 )
{
printf( "Input file is not given.\n" );
Abc_Print( 1,"Input file is not given.\n" );
return 0;
}
if ( nVarNum >= 0 && nVarNum < 6 )
{
printf( "The number of variables cannot be less than 6.\n" );
Abc_Print( 1,"The number of variables cannot be less than 6.\n" );
return 0;
}
// get the output file name
......@@ -4915,12 +4915,12 @@ int Abc_CommandTestNpn( Abc_Frame_t * pAbc, int argc, char ** argv )
}
if ( argc != globalUtilOptind + 1 )
{
printf( "Input file is not given.\n" );
Abc_Print( 1,"Input file is not given.\n" );
return 0;
}
if ( nVarNum >= 0 && nVarNum < 6 )
{
printf( "The number of variables cannot be less than 6.\n" );
Abc_Print( 1,"The number of variables cannot be less than 6.\n" );
return 0;
}
// get the output file name
......@@ -5953,7 +5953,7 @@ usage:
if ( nPartSize == 0 )
strcpy( Buffer, "unused" );
else
sprintf( Buffer, "%d", nPartSize );
sprintf(Buffer, "%d", nPartSize );
Abc_Print( -2, "usage: miter [-P <num>] [-cimtnh] <file1> <file2>\n" );
Abc_Print( -2, "\t computes the miter of the two circuits\n" );
Abc_Print( -2, "\t-P <num> : output partition size [default = %s]\n", Buffer );
......@@ -6125,9 +6125,9 @@ int Abc_CommandOrPos( Abc_Frame_t * pAbc, int argc, char ** argv )
Aig_ManStop( pMan );
// perform expansion
if ( Abc_NtkPoNum(pNtk) != Abc_NtkPoNum(pNtkRes) )
printf( "Expanded %d outputs into %d outputs using OR decomposition.\n", Abc_NtkPoNum(pNtk), Abc_NtkPoNum(pNtkRes) );
Abc_Print( 1,"Expanded %d outputs into %d outputs using OR decomposition.\n", Abc_NtkPoNum(pNtk), Abc_NtkPoNum(pNtkRes) );
else
printf( "The output(s) cannot be structurally decomposed.\n" );
Abc_Print( 1,"The output(s) cannot be structurally decomposed.\n" );
// clear counter-example
if ( pAbc->pCex )
ABC_FREE( pAbc->pCex );
......@@ -8760,7 +8760,7 @@ int Abc_CommandGen( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
}
// read the file just produced
sprintf( Command, "read %s", FileName );
sprintf(Command, "read %s", FileName );
Cmd_CommandExecute( pAbc, Command );
return 0;
......@@ -9145,7 +9145,7 @@ int Abc_CommandOutdec( Abc_Frame_t * pAbc, int argc, char ** argv )
globalUtilOptind++;
if ( nLits < 1 || nLits > 2 )
{
printf( "Currently, command \"outdec\" works for 1-lit and 2-lit primes only.\n" );
Abc_Print( 1,"Currently, command \"outdec\" works for 1-lit and 2-lit primes only.\n" );
goto usage;
}
break;
......@@ -11638,8 +11638,11 @@ usage:
***********************************************************************/
int Abc_CommandSendAig( Abc_Frame_t * pAbc, int argc, char ** argv )
{
extern int Gia_ManToBridgeAbsNetlist( FILE * pFile, Gia_Man_t * p );
int c, fAndSpace = 0;
extern int Gia_ManToBridgeAbsNetlist( FILE * pFile, Gia_Man_t * p, int msg_type );
const int BRIDGE_NETLIST = 106;
const int BRIDGE_ABS_NETLIST = 107;
int c, fAndSpace = 1, fAbsNetlist = 0;
Extra_UtilGetoptReset();
while ( ( c = Extra_UtilGetopt( argc, argv, "a" ) ) != EOF )
{
......@@ -11648,6 +11651,9 @@ int Abc_CommandSendAig( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'a':
fAndSpace ^= 1;
break;
case 'b':
fAbsNetlist ^= 1;
break;
default:
goto usage;
}
......@@ -11664,7 +11670,7 @@ int Abc_CommandSendAig( Abc_Frame_t * pAbc, int argc, char ** argv )
Abc_Print( -1, "There is no AIG in the &-space.\n" );
return 1;
}
Gia_ManToBridgeAbsNetlist( stdout, pAbc->pGia );
Gia_ManToBridgeAbsNetlist( stdout, pAbc->pGia, fAbsNetlist ? BRIDGE_ABS_NETLIST : BRIDGE_NETLIST );
}
else
{
......@@ -11684,7 +11690,7 @@ int Abc_CommandSendAig( Abc_Frame_t * pAbc, int argc, char ** argv )
pAig = Abc_NtkToDar( pAbc->pNtkCur, 0, 1 );
pGia = Gia_ManFromAig( pAig );
Aig_ManStop( pAig );
Gia_ManToBridgeAbsNetlist( stdout, pGia );
Gia_ManToBridgeAbsNetlist( stdout, pGia, fAbsNetlist ? BRIDGE_ABS_NETLIST : BRIDGE_NETLIST );
Gia_ManStop( pGia );
}
return 0;
......@@ -11693,6 +11699,7 @@ usage:
Abc_Print( -2, "usage: send_aig -a\n" );
Abc_Print( -2, "\t sends current AIG to the bridge\n" );
Abc_Print( -2, "\t-a : toggle sending AIG from &-space [default = %s]\n", fAndSpace? "yes": "no" );
Abc_Print( -2, "\t-b : toggle sending netlist tagged as \"abstraction\". [default = %s]\n", fAbsNetlist? "yes": "no" );
Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
......@@ -11951,7 +11958,7 @@ int Abc_CommandFraig( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
usage:
sprintf( Buffer, "%d", pParams->nBTLimit );
sprintf(Buffer, "%d", pParams->nBTLimit );
Abc_Print( -2, "usage: fraig [-R num] [-D num] [-C num] [-rscpvtah]\n" );
Abc_Print( -2, "\t transforms a logic network into a functionally reduced AIG\n" );
Abc_Print( -2, "\t (known bugs: takes an UNSAT miter and returns a SAT one)\n");
......@@ -13763,9 +13770,9 @@ int Abc_CommandMap( Abc_Frame_t * pAbc, int argc, char ** argv )
usage:
if ( DelayTarget == -1 )
sprintf( Buffer, "not used" );
sprintf(Buffer, "not used" );
else
sprintf( Buffer, "%.3f", DelayTarget );
sprintf(Buffer, "%.3f", DelayTarget );
Abc_Print( -2, "usage: map [-DAB float] [-arspvh]\n" );
Abc_Print( -2, "\t performs standard cell mapping of the current network\n" );
Abc_Print( -2, "\t-D float : sets the global required times [default = %s]\n", Buffer );
......@@ -14348,13 +14355,13 @@ int Abc_CommandFpga( Abc_Frame_t * pAbc, int argc, char ** argv )
usage:
if ( DelayTarget == -1 )
sprintf( Buffer, "best possible" );
sprintf(Buffer, "best possible" );
else
sprintf( Buffer, "%.2f", DelayTarget );
sprintf(Buffer, "%.2f", DelayTarget );
if ( nLutSize == -1 )
sprintf( LutSize, "library" );
sprintf(LutSize, "library" );
else
sprintf( LutSize, "%d", nLutSize );
sprintf(LutSize, "%d", nLutSize );
Abc_Print( -2, "usage: fpga [-D float] [-K num] [-aplvh]\n" );
Abc_Print( -2, "\t performs FPGA mapping of the current network\n" );
Abc_Print( -2, "\t-a : toggles area recovery [default = %s]\n", fRecovery? "yes": "no" );
......@@ -14485,9 +14492,9 @@ int Abc_CommandFpgaFast( Abc_Frame_t * pAbc, int argc, char ** argv )
usage:
if ( DelayTarget == -1 )
sprintf( Buffer, "not used" );
sprintf(Buffer, "not used" );
else
sprintf( Buffer, "%.2f", DelayTarget );
sprintf(Buffer, "%.2f", DelayTarget );
Abc_Print( -2, "usage: ffpga [-K num] [-avh]\n" );
Abc_Print( -2, "\t performs fast FPGA mapping of the current network\n" );
Abc_Print( -2, "\t-a : toggles area recovery [default = %s]\n", fRecovery? "yes": "no" );
......@@ -14948,13 +14955,13 @@ int Abc_CommandIf( Abc_Frame_t * pAbc, int argc, char ** argv )
usage:
if ( pPars->DelayTarget == -1 )
sprintf( Buffer, "best possible" );
sprintf(Buffer, "best possible" );
else
sprintf( Buffer, "%.2f", pPars->DelayTarget );
sprintf(Buffer, "%.2f", pPars->DelayTarget );
if ( pPars->nLutSize == -1 )
sprintf( LutSize, "library" );
sprintf(LutSize, "library" );
else
sprintf( LutSize, "%d", pPars->nLutSize );
sprintf(LutSize, "%d", pPars->nLutSize );
Abc_Print( -2, "usage: if [-KCFAG num] [-DEW float] [-S str] [-qarlepmsdbugyojikcvh]\n" );
Abc_Print( -2, "\t performs FPGA technology mapping of the network\n" );
Abc_Print( -2, "\t-K num : the number of LUT inputs (2 < num < %d) [default = %s]\n", IF_MAX_LUTSIZE+1, LutSize );
......@@ -18699,7 +18706,7 @@ usage:
if ( nPartSize == 0 )
strcpy( Buffer, "unused" );
else
sprintf( Buffer, "%d", nPartSize );
sprintf(Buffer, "%d", nPartSize );
Abc_Print( -2, "usage: cec [-T num] [-C num] [-I num] [-P num] [-psnvh] <file1> <file2>\n" );
Abc_Print( -2, "\t performs combinational equivalence checking\n" );
Abc_Print( -2, "\t-T num : approximate runtime limit in seconds [default = %d]\n", nSeconds );
......@@ -19230,7 +19237,7 @@ int Abc_CommandDProve( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( pSecPar->fReadUnsolved && pSecPar->nSMnumber >= 0 )
{
char FileName[100];
sprintf( FileName, "sm%02d.aig", pSecPar->nSMnumber );
sprintf(FileName, "sm%02d.aig", pSecPar->nSMnumber );
pNtk = Io_Read( FileName, Io_ReadFileType(FileName), 1 );
if ( pNtk == NULL )
Abc_Print( -1, "Cannot read back unsolved reduced sequential miter \"%s\",\n", FileName );
......@@ -20829,9 +20836,9 @@ int Abc_CommandBmc3( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( pPars->fSolveAll && pPars->fDropSatOuts )
{
if ( pNtk->vSeqModelVec == NULL )
printf( "The array of counter-examples is not available.\n" );
Abc_Print( 1,"The array of counter-examples is not available.\n" );
else if ( Vec_PtrSize(pNtk->vSeqModelVec) != Abc_NtkPoNum(pNtk) )
printf( "The array size does not match the number of outputs.\n" );
Abc_Print( 1,"The array size does not match the number of outputs.\n" );
else
{
extern void Abc_NtkDropSatOutputs( Abc_Ntk_t * pNtk, Vec_Ptr_t * vCexes, int fVerbose );
......@@ -21013,7 +21020,7 @@ int Abc_CommandBmcInter( Abc_Frame_t * pAbc, int argc, char ** argv )
{
if ( Abc_NtkConstrNum(pNtk) > 0 )
{
printf( "Cannot solve multiple-output miter with constraints.\n" );
Abc_Print( 1,"Cannot solve multiple-output miter with constraints.\n" );
return 0;
}
if ( pPars->fUseSeparate )
......@@ -21588,7 +21595,7 @@ int Abc_CommandInduction( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( fGetCex )
{
Abc_FrameReplaceCex( pAbc, &pNtk->pSeqModel );
printf( "The current CEX in ABC is set to be the CEX to induction.\n" );
Abc_Print( 1,"The current CEX in ABC is set to be the CEX to induction.\n" );
}
return 0;
usage:
......@@ -21904,7 +21911,7 @@ int Abc_CommandUnfold( Abc_Frame_t * pAbc, int argc, char ** argv )
pNtkRes = Abc_NtkDarUnfold( pNtk, nFrames, nConfs, nProps, fStruct, fOldAlgo, fVerbose );
if ( pNtkRes == NULL )
{
printf( "Transformation has failed.\n" );
Abc_Print( 1,"Transformation has failed.\n" );
return 0;
}
// replace the current network
......@@ -21986,7 +21993,7 @@ int Abc_CommandFold( Abc_Frame_t * pAbc, int argc, char ** argv )
pNtkRes = Abc_NtkDarFold( pNtk, fCompl, fVerbose );
if ( pNtkRes == NULL )
{
printf( "Transformation has failed.\n" );
Abc_Print( 1,"Transformation has failed.\n" );
return 0;
}
// replace the current network
......@@ -22410,12 +22417,12 @@ int Abc_CommandReconcile( Abc_Frame_t * pAbc, int argc, char ** argv )
}
if ( argc != globalUtilOptind + 2 )
{
printf( "Does not seen to have two files names as arguments.\n" );
Abc_Print( 1,"Does not seen to have two files names as arguments.\n" );
return 1;
}
if ( pAbc->pCex == NULL )
{
printf( "There is no current counter-example.\n" );
Abc_Print( 1,"There is no current counter-example.\n" );
return 1;
}
......@@ -22438,7 +22445,7 @@ int Abc_CommandReconcile( Abc_Frame_t * pAbc, int argc, char ** argv )
Abc_NtkDelete( pNtk2 );
if ( pCex == NULL )
{
printf( "Counter-example computation has failed.\n" );
Abc_Print( 1,"Counter-example computation has failed.\n" );
Abc_NtkDelete( pNtk1 );
return 1;
}
......@@ -22563,7 +22570,7 @@ int Abc_CommandCexMin( Abc_Frame_t * pAbc, int argc, char ** argv )
Abc_CexFree( vCexNew );
// Abc_FrameReplaceCex( pAbc, &vCexNew );
// printf( "Implementation of this command is not finished.\n" );
// Abc_Print( 1,"Implementation of this command is not finished.\n" );
}
return 0;
......@@ -26159,8 +26166,8 @@ int Abc_CommandAbc9Srm( Abc_Frame_t * pAbc, int argc, char ** argv )
Abc_Print( -1, "Abc_CommandAbc9Srm(): There is no AIG.\n" );
return 1;
}
sprintf( pFileName, "gsrm%s.aig", fSpeculate? "" : "s" );
sprintf( pFileName2, "gsyn%s.aig", fSpeculate? "" : "s" );
sprintf(pFileName, "gsrm%s.aig", fSpeculate? "" : "s" );
sprintf(pFileName2, "gsyn%s.aig", fSpeculate? "" : "s" );
pTemp = Gia_ManSpecReduce( pAbc->pGia, fDualOut, fSynthesis, fSpeculate, fSkipSome, fVerbose );
if ( pTemp )
{
......@@ -26260,7 +26267,7 @@ int Abc_CommandAbc9Srm2( Abc_Frame_t * pAbc, int argc, char ** argv )
pFileName1 = argv[globalUtilOptind];
pFileName2 = argv[globalUtilOptind+1];
// create file name
sprintf( pFileName, "gsrm.aig" );
sprintf(pFileName, "gsrm.aig" );
pTemp = Gia_ManDup( pAbc->pGia );
// copy equivalences
pTemp->pReprs = ABC_ALLOC( Gia_Rpr_t, Gia_ManObjNum(pTemp) );
......@@ -27141,13 +27148,13 @@ int Abc_CommandAbc9If( Abc_Frame_t * pAbc, int argc, char ** argv )
usage:
if ( pPars->DelayTarget == -1 )
sprintf( Buffer, "best possible" );
sprintf(Buffer, "best possible" );
else
sprintf( Buffer, "%.2f", pPars->DelayTarget );
sprintf(Buffer, "%.2f", pPars->DelayTarget );
if ( pPars->nLutSize == -1 )
sprintf( LutSize, "library" );
sprintf(LutSize, "library" );
else
sprintf( LutSize, "%d", pPars->nLutSize );
sprintf(LutSize, "%d", pPars->nLutSize );
Abc_Print( -2, "usage: &if [-KCFAG num] [-DEW float] [-S str] [-qarlepmsdbgyojikcvh]\n" );
Abc_Print( -2, "\t performs FPGA technology mapping of the network\n" );
Abc_Print( -2, "\t-K num : the number of LUT inputs (2 < num < %d) [default = %s]\n", IF_MAX_LUTSIZE+1, LutSize );
......@@ -28766,7 +28773,7 @@ int Abc_CommandAbc9GlaDerive( Abc_Frame_t * pAbc, int argc, char ** argv )
Gia_ManStop( pTemp );
pTemp = Gia_ManDupAbsGates( pAbc->pGia, pAbc->pGia->vGateClasses );
Abc_CommandUpdate9( pAbc, pTemp );
// printf( "This command is currently not enabled.\n" );
// Abc_Print( 1,"This command is currently not enabled.\n" );
return 0;
usage:
......
......@@ -193,7 +193,6 @@ float Abc_NtkGetArea( Abc_Ntk_t * pNtk )
***********************************************************************/
void Abc_NtkPrintStats( Abc_Ntk_t * pNtk, int fFactored, int fSaveBest, int fDumpResult, int fUseLutLib, int fPrintMuxes, int fPower, int fGlitch )
{
FILE * pFile = stdout;
int Num;
if ( fSaveBest )
Abc_NtkCompareAndSaveBest( pNtk );
......@@ -209,38 +208,38 @@ void Abc_NtkPrintStats( Abc_Ntk_t * pNtk, int fFactored, int fSaveBest, int fDum
// if ( Abc_NtkIsStrash(pNtk) )
// Abc_AigCountNext( pNtk->pManFunc );
fprintf( pFile, "%-13s:", pNtk->pName );
fprintf( pFile, " i/o =%5d/%5d", Abc_NtkPiNum(pNtk), Abc_NtkPoNum(pNtk) );
Abc_Print( 1,"%-13s:", pNtk->pName );
Abc_Print( 1," i/o =%5d/%5d", Abc_NtkPiNum(pNtk), Abc_NtkPoNum(pNtk) );
if ( Abc_NtkConstrNum(pNtk) )
fprintf( pFile, "(c=%d)", Abc_NtkConstrNum(pNtk) );
Abc_Print( 1,"(c=%d)", Abc_NtkConstrNum(pNtk) );
if ( pNtk->nRealPos )
fprintf( pFile, "(p=%d)", Abc_NtkPoNum(pNtk) - pNtk->nRealPos );
fprintf( pFile, " lat =%5d", Abc_NtkLatchNum(pNtk) );
Abc_Print( 1,"(p=%d)", Abc_NtkPoNum(pNtk) - pNtk->nRealPos );
Abc_Print( 1," lat =%5d", Abc_NtkLatchNum(pNtk) );
if ( Abc_NtkIsNetlist(pNtk) )
{
fprintf( pFile, " net =%5d", Abc_NtkNetNum(pNtk) );
fprintf( pFile, " nd =%5d", Abc_NtkNodeNum(pNtk) );
fprintf( pFile, " wbox =%3d", Abc_NtkWhiteboxNum(pNtk) );
fprintf( pFile, " bbox =%3d", Abc_NtkBlackboxNum(pNtk) );
Abc_Print( 1," net =%5d", Abc_NtkNetNum(pNtk) );
Abc_Print( 1," nd =%5d", Abc_NtkNodeNum(pNtk) );
Abc_Print( 1," wbox =%3d", Abc_NtkWhiteboxNum(pNtk) );
Abc_Print( 1," bbox =%3d", Abc_NtkBlackboxNum(pNtk) );
}
else if ( Abc_NtkIsStrash(pNtk) )
{
fprintf( pFile, " and =%7d", Abc_NtkNodeNum(pNtk) );
Abc_Print( 1," and =%7d", Abc_NtkNodeNum(pNtk) );
if ( (Num = Abc_NtkGetChoiceNum(pNtk)) )
fprintf( pFile, " (choice = %d)", Num );
Abc_Print( 1," (choice = %d)", Num );
if ( fPrintMuxes )
{
extern int Abc_NtkCountMuxes( Abc_Ntk_t * pNtk );
Num = Abc_NtkGetExorNum(pNtk);
fprintf( pFile, " (exor = %d)", Num );
fprintf( pFile, " (mux = %d)", Abc_NtkCountMuxes(pNtk)-Num );
fprintf( pFile, " (pure and = %d)", Abc_NtkNodeNum(pNtk) - (Abc_NtkCountMuxes(pNtk) * 3) );
Abc_Print( 1," (exor = %d)", Num );
Abc_Print( 1," (mux = %d)", Abc_NtkCountMuxes(pNtk)-Num );
Abc_Print( 1," (pure and = %d)", Abc_NtkNodeNum(pNtk) - (Abc_NtkCountMuxes(pNtk) * 3) );
}
}
else
{
fprintf( pFile, " nd =%6d", Abc_NtkNodeNum(pNtk) );
fprintf( pFile, " edge =%7d", Abc_NtkGetTotalFanins(pNtk) );
Abc_Print( 1," nd =%6d", Abc_NtkNodeNum(pNtk) );
Abc_Print( 1," edge =%7d", Abc_NtkGetTotalFanins(pNtk) );
}
if ( Abc_NtkIsStrash(pNtk) || Abc_NtkIsNetlist(pNtk) )
......@@ -249,19 +248,19 @@ void Abc_NtkPrintStats( Abc_Ntk_t * pNtk, int fFactored, int fSaveBest, int fDum
else if ( Abc_NtkHasSop(pNtk) )
{
fprintf( pFile, " cube =%6d", Abc_NtkGetCubeNum(pNtk) );
// fprintf( pFile, " lit(sop) = %5d", Abc_NtkGetLitNum(pNtk) );
Abc_Print( 1," cube =%6d", Abc_NtkGetCubeNum(pNtk) );
// Abc_Print( 1," lit(sop) = %5d", Abc_NtkGetLitNum(pNtk) );
if ( fFactored )
fprintf( pFile, " lit(fac) =%6d", Abc_NtkGetLitFactNum(pNtk) );
Abc_Print( 1," lit(fac) =%6d", Abc_NtkGetLitFactNum(pNtk) );
}
else if ( Abc_NtkHasAig(pNtk) )
fprintf( pFile, " aig =%6d", Abc_NtkGetAigNodeNum(pNtk) );
Abc_Print( 1," aig =%6d", Abc_NtkGetAigNodeNum(pNtk) );
else if ( Abc_NtkHasBdd(pNtk) )
fprintf( pFile, " bdd =%6d", Abc_NtkGetBddNodeNum(pNtk) );
Abc_Print( 1," bdd =%6d", Abc_NtkGetBddNodeNum(pNtk) );
else if ( Abc_NtkHasMapping(pNtk) )
{
fprintf( pFile, " area =%5.2f", Abc_NtkGetMappedArea(pNtk) );
fprintf( pFile, " delay =%5.2f", Abc_NtkDelayTrace(pNtk, NULL, NULL, 0) );
Abc_Print( 1," area =%5.2f", Abc_NtkGetMappedArea(pNtk) );
Abc_Print( 1," delay =%5.2f", Abc_NtkDelayTrace(pNtk, NULL, NULL, 0) );
}
else if ( !Abc_NtkHasBlackbox(pNtk) )
{
......@@ -271,27 +270,27 @@ void Abc_NtkPrintStats( Abc_Ntk_t * pNtk, int fFactored, int fSaveBest, int fDum
if ( Abc_NtkIsStrash(pNtk) )
{
extern int Abc_NtkGetMultiRefNum( Abc_Ntk_t * pNtk );
fprintf( pFile, " lev =%3d", Abc_AigLevel(pNtk) );
// fprintf( pFile, " ff = %5d", Abc_NtkNodeNum(pNtk) + 2 * (Abc_NtkCoNum(pNtk)+Abc_NtkGetMultiRefNum(pNtk)) );
// fprintf( pFile, " var = %5d", Abc_NtkCiNum(pNtk) + Abc_NtkCoNum(pNtk)+Abc_NtkGetMultiRefNum(pNtk) );
Abc_Print( 1," lev =%3d", Abc_AigLevel(pNtk) );
// Abc_Print( 1," ff = %5d", Abc_NtkNodeNum(pNtk) + 2 * (Abc_NtkCoNum(pNtk)+Abc_NtkGetMultiRefNum(pNtk)) );
// Abc_Print( 1," var = %5d", Abc_NtkCiNum(pNtk) + Abc_NtkCoNum(pNtk)+Abc_NtkGetMultiRefNum(pNtk) );
}
else
fprintf( pFile, " lev =%3d", Abc_NtkLevel(pNtk) );
Abc_Print( 1," lev =%3d", Abc_NtkLevel(pNtk) );
if ( fUseLutLib && Abc_FrameReadLibLut() )
fprintf( pFile, " delay =%5.2f", Abc_NtkDelayTraceLut(pNtk, 1) );
Abc_Print( 1," delay =%5.2f", Abc_NtkDelayTraceLut(pNtk, 1) );
if ( fUseLutLib && Abc_FrameReadLibLut() )
fprintf( pFile, " area =%5.2f", Abc_NtkGetArea(pNtk) );
Abc_Print( 1," area =%5.2f", Abc_NtkGetArea(pNtk) );
if ( fPower )
fprintf( pFile, " power =%7.2f", Abc_NtkMfsTotalSwitching(pNtk) );
Abc_Print( 1," power =%7.2f", Abc_NtkMfsTotalSwitching(pNtk) );
if ( fGlitch )
{
extern float Abc_NtkMfsTotalGlitching( Abc_Ntk_t * pNtk );
if ( Abc_NtkIsLogic(pNtk) && Abc_NtkGetFaninMax(pNtk) <= 6 )
fprintf( pFile, " glitch =%7.2f %%", Abc_NtkMfsTotalGlitching(pNtk) );
Abc_Print( 1," glitch =%7.2f %%", Abc_NtkMfsTotalGlitching(pNtk) );
else
printf( "\nCurrently computes glitching only for K-LUT networks with K <= 6." );
}
fprintf( pFile, "\n" );
Abc_Print( 1,"\n" );
{
// extern int Abc_NtkPrintSubraphSizes( Abc_Ntk_t * pNtk );
......@@ -1548,4 +1547,3 @@ void Abc_NtkShow6VarFunc( char * pF0, char * pF1 )
ABC_NAMESPACE_IMPL_END
......@@ -247,12 +247,20 @@ int CmdCommandEcho( Abc_Frame_t * pAbc, int argc, char **argv )
}
}
if (pAbc->Out == stdout){
for ( i = globalUtilOptind; i < argc; i++ )
Abc_Print( 1, "%s ", argv[i] );
if ( n )
Abc_Print( 1, "\n" );
}else{
for ( i = globalUtilOptind; i < argc; i++ )
fprintf( pAbc->Out, "%s ", argv[i] );
if ( n )
fprintf( pAbc->Out, "\n" );
else
fflush ( pAbc->Out );
}
return 0;
usage:
......@@ -2122,4 +2130,3 @@ int CmdCommandVersion( Abc_Frame_t * pAbc, int argc, char **argv )
ABC_NAMESPACE_IMPL_END
......@@ -276,10 +276,19 @@ static inline void Abc_Print( int level, const char * format, ... )
{
extern ABC_DLL int Abc_FrameIsBridgeMode();
va_list args;
if ( ! Abc_FrameIsBridgeMode() ){
if ( level == ABC_ERROR )
printf( "Error: " );
else if ( level == ABC_WARNING )
printf( "Warning: " );
}else{
if ( level == ABC_ERROR )
Gia_ManToBridgeText( stdout, strlen("Error: "), (unsigned char*)"Error: " );
else if ( level == ABC_WARNING )
Gia_ManToBridgeText( stdout, strlen("Warning: "), (unsigned char*)"Warning: " );
}
va_start( args, format );
if ( Abc_FrameIsBridgeMode() )
{
......
......@@ -33,6 +33,7 @@ ABC_NAMESPACE_IMPL_START
#define BRIDGE_TEXT_MESSAGE 999996
#define BRIDGE_RESULTS 101
#define BRIDGE_NETLIST 106
#define BRIDGE_ABS_NETLIST 107
#define BRIDGE_BAD_ABS 105
......@@ -150,11 +151,11 @@ int Gia_ManToBridgeText( FILE * pFile, int Size, unsigned char * pBuffer )
Gia_CreateHeader( pFile, BRIDGE_TEXT_MESSAGE, Size, pBuffer );
return 1;
}
int Gia_ManToBridgeAbsNetlist( FILE * pFile, Gia_Man_t * p )
int Gia_ManToBridgeAbsNetlist( FILE * pFile, Gia_Man_t * p, int pkg_type )
{
Vec_Str_t * vBuffer;
vBuffer = Gia_ManToBridgeVec( p );
Gia_CreateHeader( pFile, BRIDGE_ABS_NETLIST, Vec_StrSize(vBuffer), (unsigned char *)Vec_StrArray(vBuffer) );
Gia_CreateHeader( pFile, pkg_type, Vec_StrSize(vBuffer), (unsigned char *)Vec_StrArray(vBuffer) );
Vec_StrFree( vBuffer );
return 1;
}
......@@ -449,7 +450,7 @@ Gia_Man_t * Gia_ManFromBridge( FILE * pFile, Vec_Int_t ** pvInit )
SeeAlso []
***********************************************************************/
void Gia_ManToBridgeAbsNetlistTest( char * pFileName, Gia_Man_t * p )
void Gia_ManToBridgeAbsNetlistTest( char * pFileName, Gia_Man_t * p, int msg_type )
{
FILE * pFile = fopen( pFileName, "wb" );
if ( pFile == NULL )
......@@ -457,7 +458,7 @@ void Gia_ManToBridgeAbsNetlistTest( char * pFileName, Gia_Man_t * p )
printf( "Cannot open output file \"%s\".\n", pFileName );
return;
}
Gia_ManToBridgeAbsNetlist( pFile, p );
Gia_ManToBridgeAbsNetlist( pFile, p, msg_type );
fclose ( pFile );
}
......@@ -488,7 +489,7 @@ void Gia_ManFromBridgeTest( char * pFileName )
Gia_ManPrintStats( p, 0, 0 );
Gia_WriteAiger( p, "temp.aig", 0, 0 );
Gia_ManToBridgeAbsNetlistTest( "par_.dump", p );
Gia_ManToBridgeAbsNetlistTest( "par_.dump", p, BRIDGE_ABS_NETLIST );
Gia_ManStop( p );
}
......
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