From c696ae95d0130204bedfb9cb7209748fa6ab0f2e Mon Sep 17 00:00:00 2001 From: Alan Mishchenko Date: Sun, 24 Sep 2017 23:38:01 -0700 Subject: Maintenance and updates. --- src/map/if/ifCut.c | 2 +- src/map/if/ifMap.c | 4 ++-- src/map/mio/mio.h | 4 ++++ src/map/mio/mioInt.h | 6 ++++++ src/map/mio/mioUtils.c | 44 ++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 57 insertions(+), 3 deletions(-) (limited to 'src/map') diff --git a/src/map/if/ifCut.c b/src/map/if/ifCut.c index 667a21c5..47127fda 100644 --- a/src/map/if/ifCut.c +++ b/src/map/if/ifCut.c @@ -752,7 +752,7 @@ void If_CutSort( If_Man_t * p, If_Set_t * pCutSet, If_Cut_t * pCut ) } if ( !pCut->fUseless && - (p->pPars->fUseDsd || p->pPars->fUseBat || + (p->pPars->fUseDsd || p->pPars->pFuncCell2 || p->pPars->fUseBat || p->pPars->pLutStruct || p->pPars->fUserRecLib || p->pPars->fUserSesLib || p->pPars->fEnableCheck07 || p->pPars->fUseCofVars || p->pPars->fUseAndVars || p->pPars->fUse34Spec || p->pPars->fUseDsdTune || p->pPars->fEnableCheck75 || p->pPars->fEnableCheck75u) ) diff --git a/src/map/if/ifMap.c b/src/map/if/ifMap.c index 6c25921a..018c7817 100644 --- a/src/map/if/ifMap.c +++ b/src/map/if/ifMap.c @@ -167,7 +167,7 @@ void If_ObjPerformMappingAnd( If_Man_t * p, If_Obj_t * pObj, int Mode, int fPrep int fFunc0R, fFunc1R; int i, k, v, iCutDsd, fChange; int fSave0 = p->pPars->fDelayOpt || p->pPars->fDelayOptLut || p->pPars->fDsdBalance || p->pPars->fUserRecLib || p->pPars->fUserSesLib || - p->pPars->fUseDsdTune || p->pPars->fUseCofVars || p->pPars->fUseAndVars || p->pPars->fUse34Spec || p->pPars->pLutStruct != NULL; + p->pPars->fUseDsdTune || p->pPars->fUseCofVars || p->pPars->fUseAndVars || p->pPars->fUse34Spec || p->pPars->pLutStruct || p->pPars->pFuncCell2; int fUseAndCut = (p->pPars->nAndDelay > 0) || (p->pPars->nAndArea > 0); assert( !If_ObjIsAnd(pObj->pFanin0) || pObj->pFanin0->pCutSet->nCuts > 0 ); assert( !If_ObjIsAnd(pObj->pFanin1) || pObj->pFanin1->pCutSet->nCuts > 0 ); @@ -319,7 +319,7 @@ void If_ObjPerformMappingAnd( If_Man_t * p, If_Obj_t * pObj, int Mode, int fPrep if ( p->pPars->fUseDsd ) pCut->fUseless = If_DsdManCheckDec( p->pIfDsdMan, If_CutDsdLit(p, pCut) ); else if ( p->pPars->pFuncCell2 ) - pCut->fUseless = !p->pPars->pFuncCell2( p, (word *)If_CutTruth(p, pCut), pCut->nLeaves, NULL, NULL ); + pCut->fUseless = !p->pPars->pFuncCell2( p, (word *)If_CutTruthW(p, pCut), pCut->nLeaves, NULL, NULL ); else pCut->fUseless = !p->pPars->pFuncCell( p, If_CutTruth(p, pCut), Abc_MaxInt(6, pCut->nLeaves), pCut->nLeaves, p->pPars->pLutStruct ); p->nCutsUselessAll += pCut->fUseless; diff --git a/src/map/mio/mio.h b/src/map/mio/mio.h index 0704a8d5..5f04029a 100644 --- a/src/map/mio/mio.h +++ b/src/map/mio/mio.h @@ -222,6 +222,10 @@ extern void Mio_LibraryMatchesStop( Mio_Library_t * pLib ); extern void Mio_LibraryMatchesStart( Mio_Library_t * pLib, int fPinFilter, int fPinPerm, int fPinQuick ); extern void Mio_LibraryMatchesFetch( Mio_Library_t * pLib, Vec_Mem_t ** pvTtMem, Vec_Wec_t ** pvTt2Match, Mio_Cell2_t ** ppCells, int * pnCells, int fPinFilter, int fPinPerm, int fPinQuick ); +extern void Mio_LibraryMatches2Stop( Mio_Library_t * pLib ); +extern void Mio_LibraryMatches2Start( Mio_Library_t * pLib ); +extern void Mio_LibraryMatches2Fetch( Mio_Library_t * pLib, Vec_Ptr_t ** pvNames, Vec_Wrd_t ** pvTruths, Vec_Mem_t ** pvTtMem, Vec_Int_t ** pvTt2Match, Vec_Int_t ** pvTt2Match4, Vec_Int_t ** pvConfigs ); + /*=== sclUtil.c =========================================================*/ extern Mio_Library_t * Abc_SclDeriveGenlibSimple( void * pScl ); extern Mio_Library_t * Abc_SclDeriveGenlib( void * pScl, void * pMio, float Slew, float Gain, int nGatesMin, int fVerbose ); diff --git a/src/map/mio/mioInt.h b/src/map/mio/mioInt.h index 23f48b2f..6c754c18 100644 --- a/src/map/mio/mioInt.h +++ b/src/map/mio/mioInt.h @@ -84,6 +84,12 @@ struct Mio_LibraryStruct_t_ Vec_Wec_t * vTt2Match; // matches for truth tables Mio_Cell2_t * pCells; // library gates int nCells; // library gate count + Vec_Ptr_t * vNames; + Vec_Wrd_t * vTruths; + Vec_Mem_t * vTtMem_; + Vec_Int_t * vTt2Match_; + Vec_Int_t * vTt2Match4; + Vec_Int_t * vConfigs; }; struct Mio_GateStruct_t_ diff --git a/src/map/mio/mioUtils.c b/src/map/mio/mioUtils.c index 22ce244a..70306b5e 100644 --- a/src/map/mio/mioUtils.c +++ b/src/map/mio/mioUtils.c @@ -54,6 +54,7 @@ void Mio_LibraryDelete( Mio_Library_t * pLib ) if ( pLib == NULL ) return; Mio_LibraryMatchesStop( pLib ); + Mio_LibraryMatches2Stop( pLib ); // free the bindings of nodes to gates from this library for all networks Abc_FrameUnmapAllNetworks( Abc_FrameGetGlobalFrame() ); // free the library @@ -1691,6 +1692,49 @@ void Mio_LibraryMatchesFetch( Mio_Library_t * pLib, Vec_Mem_t ** pvTtMem, Vec_We *pnCells = pLib->nCells; // library gate count } +/**Function************************************************************* + + Synopsis [] + + Description [] + + SideEffects [] + + SeeAlso [] + +***********************************************************************/ +void Mio_LibraryMatches2Stop( Mio_Library_t * pLib ) +{ + if ( !pLib->vNames ) + return; + Vec_PtrFree( pLib->vNames ); + Vec_WrdFree( pLib->vTruths ); + Vec_MemHashFree( pLib->vTtMem_ ); + Vec_MemFree( pLib->vTtMem_ ); + Vec_IntFree( pLib->vTt2Match_ ); + Vec_IntFree( pLib->vTt2Match4 ); + Vec_IntFree( pLib->vConfigs ); +} +void Mio_LibraryMatches2Start( Mio_Library_t * pLib ) +{ + extern int Gia_ManDeriveMatches( Vec_Ptr_t ** pvNames, Vec_Wrd_t ** pvTruths, Vec_Mem_t ** pvTtMem, Vec_Int_t ** pvTt2Match, Vec_Int_t ** pvTt2Match4, Vec_Int_t ** pvConfigs ); + if ( pLib->vNames ) + return; + if ( pLib->vTtMem ) + Mio_LibraryMatches2Stop( pLib ); + Gia_ManDeriveMatches( &pLib->vNames, &pLib->vTruths, &pLib->vTtMem_, &pLib->vTt2Match_, &pLib->vTt2Match4, &pLib->vConfigs ); +} +void Mio_LibraryMatches2Fetch( Mio_Library_t * pLib, Vec_Ptr_t ** pvNames, Vec_Wrd_t ** pvTruths, Vec_Mem_t ** pvTtMem, Vec_Int_t ** pvTt2Match, Vec_Int_t ** pvTt2Match4, Vec_Int_t ** pvConfigs ) +{ + Mio_LibraryMatches2Start( pLib ); + *pvNames = pLib->vNames; + *pvTruths = pLib->vTruths; + *pvTtMem = pLib->vTtMem_; + *pvTt2Match = pLib->vTt2Match_; + *pvTt2Match4 = pLib->vTt2Match4; + *pvConfigs = pLib->vConfigs; +} + //////////////////////////////////////////////////////////////////////// /// END OF FILE /// //////////////////////////////////////////////////////////////////////// -- cgit v1.2.3