diff options
Diffstat (limited to 'src/base')
-rw-r--r-- | src/base/abci/abc.c | 35 | ||||
-rw-r--r-- | src/base/abci/abcAbc8.c | 35 | ||||
-rw-r--r-- | src/base/abci/abcDar.c | 34 |
3 files changed, 95 insertions, 9 deletions
diff --git a/src/base/abci/abc.c b/src/base/abci/abc.c index 6340f358..14f635e3 100644 --- a/src/base/abci/abc.c +++ b/src/base/abci/abc.c @@ -11021,7 +11021,7 @@ int Abc_CommandIf( Abc_Frame_t * pAbc, int argc, char ** argv ) pPars->nFlowIters = 1; pPars->nAreaIters = 2; pPars->DelayTarget = -1; - pPars->Epsilon = (float)0.001; + pPars->Epsilon = (float)0.005; pPars->fPreprocess = 1; pPars->fArea = 0; pPars->fFancy = 0; @@ -11918,23 +11918,30 @@ int Abc_CommandDRetime( Abc_Frame_t * pAbc, int argc, char ** argv ) { FILE * pOut, * pErr; Abc_Ntk_t * pNtk, * pNtkRes; + int fMinArea; + int fForwardOnly; + int fBackwardOnly; int nStepsMax; int fFastAlgo; int fVerbose; int c; extern Abc_Ntk_t * Abc_NtkDarRetime( Abc_Ntk_t * pNtk, int nStepsMax, int fVerbose ); extern Abc_Ntk_t * Abc_NtkDarRetimeF( Abc_Ntk_t * pNtk, int nStepsMax, int fVerbose ); + extern Abc_Ntk_t * Abc_NtkDarRetimeMinArea( Abc_Ntk_t * pNtk, int fForwardOnly, int fBackwardOnly, int fVerbose ); pNtk = Abc_FrameReadNtk(pAbc); pOut = Abc_FrameReadOut(pAbc); pErr = Abc_FrameReadErr(pAbc); // set defaults + fMinArea = 1; + fForwardOnly = 1; + fBackwardOnly = 0; nStepsMax = 100000; - fFastAlgo = 0; + fFastAlgo = 1; fVerbose = 0; Extra_UtilGetoptReset(); - while ( ( c = Extra_UtilGetopt( argc, argv, "Savh" ) ) != EOF ) + while ( ( c = Extra_UtilGetopt( argc, argv, "Smfbavh" ) ) != EOF ) { switch ( c ) { @@ -11949,6 +11956,15 @@ int Abc_CommandDRetime( Abc_Frame_t * pAbc, int argc, char ** argv ) if ( nStepsMax < 0 ) goto usage; break; + case 'm': + fMinArea ^= 1; + break; + case 'f': + fForwardOnly ^= 1; + break; + case 'b': + fBackwardOnly ^= 1; + break; case 'a': fFastAlgo ^= 1; break; @@ -11981,7 +11997,9 @@ int Abc_CommandDRetime( Abc_Frame_t * pAbc, int argc, char ** argv ) } // perform the retiming - if ( fFastAlgo ) + if ( fMinArea ) + pNtkRes = Abc_NtkDarRetimeMinArea( pNtk, fForwardOnly, fBackwardOnly, fVerbose ); + else if ( fFastAlgo ) pNtkRes = Abc_NtkDarRetime( pNtk, nStepsMax, fVerbose ); else pNtkRes = Abc_NtkDarRetimeF( pNtk, nStepsMax, fVerbose ); @@ -11995,10 +12013,13 @@ int Abc_CommandDRetime( Abc_Frame_t * pAbc, int argc, char ** argv ) return 0; usage: - fprintf( pErr, "usage: dretime [-S num] [-avh]\n" ); + fprintf( pErr, "usage: dretime [-S num] [-mfbavh]\n" ); fprintf( pErr, "\t retimes the current network forward\n" ); - fprintf( pErr, "\t-S num : the max number of retiming steps to perform [default = %d]\n", nStepsMax ); - fprintf( pErr, "\t-a : enables a fast algorithm [default = %s]\n", fFastAlgo? "yes": "no" ); + fprintf( pErr, "\t-m : toggle min-area and most-forward retiming [default = %s]\n", fMinArea? "min-area": "most-fwd" ); + fprintf( pErr, "\t-f : enables forward-only retiming [default = %s]\n", fForwardOnly? "yes": "no" ); + fprintf( pErr, "\t-b : enables backward-only retiming [default = %s]\n", fBackwardOnly? "yes": "no" ); + fprintf( pErr, "\t-S num : the max number of forward retiming steps to perform [default = %d]\n", nStepsMax ); + fprintf( pErr, "\t-a : enables a fast most-forward algorithm [default = %s]\n", fFastAlgo? "yes": "no" ); fprintf( pErr, "\t-v : enables verbose output [default = %s]\n", fVerbose? "yes": "no" ); fprintf( pErr, "\t-h : print the command usage\n"); return 1; diff --git a/src/base/abci/abcAbc8.c b/src/base/abci/abcAbc8.c index b2359763..d58f6b7e 100644 --- a/src/base/abci/abcAbc8.c +++ b/src/base/abci/abcAbc8.c @@ -50,7 +50,7 @@ Nwk_Man_t * Abc_NtkToNtkNew( Abc_Ntk_t * pNtk ) int i, k; if ( !Abc_NtkIsLogic(pNtk) ) { - fprintf( stdout, "Thsi is not a logic network.\n" ); + fprintf( stdout, "This is not a logic network.\n" ); return 0; } // convert into the AIG @@ -219,7 +219,7 @@ PRT( "Time", clock() - clk ); SeeAlso [] ***********************************************************************/ -Abc_Ntk_t * Abc_NtkNtkTest( Abc_Ntk_t * pNtk, If_Lib_t * pLutLib ) +Abc_Ntk_t * Abc_NtkNtkTest4( Abc_Ntk_t * pNtk, If_Lib_t * pLutLib ) { extern int Mfx_Perform( Nwk_Man_t * pNtk, Mfx_Par_t * pPars, If_Lib_t * pLutLib ); @@ -236,6 +236,37 @@ Abc_Ntk_t * Abc_NtkNtkTest( Abc_Ntk_t * pNtk, If_Lib_t * pLutLib ) return pNtkNew; } +/**Function************************************************************* + + Synopsis [] + + Description [] + + SideEffects [] + + SeeAlso [] + +***********************************************************************/ +Abc_Ntk_t * Abc_NtkNtkTest( Abc_Ntk_t * pNtk, If_Lib_t * pLutLib ) +{ + Vec_Ptr_t * vNodes; + extern Vec_Ptr_t * Nwk_ManRetimeCutForward( Nwk_Man_t * pMan, int nLatches, int fVerbose ); + extern Vec_Ptr_t * Nwk_ManRetimeCutBackward( Nwk_Man_t * pMan, int nLatches, int fVerbose ); + + Mfx_Par_t Pars, * pPars = &Pars; + Abc_Ntk_t * pNtkNew; + Nwk_Man_t * pMan; + pMan = Abc_NtkToNtkNew( pNtk ); + + vNodes = Nwk_ManRetimeCutBackward( pMan, Abc_NtkLatchNum(pNtk), 1 ); +// vNodes = Nwk_ManRetimeCutForward( pMan, Abc_NtkLatchNum(pNtk), 1 ); + Vec_PtrFree( vNodes ); + + pNtkNew = Abc_NtkFromNtkNew( pNtk, pMan ); + Nwk_ManFree( pMan ); + return pNtkNew; +} + //////////////////////////////////////////////////////////////////////// /// END OF FILE /// diff --git a/src/base/abci/abcDar.c b/src/base/abci/abcDar.c index d7263bbc..db3000cf 100644 --- a/src/base/abci/abcDar.c +++ b/src/base/abci/abcDar.c @@ -1429,6 +1429,40 @@ Abc_Ntk_t * Abc_NtkDarRetime( Abc_Ntk_t * pNtk, int nStepsMax, int fVerbose ) SeeAlso [] ***********************************************************************/ +Abc_Ntk_t * Abc_NtkDarRetimeMinArea( Abc_Ntk_t * pNtk, int fForwardOnly, int fBackwardOnly, int fVerbose ) +{ + extern Aig_Man_t * Saig_ManRetimeMinArea( Aig_Man_t * p, int fForwardOnly, int fBackwardOnly, int fVerbose ); + Abc_Ntk_t * pNtkAig; + Aig_Man_t * pMan, * pTemp; + pMan = Abc_NtkToDar( pNtk, 0, 1 ); + if ( pMan == NULL ) + return NULL; + if ( pMan->vFlopNums ) + Vec_IntFree( pMan->vFlopNums ); + pMan->vFlopNums = NULL; + + pMan->nTruePis = Aig_ManPiNum(pMan) - Aig_ManRegNum(pMan); + pMan->nTruePos = Aig_ManPoNum(pMan) - Aig_ManRegNum(pMan); + + pMan = Saig_ManRetimeMinArea( pTemp = pMan, fForwardOnly, fBackwardOnly, fVerbose ); + Aig_ManStop( pTemp ); + + pNtkAig = Abc_NtkFromDarSeqSweep( pNtk, pMan ); + Aig_ManStop( pMan ); + return pNtkAig; +} + +/**Function************************************************************* + + Synopsis [Gives the current ABC network to AIG manager for processing.] + + Description [] + + SideEffects [] + + SeeAlso [] + +***********************************************************************/ Abc_Ntk_t * Abc_NtkDarRetimeF( Abc_Ntk_t * pNtk, int nStepsMax, int fVerbose ) { Abc_Ntk_t * pNtkAig; |