diff options
Diffstat (limited to 'src/base')
-rw-r--r-- | src/base/abci/abc.c | 100 | ||||
-rw-r--r-- | src/base/acb/acbFunc.c | 4 | ||||
-rw-r--r-- | src/base/acb/acbUtil.c | 4 |
3 files changed, 106 insertions, 2 deletions
diff --git a/src/base/abci/abc.c b/src/base/abci/abc.c index 85053e18..70ef45ca 100644 --- a/src/base/abci/abc.c +++ b/src/base/abci/abc.c @@ -437,6 +437,7 @@ static int Abc_CommandAbc9Shrink ( Abc_Frame_t * pAbc, int argc, cha static int Abc_CommandAbc9Fx ( Abc_Frame_t * pAbc, int argc, char ** argv ); static int Abc_CommandAbc9Balance ( Abc_Frame_t * pAbc, int argc, char ** argv ); static int Abc_CommandAbc9BalanceLut ( Abc_Frame_t * pAbc, int argc, char ** argv ); +static int Abc_CommandAbc9Resub ( Abc_Frame_t * pAbc, int argc, char ** argv ); static int Abc_CommandAbc9Syn2 ( Abc_Frame_t * pAbc, int argc, char ** argv ); static int Abc_CommandAbc9Syn3 ( Abc_Frame_t * pAbc, int argc, char ** argv ); static int Abc_CommandAbc9Syn4 ( Abc_Frame_t * pAbc, int argc, char ** argv ); @@ -1156,6 +1157,7 @@ void Abc_Init( Abc_Frame_t * pAbc ) Cmd_CommandAdd( pAbc, "ABC9", "&fx", Abc_CommandAbc9Fx, 0 ); Cmd_CommandAdd( pAbc, "ABC9", "&b", Abc_CommandAbc9Balance, 0 ); Cmd_CommandAdd( pAbc, "ABC9", "&blut", Abc_CommandAbc9BalanceLut, 0 ); + Cmd_CommandAdd( pAbc, "ABC9", "&resub", Abc_CommandAbc9Resub, 0 ); Cmd_CommandAdd( pAbc, "ABC9", "&syn2", Abc_CommandAbc9Syn2, 0 ); Cmd_CommandAdd( pAbc, "ABC9", "&syn3", Abc_CommandAbc9Syn3, 0 ); Cmd_CommandAdd( pAbc, "ABC9", "&syn4", Abc_CommandAbc9Syn4, 0 ); @@ -34780,6 +34782,104 @@ usage: SeeAlso [] ***********************************************************************/ +int Abc_CommandAbc9Resub( Abc_Frame_t * pAbc, int argc, char ** argv ) +{ + extern Gia_Man_t * Gia_ManResub1( char * pFileName, int nNodes, int nSupp, int nDivs, int fVerbose, int fVeryVerbose ); + extern Gia_Man_t * Gia_ManResub2( Gia_Man_t * pGia, int nNodes, int nSupp, int nDivs, int fVerbose, int fVeryVerbose ); + Gia_Man_t * pTemp; + int nNodes = 0; + int nSupp = 0; + int nDivs = 0; + int c, fVerbose = 0; + int fVeryVerbose = 0; + Extra_UtilGetoptReset(); + while ( ( c = Extra_UtilGetopt( argc, argv, "NSDvwh" ) ) != EOF ) + { + switch ( c ) + { + case 'N': + if ( globalUtilOptind >= argc ) + { + Abc_Print( 1, "Command line switch \"-N\" should be followed by a floating point number.\n" ); + return 0; + } + nNodes = atoi(argv[globalUtilOptind]); + globalUtilOptind++; + if ( nNodes < 0 ) + goto usage; + break; + case 'S': + if ( globalUtilOptind >= argc ) + { + Abc_Print( 1, "Command line switch \"-S\" should be followed by a floating point number.\n" ); + return 0; + } + nSupp = atoi(argv[globalUtilOptind]); + globalUtilOptind++; + if ( nSupp < 0 ) + goto usage; + break; + case 'D': + if ( globalUtilOptind >= argc ) + { + Abc_Print( 1, "Command line switch \"-D\" should be followed by a floating point number.\n" ); + return 0; + } + nDivs = atoi(argv[globalUtilOptind]); + globalUtilOptind++; + if ( nDivs < 0 ) + goto usage; + break; + case 'v': + fVerbose ^= 1; + break; + case 'w': + fVeryVerbose ^= 1; + break; + case 'h': + goto usage; + default: + goto usage; + } + } + if ( argc == globalUtilOptind + 1 ) + { + pTemp = Gia_ManResub1( argv[globalUtilOptind], nNodes, nSupp, nDivs, fVerbose, fVeryVerbose ); + Abc_FrameUpdateGia( pAbc, pTemp ); + return 0; + } + if ( pAbc->pGia == NULL ) + { + Abc_Print( -1, "Abc_CommandAbc9Resub(): There is no AIG.\n" ); + return 1; + } + pTemp = Gia_ManResub2( pAbc->pGia, nNodes, nSupp, nDivs, fVerbose, fVeryVerbose ); + Abc_FrameUpdateGia( pAbc, pTemp ); + return 0; + +usage: + Abc_Print( -2, "usage: &resub [-NSD num] [-vwh]\n" ); + Abc_Print( -2, "\t performs AIG resubstitution\n" ); + Abc_Print( -2, "\t-N num : the limit on added nodes (num >= 0) [default = %d]\n", nNodes ); + Abc_Print( -2, "\t-S num : the limit on support size (num > 0) [default = %d]\n", nSupp ); + Abc_Print( -2, "\t-D num : the limit on divisor count (num > 0) [default = %d]\n", nDivs ); + Abc_Print( -2, "\t-v : toggles printing verbose information [default = %s]\n", fVerbose? "yes": "no" ); + Abc_Print( -2, "\t-w : toggles printing additional information [default = %s]\n", fVeryVerbose? "yes": "no" ); + Abc_Print( -2, "\t-h : print the command usage\n"); + return 1; +} + +/**Function************************************************************* + + Synopsis [] + + Description [] + + SideEffects [] + + SeeAlso [] + +***********************************************************************/ int Abc_CommandAbc9Syn2( Abc_Frame_t * pAbc, int argc, char ** argv ) { Gia_Man_t * pTemp; diff --git a/src/base/acb/acbFunc.c b/src/base/acb/acbFunc.c index 8f72a00f..485a5e4e 100644 --- a/src/base/acb/acbFunc.c +++ b/src/base/acb/acbFunc.c @@ -1541,7 +1541,7 @@ char * Acb_EnumerateSatAssigns( sat_solver * pSat, int PivotVar, int FreeVar, Ve { if ( iMint == 1000 ) { - //if ( Vec_IntSize(vDivVars) == 0 ) + if ( Vec_IntSize(vDivVars) == 0 ) { printf( "Assuming constant 0 function.\n" ); Vec_StrClear( vTempSop ); @@ -2511,7 +2511,7 @@ int Acb_NtkEcoPerform( Acb_Ntk_t * pNtkF, Acb_Ntk_t * pNtkG, char * pFileName[4] abctime clk = Abc_Clock(); int nTargets = Vec_IntSize(&pNtkF->vTargets); - int TimeOut = fCisOnly ? 0 : 60; // 60 seconds + int TimeOut = fCisOnly ? 0 : 120; // 60 seconds int RetValue = 1; // compute various sets of nodes diff --git a/src/base/acb/acbUtil.c b/src/base/acb/acbUtil.c index 2243541b..8a51bd3e 100644 --- a/src/base/acb/acbUtil.c +++ b/src/base/acb/acbUtil.c @@ -671,6 +671,8 @@ int Acb_NtkExtract( char * pFileName0, char * pFileName1, int fUseXors, int fVer int nTargets = Vec_IntSize(&pNtkF->vTargets); Gia_Man_t * pGiaF = Acb_NtkToGia2( pNtkF, fUseBuf, fUseXors, &pNtkF->vTargets, 0 ); Gia_Man_t * pGiaG = Acb_NtkToGia2( pNtkG, 0, 0, NULL, nTargets ); + pGiaF->pSpec = Abc_UtilStrsav( pNtkF->pDesign->pSpec ); + pGiaG->pSpec = Abc_UtilStrsav( pNtkG->pDesign->pSpec ); assert( Acb_NtkCiNum(pNtkF) == Acb_NtkCiNum(pNtkG) ); assert( Acb_NtkCoNum(pNtkF) == Acb_NtkCoNum(pNtkG) ); *ppGiaF = pGiaF; @@ -784,6 +786,8 @@ int Abc_NtkExtract( char * pFileName0, char * pFileName1, int fUseXors, int fVer Gia_Man_t * pGiaG = Abc_NtkToGia2( pNtkG, 0 ); assert( Abc_NtkCiNum(pNtkF) == Abc_NtkCiNum(pNtkG) ); assert( Abc_NtkCoNum(pNtkF) == Abc_NtkCoNum(pNtkG) ); + pGiaF->pSpec = Abc_UtilStrsav( pNtkF->pSpec ); + pGiaG->pSpec = Abc_UtilStrsav( pNtkG->pSpec ); *ppGiaF = pGiaF; *ppGiaG = pGiaG; *pvNodes = Abc_NtkCollectCopies( pNtkF, pGiaF, pvNodesR, pvPolar ); |