diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2014-04-04 16:38:46 -0700 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2014-04-04 16:38:46 -0700 |
commit | 6ab0d68d5653b5411c298116c9502a23a50cdbf0 (patch) | |
tree | 3f3f84327a1e81688bc06300315d128b54976949 | |
parent | f6ae0e41f338a109ad2c973ace13b728f4947e14 (diff) | |
download | abc-6ab0d68d5653b5411c298116c9502a23a50cdbf0.tar.gz abc-6ab0d68d5653b5411c298116c9502a23a50cdbf0.tar.bz2 abc-6ab0d68d5653b5411c298116c9502a23a50cdbf0.zip |
Tuning LUT mapping to work while saving the best network.
-rw-r--r-- | src/base/abci/abc.c | 8 | ||||
-rw-r--r-- | src/base/abci/abcPrint.c | 5 | ||||
-rw-r--r-- | src/map/if/if.h | 2 | ||||
-rw-r--r-- | src/map/if/ifCut.c | 4 | ||||
-rw-r--r-- | src/map/if/ifMap.c | 6 | ||||
-rw-r--r-- | src/map/if/ifTime.c | 11 |
6 files changed, 22 insertions, 14 deletions
diff --git a/src/base/abci/abc.c b/src/base/abci/abc.c index acdfb9f8..1620dcf9 100644 --- a/src/base/abci/abc.c +++ b/src/base/abci/abc.c @@ -15017,8 +15017,8 @@ int Abc_CommandIf( Abc_Frame_t * pAbc, int argc, char ** argv ) // enable truth table computation if choices are selected if ( (c = Abc_NtkGetChoiceNum( pNtk )) ) { - if ( !Abc_FrameReadFlag("silentmode") ) - Abc_Print( 0, "Performing LUT mapping with %d choices.\n", c ); +// if ( !Abc_FrameReadFlag("silentmode") ) +// Abc_Print( 0, "Performing LUT mapping with %d choices.\n", c ); pPars->fExpRed = 0; } @@ -29749,8 +29749,8 @@ int Abc_CommandAbc9If( Abc_Frame_t * pAbc, int argc, char ** argv ) // enable truth table computation if choices are selected if ( Gia_ManHasChoices(pAbc->pGia) ) { - if ( !Abc_FrameReadFlag("silentmode") ) - Abc_Print( 0, "Performing LUT mapping with choices.\n" ); +// if ( !Abc_FrameReadFlag("silentmode") ) +// Abc_Print( 0, "Performing LUT mapping with choices.\n" ); pPars->fExpRed = 0; } diff --git a/src/base/abci/abcPrint.c b/src/base/abci/abcPrint.c index 4493a5a2..b13018fc 100644 --- a/src/base/abci/abcPrint.c +++ b/src/base/abci/abcPrint.c @@ -101,7 +101,10 @@ int Abc_NtkCompareAndSaveBest( Abc_Ntk_t * pNtk ) ParsBest.nPis = ParsNew.nPis; ParsBest.nPos = ParsNew.nPos; // writ the network - pFileNameOut = Extra_FileNameGenericAppend( pNtk->pSpec, "_best.blif" ); + if ( strcmp(pNtk->pSpec + strlen(pNtk->pSpec) - strlen("_best.blif"), "_best.blif") ) + pFileNameOut = Extra_FileNameGenericAppend( pNtk->pSpec, "_best.blif" ); + else + pFileNameOut = pNtk->pSpec; Io_Write( pNtk, pFileNameOut, IO_FILE_BLIF ); return 1; } diff --git a/src/map/if/if.h b/src/map/if/if.h index 273119c0..7437c472 100644 --- a/src/map/if/if.h +++ b/src/map/if/if.h @@ -490,7 +490,7 @@ extern int If_ManPerformMapping( If_Man_t * p ); extern int If_ManPerformMappingComb( If_Man_t * p ); /*=== ifCut.c ============================================================*/ extern int If_CutVerifyCuts( If_Set_t * pCutSet, int fOrdered ); -extern int If_CutFilter( If_Set_t * pCutSet, If_Cut_t * pCut ); +extern int If_CutFilter( If_Set_t * pCutSet, If_Cut_t * pCut, int fSaveCut0 ); extern void If_CutSort( If_Man_t * p, If_Set_t * pCutSet, If_Cut_t * pCut ); extern void If_CutOrder( If_Cut_t * pCut ); extern int If_CutMergeOrdered( If_Man_t * p, If_Cut_t * pCut0, If_Cut_t * pCut1, If_Cut_t * pCut ); diff --git a/src/map/if/ifCut.c b/src/map/if/ifCut.c index 6715f706..7fb4d028 100644 --- a/src/map/if/ifCut.c +++ b/src/map/if/ifCut.c @@ -143,7 +143,7 @@ static inline int If_CutCheckDominance( If_Cut_t * pDom, If_Cut_t * pCut ) SeeAlso [] ***********************************************************************/ -int If_CutFilter( If_Set_t * pCutSet, If_Cut_t * pCut ) +int If_CutFilter( If_Set_t * pCutSet, If_Cut_t * pCut, int fSaveCut0 ) { If_Cut_t * pTemp; int i, k; @@ -154,7 +154,7 @@ int If_CutFilter( If_Set_t * pCutSet, If_Cut_t * pCut ) if ( pTemp->nLeaves > pCut->nLeaves ) { // do not fiter the first cut - if ( i == 0 && pCutSet->nCuts > 1 && pCutSet->ppCuts[1]->fUseless ) + if ( i == 0 && ((pCutSet->nCuts > 1 && pCutSet->ppCuts[1]->fUseless) || (fSaveCut0 && pCutSet->nCuts == 1)) ) continue; // skip the non-contained cuts if ( (pTemp->uSign & pCut->uSign) != pCut->uSign ) diff --git a/src/map/if/ifMap.c b/src/map/if/ifMap.c index e85e8d5f..cd13ed34 100644 --- a/src/map/if/ifMap.c +++ b/src/map/if/ifMap.c @@ -184,7 +184,7 @@ void If_ObjPerformMappingAnd( If_Man_t * p, If_Obj_t * pObj, int Mode, int fPrep p->nCutsMerged++; p->nCutsTotal++; // check if this cut is contained in any of the available cuts - if ( !p->pPars->fSkipCutFilter && If_CutFilter( pCutSet, pCut ) ) + if ( !p->pPars->fSkipCutFilter && If_CutFilter( pCutSet, pCut, p->pPars->fUserRecLib || p->pPars->fDelayOpt ) ) continue; // compute the truth table pCut->iCutFunc = -1; @@ -202,7 +202,7 @@ void If_ObjPerformMappingAnd( If_Man_t * p, If_Obj_t * pObj, int Mode, int fPrep fChange = If_CutComputeTruth( p, pCut, pCut0, pCut1, pObj->fCompl0, pObj->fCompl1 ); if ( p->pPars->fVerbose ) p->timeCache[4] += Abc_Clock() - clk; - if ( !p->pPars->fSkipCutFilter && fChange && If_CutFilter( pCutSet, pCut ) ) + if ( !p->pPars->fSkipCutFilter && fChange && If_CutFilter( pCutSet, pCut, p->pPars->fUserRecLib || p->pPars->fDelayOpt ) ) continue; if ( p->pPars->fUseDsd ) { @@ -385,7 +385,7 @@ void If_ObjPerformMappingChoice( If_Man_t * p, If_Obj_t * pObj, int Mode, int fP // copy the cut into storage If_CutCopy( p, pCut, pCutTemp ); // check if this cut is contained in any of the available cuts - if ( If_CutFilter( pCutSet, pCut ) ) + if ( If_CutFilter( pCutSet, pCut, p->pPars->fUserRecLib || p->pPars->fDelayOpt ) ) continue; // check if the cut satisfies the required times assert( pCut->Delay == If_CutDelay( p, pTemp, pCut ) ); diff --git a/src/map/if/ifTime.c b/src/map/if/ifTime.c index f07b502e..7ad685b3 100644 --- a/src/map/if/ifTime.c +++ b/src/map/if/ifTime.c @@ -378,12 +378,17 @@ int If_CutDelaySopCost( If_Man_t * p, If_Cut_t * pCut ) } // get the cost If_AndClear( &Leaf ); - if ( Vec_WrdSize(vAnds) ) + if ( Vec_WrdSize(vAnds) > 0 ) Leaf = If_WrdToAnd( Vec_WrdEntryLast(vAnds) ); - if ( pCut->nLeaves > 2 && Vec_WrdSize(vAnds) > (int)pCut->nLeaves ) - pCut->Cost = Vec_WrdSize(vAnds) - pCut->nLeaves; else + Leaf.Delay = 0; + if ( Vec_WrdSize(vAnds) > (int)pCut->nLeaves ) + pCut->Cost = Vec_WrdSize(vAnds) - pCut->nLeaves; + else if ( pCut->nLeaves == 1 ) pCut->Cost = 1; + else if ( pCut->nLeaves == 0 ) + pCut->Cost = 0; + else assert( 0 ); // get the permutation for ( i = 0; i < (int)pCut->nLeaves; i++ ) { |