diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2008-03-07 20:01:00 -0800 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2008-03-07 20:01:00 -0800 |
commit | d5495ad3266e5747d4de74b409367f7b501f87f6 (patch) | |
tree | 872d78dd4127d4d92ccc1e996ad969ca17be0bd6 /src/base/abci | |
parent | 8eeecc517568a1bd2a6f8379f81303a7c7c57d1b (diff) | |
download | abc-d5495ad3266e5747d4de74b409367f7b501f87f6.tar.gz abc-d5495ad3266e5747d4de74b409367f7b501f87f6.tar.bz2 abc-d5495ad3266e5747d4de74b409367f7b501f87f6.zip |
Version abc80307_2
Diffstat (limited to 'src/base/abci')
-rw-r--r-- | src/base/abci/abc.c | 12 | ||||
-rw-r--r-- | src/base/abci/abcDelay.c | 2 | ||||
-rw-r--r-- | src/base/abci/abcIf.c | 59 |
3 files changed, 65 insertions, 8 deletions
diff --git a/src/base/abci/abc.c b/src/base/abci/abc.c index aea02c0e..368ee2a8 100644 --- a/src/base/abci/abc.c +++ b/src/base/abci/abc.c @@ -10750,7 +10750,7 @@ int Abc_CommandIf( Abc_Frame_t * pAbc, int argc, char ** argv ) pPars->nAreaIters = 2; pPars->DelayTarget = -1; pPars->Epsilon = (float)0.001; - pPars->fPreprocess = 1; + pPars->fPreprocess = 1; pPars->fArea = 0; pPars->fFancy = 0; pPars->fExpRed = 1; @@ -10898,8 +10898,8 @@ int Abc_CommandIf( Abc_Frame_t * pAbc, int argc, char ** argv ) // get LUT size from the library pPars->nLutSize = pPars->pLutLib->LutMax; // if variable pin delay, force truth table computation - if ( pPars->pLutLib->fVarPinDelays ) - pPars->fTruth = 1; +// if ( pPars->pLutLib->fVarPinDelays ) +// pPars->fTruth = 1; } if ( pPars->nLutSize < 3 || pPars->nLutSize > IF_MAX_LUTSIZE ) @@ -10924,11 +10924,15 @@ int Abc_CommandIf( Abc_Frame_t * pAbc, int argc, char ** argv ) if ( (c = Abc_NtkGetChoiceNum( pNtk )) ) { printf( "Performing LUT mapping with %d choices.\n", c ); - pPars->fTruth = 1; +// pPars->fTruth = 1; + pPars->fExpRed = 0; } // enable truth table computation if cut minimization is selected if ( pPars->fCutMin ) + { pPars->fTruth = 1; + pPars->fExpRed = 0; + } // complain if truth tables are requested but the cut size is too large if ( pPars->fTruth && pPars->nLutSize > IF_MAX_FUNC_LUTSIZE ) diff --git a/src/base/abci/abcDelay.c b/src/base/abci/abcDelay.c index 67e051f3..553bb2fc 100644 --- a/src/base/abci/abcDelay.c +++ b/src/base/abci/abcDelay.c @@ -96,7 +96,7 @@ void Abc_NtkDelayTraceSortPins( Abc_Obj_t * pNode, int * pPinPerm, float * pPinD ***********************************************************************/ float Abc_NtkDelayTraceLut( Abc_Ntk_t * pNtk, int fUseLutLib ) { - int fUseSorting = 0; + int fUseSorting = 1; int pPinPerm[32]; float pPinDelays[32]; If_Lib_t * pLutLib; diff --git a/src/base/abci/abcIf.c b/src/base/abci/abcIf.c index 742a3a02..bf351a47 100644 --- a/src/base/abci/abcIf.c +++ b/src/base/abci/abcIf.c @@ -252,8 +252,8 @@ Abc_Obj_t * Abc_NodeFromIf_rec( Abc_Ntk_t * pNtkNew, If_Man_t * pIfMan, If_Obj_t // create a new node pNodeNew = Abc_NtkCreateNode( pNtkNew ); pCutBest = If_ObjCutBest( pIfObj ); - if ( pIfMan->pPars->pLutLib && pIfMan->pPars->pLutLib->fVarPinDelays ) - If_CutRotatePins( pIfMan, pCutBest ); +// if ( pIfMan->pPars->pLutLib && pIfMan->pPars->pLutLib->fVarPinDelays ) +// If_CutRotatePins( pIfMan, pCutBest ); if ( pIfMan->pPars->fUseCnfs || pIfMan->pPars->fUseMv ) { If_CutForEachLeafReverse( pIfMan, pCutBest, pIfLeaf, i ) @@ -346,6 +346,54 @@ Hop_Obj_t * Abc_NodeIfToHop_rec( Hop_Man_t * pHopMan, If_Man_t * pIfMan, If_Obj_ return gFunc; } + +/**Function************************************************************* + + Synopsis [Recursively derives the truth table for the cut.] + + Description [] + + SideEffects [] + + SeeAlso [] + +***********************************************************************/ +Hop_Obj_t * Abc_NodeIfToHop2_rec( Hop_Man_t * pHopMan, If_Man_t * pIfMan, If_Obj_t * pIfObj, Vec_Ptr_t * vVisited ) +{ + If_Cut_t * pCut; + If_Obj_t * pTemp; + Hop_Obj_t * gFunc, * gFunc0, * gFunc1; + // get the best cut + pCut = If_ObjCutBest(pIfObj); + // if the cut is visited, return the result + if ( If_CutData(pCut) ) + return If_CutData(pCut); + // mark the node as visited + Vec_PtrPush( vVisited, pCut ); + // insert the worst case + If_CutSetData( pCut, (void *)1 ); + // skip in case of primary input + if ( If_ObjIsCi(pIfObj) ) + return If_CutData(pCut); + // compute the functions of the children + for ( pTemp = pIfObj; pTemp; pTemp = pTemp->pEquiv ) + { + gFunc0 = Abc_NodeIfToHop2_rec( pHopMan, pIfMan, pTemp->pFanin0, vVisited ); + if ( gFunc0 == (void *)1 ) + continue; + gFunc1 = Abc_NodeIfToHop2_rec( pHopMan, pIfMan, pTemp->pFanin1, vVisited ); + if ( gFunc1 == (void *)1 ) + continue; + // both branches are solved + gFunc = Hop_And( pHopMan, Hop_NotCond(gFunc0, pTemp->fCompl0), Hop_NotCond(gFunc1, pTemp->fCompl1) ); + if ( pTemp->fPhase != pIfObj->fPhase ) + gFunc = Hop_Not(gFunc); + If_CutSetData( pCut, gFunc ); + break; + } + return If_CutData(pCut); +} + /**Function************************************************************* Synopsis [Derives the truth table for one cut.] @@ -371,7 +419,12 @@ Hop_Obj_t * Abc_NodeIfToHop( Hop_Man_t * pHopMan, If_Man_t * pIfMan, If_Obj_t * If_CutSetData( If_ObjCutBest(pLeaf), Hop_IthVar(pHopMan, i) ); // recursively compute the function while collecting visited cuts Vec_PtrClear( pIfMan->vTemp ); - gFunc = Abc_NodeIfToHop_rec( pHopMan, pIfMan, pIfObj, pIfMan->vTemp ); + gFunc = Abc_NodeIfToHop2_rec( pHopMan, pIfMan, pIfObj, pIfMan->vTemp ); + if ( gFunc == (void *)1 ) + { + printf( "Abc_NodeIfToHop(): Computing local AIG has failed.\n" ); + return NULL; + } // printf( "%d ", Vec_PtrSize(p->vTemp) ); // clean the cuts If_CutForEachLeaf( pIfMan, pCut, pLeaf, i ) |