diff options
Diffstat (limited to 'src/opt/lpk')
-rw-r--r-- | src/opt/lpk/lpk.h | 4 | ||||
-rw-r--r-- | src/opt/lpk/lpkAbcDsd.c | 10 | ||||
-rw-r--r-- | src/opt/lpk/lpkAbcMux.c | 24 | ||||
-rw-r--r-- | src/opt/lpk/lpkAbcUtil.c | 2 | ||||
-rw-r--r-- | src/opt/lpk/lpkCore.c | 10 | ||||
-rw-r--r-- | src/opt/lpk/lpkCut.c | 2 | ||||
-rw-r--r-- | src/opt/lpk/lpkInt.h | 10 | ||||
-rw-r--r-- | src/opt/lpk/lpkMap.c | 24 | ||||
-rw-r--r-- | src/opt/lpk/lpkMulti.c | 10 | ||||
-rw-r--r-- | src/opt/lpk/lpkSets.c | 6 |
10 files changed, 51 insertions, 51 deletions
diff --git a/src/opt/lpk/lpk.h b/src/opt/lpk/lpk.h index 498da845..ebc18907 100644 --- a/src/opt/lpk/lpk.h +++ b/src/opt/lpk/lpk.h @@ -18,8 +18,8 @@ ***********************************************************************/ -#ifndef __LPK_H__ -#define __LPK_H__ +#ifndef ABC__opt__lpk__lpk_h +#define ABC__opt__lpk__lpk_h //////////////////////////////////////////////////////////////////////// diff --git a/src/opt/lpk/lpkAbcDsd.c b/src/opt/lpk/lpkAbcDsd.c index 34785941..2a6ba980 100644 --- a/src/opt/lpk/lpkAbcDsd.c +++ b/src/opt/lpk/lpkAbcDsd.c @@ -73,8 +73,8 @@ int Lpk_FunComputeMinSuppSizeVar( Lpk_Fun_t * p, unsigned ** ppTruths, int nTrut nSuppSize0 = Kit_TruthSupportSize( ppCofs[2*i+0], p->nVars ); nSuppSize1 = Kit_TruthSupportSize( ppCofs[2*i+1], p->nVars ); } - nSuppMaxCur = ABC_MAX( nSuppMaxCur, nSuppSize0 ); - nSuppMaxCur = ABC_MAX( nSuppMaxCur, nSuppSize1 ); + nSuppMaxCur = Abc_MaxInt( nSuppMaxCur, nSuppSize0 ); + nSuppMaxCur = Abc_MaxInt( nSuppMaxCur, nSuppSize1 ); nSuppTotalCur += nSuppSize0 + nSuppSize1; } if ( VarBest == -1 || nSuppMaxMin > nSuppMaxCur || @@ -110,9 +110,9 @@ unsigned Lpk_ComputeBoundSets_rec( Kit_DsdNtk_t * p, int iLit, Vec_Int_t * vSets unsigned i, iLitFanin, uSupport, uSuppCur; Kit_DsdObj_t * pObj; // consider the case of simple gate - pObj = Kit_DsdNtkObj( p, Kit_DsdLit2Var(iLit) ); + pObj = Kit_DsdNtkObj( p, Abc_Lit2Var(iLit) ); if ( pObj == NULL ) - return (1 << Kit_DsdLit2Var(iLit)); + return (1 << Abc_Lit2Var(iLit)); if ( pObj->Type == KIT_DSD_AND || pObj->Type == KIT_DSD_XOR ) { unsigned uSupps[16], Limit, s; @@ -171,7 +171,7 @@ Vec_Int_t * Lpk_ComputeBoundSets( Kit_DsdNtk_t * p, int nSizeMax ) return vSets; if ( Kit_DsdNtkRoot(p)->Type == KIT_DSD_VAR ) { - uSupport = ( 1 << Kit_DsdLit2Var(Kit_DsdNtkRoot(p)->pFans[0]) ); + uSupport = ( 1 << Abc_Lit2Var(Kit_DsdNtkRoot(p)->pFans[0]) ); if ( Kit_WordCountOnes(uSupport) <= nSizeMax ) Vec_IntPush( vSets, uSupport ); return vSets; diff --git a/src/opt/lpk/lpkAbcMux.c b/src/opt/lpk/lpkAbcMux.c index 4e9cc654..1e4b6e22 100644 --- a/src/opt/lpk/lpkAbcMux.c +++ b/src/opt/lpk/lpkAbcMux.c @@ -66,13 +66,13 @@ Lpk_Res_t * Lpk_MuxAnalize( Lpk_Man_t * pMan, Lpk_Fun_t * p ) // include cof var into 0-block DelayA = Lpk_SuppDelay( p->puSupps[2*Var+0] | (1<<Var), p->pDelays ); DelayB = Lpk_SuppDelay( p->puSupps[2*Var+1] , p->pDelays ); - Delay0 = ABC_MAX( DelayA, DelayB + 1 ); + Delay0 = Abc_MaxInt( DelayA, DelayB + 1 ); // include cof var into 1-block DelayA = Lpk_SuppDelay( p->puSupps[2*Var+1] | (1<<Var), p->pDelays ); DelayB = Lpk_SuppDelay( p->puSupps[2*Var+0] , p->pDelays ); - Delay1 = ABC_MAX( DelayA, DelayB + 1 ); + Delay1 = Abc_MaxInt( DelayA, DelayB + 1 ); // get the best delay - Delay = ABC_MIN( Delay0, Delay1 ); + Delay = Abc_MinInt( Delay0, Delay1 ); Area = 2; Polarity = (int)(Delay == Delay1); } @@ -80,7 +80,7 @@ Lpk_Res_t * Lpk_MuxAnalize( Lpk_Man_t * pMan, Lpk_Fun_t * p ) { DelayA = Lpk_SuppDelay( p->puSupps[2*Var+0] | (1<<Var), p->pDelays ); DelayB = Lpk_SuppDelay( p->puSupps[2*Var+1] , p->pDelays ); - Delay = ABC_MAX( DelayA, DelayB + 1 ); + Delay = Abc_MaxInt( DelayA, DelayB + 1 ); Area = 1 + Lpk_LutNumLuts( nSuppSize1, p->nLutK ); Polarity = 0; } @@ -88,7 +88,7 @@ Lpk_Res_t * Lpk_MuxAnalize( Lpk_Man_t * pMan, Lpk_Fun_t * p ) { DelayA = Lpk_SuppDelay( p->puSupps[2*Var+1] | (1<<Var), p->pDelays ); DelayB = Lpk_SuppDelay( p->puSupps[2*Var+0] , p->pDelays ); - Delay = ABC_MAX( DelayA, DelayB + 1 ); + Delay = Abc_MaxInt( DelayA, DelayB + 1 ); Area = 1 + Lpk_LutNumLuts( nSuppSize0, p->nLutK ); Polarity = 1; } @@ -96,7 +96,7 @@ Lpk_Res_t * Lpk_MuxAnalize( Lpk_Man_t * pMan, Lpk_Fun_t * p ) { DelayA = Lpk_SuppDelay( p->puSupps[2*Var+1] | (1<<Var), p->pDelays ); DelayB = Lpk_SuppDelay( p->puSupps[2*Var+0] , p->pDelays ); - Delay = ABC_MAX( DelayA, DelayB + 1 ); + Delay = Abc_MaxInt( DelayA, DelayB + 1 ); Area = 1 + Lpk_LutNumLuts( nSuppSize1+2, p->nLutK ); Polarity = 1; } @@ -104,7 +104,7 @@ Lpk_Res_t * Lpk_MuxAnalize( Lpk_Man_t * pMan, Lpk_Fun_t * p ) { DelayA = Lpk_SuppDelay( p->puSupps[2*Var+0] | (1<<Var), p->pDelays ); DelayB = Lpk_SuppDelay( p->puSupps[2*Var+1] , p->pDelays ); - Delay = ABC_MAX( DelayA, DelayB + 1 ); + Delay = Abc_MaxInt( DelayA, DelayB + 1 ); Area = 1 + Lpk_LutNumLuts( nSuppSize0+2, p->nLutK ); Polarity = 0; } @@ -113,13 +113,13 @@ Lpk_Res_t * Lpk_MuxAnalize( Lpk_Man_t * pMan, Lpk_Fun_t * p ) // include cof var into 0-block DelayA = Lpk_SuppDelay( p->puSupps[2*Var+0] | (1<<Var), p->pDelays ); DelayB = Lpk_SuppDelay( p->puSupps[2*Var+1] , p->pDelays ); - Delay0 = ABC_MAX( DelayA, DelayB + 1 ); + Delay0 = Abc_MaxInt( DelayA, DelayB + 1 ); // include cof var into 1-block DelayA = Lpk_SuppDelay( p->puSupps[2*Var+1] | (1<<Var), p->pDelays ); DelayB = Lpk_SuppDelay( p->puSupps[2*Var+0] , p->pDelays ); - Delay1 = ABC_MAX( DelayA, DelayB + 1 ); + Delay1 = Abc_MaxInt( DelayA, DelayB + 1 ); // get the best delay - Delay = ABC_MIN( Delay0, Delay1 ); + Delay = Abc_MinInt( Delay0, Delay1 ); if ( Delay == Delay0 ) Area = Lpk_LutNumLuts( nSuppSize0+2, p->nLutK ) + Lpk_LutNumLuts( nSuppSize1, p->nLutK ); else @@ -131,8 +131,8 @@ Lpk_Res_t * Lpk_MuxAnalize( Lpk_Man_t * pMan, Lpk_Fun_t * p ) continue; if ( Area > (int)p->nAreaLim ) continue; - nSuppSizeS = ABC_MIN( nSuppSize0 + 2 *!Polarity, nSuppSize1 + 2 * Polarity ); - nSuppSizeL = ABC_MAX( nSuppSize0 + 2 *!Polarity, nSuppSize1 + 2 * Polarity ); + nSuppSizeS = Abc_MinInt( nSuppSize0 + 2 *!Polarity, nSuppSize1 + 2 * Polarity ); + nSuppSizeL = Abc_MaxInt( nSuppSize0 + 2 *!Polarity, nSuppSize1 + 2 * Polarity ); if ( nSuppSizeL > (int)p->nVars ) continue; if ( pRes->Variable == -1 || pRes->AreaEst > Area || diff --git a/src/opt/lpk/lpkAbcUtil.c b/src/opt/lpk/lpkAbcUtil.c index b086d35f..b96614d2 100644 --- a/src/opt/lpk/lpkAbcUtil.c +++ b/src/opt/lpk/lpkAbcUtil.c @@ -217,7 +217,7 @@ int Lpk_SuppDelay( unsigned uSupp, char * pDelays ) int Delay, Var; Delay = 0; Lpk_SuppForEachVar( uSupp, Var ) - Delay = ABC_MAX( Delay, pDelays[Var] ); + Delay = Abc_MaxInt( Delay, pDelays[Var] ); return Delay + 1; } diff --git a/src/opt/lpk/lpkCore.c b/src/opt/lpk/lpkCore.c index a4c9471d..51f05b21 100644 --- a/src/opt/lpk/lpkCore.c +++ b/src/opt/lpk/lpkCore.c @@ -19,8 +19,8 @@ ***********************************************************************/ #include "lpkInt.h" -#include "cloud.h" -#include "main.h" +#include "src/bool/kit/cloud.h" +#include "src/base/main/main.h" ABC_NAMESPACE_IMPL_START @@ -140,7 +140,7 @@ int Lpk_ExploreCut( Lpk_Man_t * p, Lpk_Cut_t * pCut, Kit_DsdNtk_t * pNtk ) pRoot = Kit_DsdNtkRoot( pNtk ); if ( pRoot->Type == KIT_DSD_CONST1 ) { - if ( Kit_DsdLitIsCompl(pNtk->Root) ) + if ( Abc_LitIsCompl(pNtk->Root) ) pObjNew = Abc_NtkCreateNodeConst0( p->pNtk ); else pObjNew = Abc_NtkCreateNodeConst1( p->pNtk ); @@ -150,8 +150,8 @@ int Lpk_ExploreCut( Lpk_Man_t * p, Lpk_Cut_t * pCut, Kit_DsdNtk_t * pNtk ) } if ( pRoot->Type == KIT_DSD_VAR ) { - pObjNew = Abc_NtkObj( p->pNtk, pCut->pLeaves[ Kit_DsdLit2Var(pRoot->pFans[0]) ] ); - if ( Kit_DsdLitIsCompl(pNtk->Root) ^ Kit_DsdLitIsCompl(pRoot->pFans[0]) ) + pObjNew = Abc_NtkObj( p->pNtk, pCut->pLeaves[ Abc_Lit2Var(pRoot->pFans[0]) ] ); + if ( Abc_LitIsCompl(pNtk->Root) ^ Abc_LitIsCompl(pRoot->pFans[0]) ) pObjNew = Abc_NtkCreateNodeInv( p->pNtk, pObjNew ); Abc_NtkUpdate( p->pObj, pObjNew, p->vLevels ); p->nGainTotal += pCut->nNodes - pCut->nNodesDup; diff --git a/src/opt/lpk/lpkCut.c b/src/opt/lpk/lpkCut.c index a07372e6..c4be0c35 100644 --- a/src/opt/lpk/lpkCut.c +++ b/src/opt/lpk/lpkCut.c @@ -19,7 +19,7 @@ ***********************************************************************/ #include "lpkInt.h" -#include "cloud.h" +#include "src/bool/kit/cloud.h" ABC_NAMESPACE_IMPL_START diff --git a/src/opt/lpk/lpkInt.h b/src/opt/lpk/lpkInt.h index 5cb8c1a2..61fa1624 100644 --- a/src/opt/lpk/lpkInt.h +++ b/src/opt/lpk/lpkInt.h @@ -18,17 +18,17 @@ ***********************************************************************/ -#ifndef __LPK_INT_H__ -#define __LPK_INT_H__ +#ifndef ABC__opt__lpk__lpkInt_h +#define ABC__opt__lpk__lpkInt_h //////////////////////////////////////////////////////////////////////// /// INCLUDES /// //////////////////////////////////////////////////////////////////////// -#include "abc.h" -#include "kit.h" -#include "if.h" +#include "src/base/abc/abc.h" +#include "src/bool/kit/kit.h" +#include "src/map/if/if.h" #include "lpk.h" //////////////////////////////////////////////////////////////////////// diff --git a/src/opt/lpk/lpkMap.c b/src/opt/lpk/lpkMap.c index c6c6b233..28780bc1 100644 --- a/src/opt/lpk/lpkMap.c +++ b/src/opt/lpk/lpkMap.c @@ -116,20 +116,20 @@ If_Obj_t * Lpk_MapTree_rec( Lpk_Man_t * p, Kit_DsdNtk_t * pNtk, If_Obj_t ** ppLe assert( iLit >= 0 ); // consider the case of a gate - pObj = Kit_DsdNtkObj( pNtk, Kit_DsdLit2Var(iLit) ); + pObj = Kit_DsdNtkObj( pNtk, Abc_Lit2Var(iLit) ); if ( pObj == NULL ) { - pObjNew = ppLeaves[Kit_DsdLit2Var(iLit)]; - return If_NotCond( pObjNew, Kit_DsdLitIsCompl(iLit) ); + pObjNew = ppLeaves[Abc_Lit2Var(iLit)]; + return If_NotCond( pObjNew, Abc_LitIsCompl(iLit) ); } if ( pObj->Type == KIT_DSD_CONST1 ) { - return If_NotCond( If_ManConst1(p->pIfMan), Kit_DsdLitIsCompl(iLit) ); + return If_NotCond( If_ManConst1(p->pIfMan), Abc_LitIsCompl(iLit) ); } if ( pObj->Type == KIT_DSD_VAR ) { - pObjNew = ppLeaves[Kit_DsdLit2Var(pObj->pFans[0])]; - return If_NotCond( pObjNew, Kit_DsdLitIsCompl(iLit) ^ Kit_DsdLitIsCompl(pObj->pFans[0]) ); + pObjNew = ppLeaves[Abc_Lit2Var(pObj->pFans[0])]; + return If_NotCond( pObjNew, Abc_LitIsCompl(iLit) ^ Abc_LitIsCompl(pObj->pFans[0]) ); } if ( pObj->Type == KIT_DSD_AND ) { @@ -139,11 +139,11 @@ If_Obj_t * Lpk_MapTree_rec( Lpk_Man_t * p, Kit_DsdNtk_t * pNtk, If_Obj_t ** ppLe if ( pFansNew[0] == NULL || pFansNew[1] == NULL ) return NULL; pObjNew = If_ManCreateAnd( p->pIfMan, pFansNew[0], pFansNew[1] ); - return If_NotCond( pObjNew, Kit_DsdLitIsCompl(iLit) ); + return If_NotCond( pObjNew, Abc_LitIsCompl(iLit) ); } if ( pObj->Type == KIT_DSD_XOR ) { - int fCompl = Kit_DsdLitIsCompl(iLit); + int fCompl = Abc_LitIsCompl(iLit); assert( pObj->nFans == 2 ); pFansNew[0] = Lpk_MapTree_rec( p, pNtk, ppLeaves, pObj->pFans[0], NULL ); pFansNew[1] = pResult? pResult : Lpk_MapTree_rec( p, pNtk, ppLeaves, pObj->pFans[1], NULL ); @@ -170,7 +170,7 @@ If_Obj_t * Lpk_MapTree_rec( Lpk_Man_t * p, Kit_DsdNtk_t * pNtk, If_Obj_t ** ppLe if ( !p->fCofactoring && p->pPars->nVarsShared > 0 && (int)pObj->nFans > p->pPars->nLutSize ) { pObjNew = Lpk_MapTreeMulti( p, Kit_DsdObjTruth(pObj), pObj->nFans, pFansNew ); - return If_NotCond( pObjNew, Kit_DsdLitIsCompl(iLit) ); + return If_NotCond( pObjNew, Abc_LitIsCompl(iLit) ); } */ /* @@ -178,7 +178,7 @@ If_Obj_t * Lpk_MapTree_rec( Lpk_Man_t * p, Kit_DsdNtk_t * pNtk, If_Obj_t ** ppLe { pObjNew2 = Lpk_MapTreeMux_rec( p, Kit_DsdObjTruth(pObj), pObj->nFans, pFansNew ); // if ( pObjNew2 ) -// return If_NotCond( pObjNew2, Kit_DsdLitIsCompl(iLit) ); +// return If_NotCond( pObjNew2, Abc_LitIsCompl(iLit) ); } */ @@ -187,7 +187,7 @@ If_Obj_t * Lpk_MapTree_rec( Lpk_Man_t * p, Kit_DsdNtk_t * pNtk, If_Obj_t ** ppLe { pObjNew2 = Lpk_MapSuppRedDec_rec( p, Kit_DsdObjTruth(pObj), pObj->nFans, pFansNew ); if ( pObjNew2 ) - return If_NotCond( pObjNew2, Kit_DsdLitIsCompl(iLit) ); + return If_NotCond( pObjNew2, Abc_LitIsCompl(iLit) ); } pObjNew = Lpk_MapPrime( p, Kit_DsdObjTruth(pObj), pObj->nFans, pFansNew ); @@ -198,7 +198,7 @@ If_Obj_t * Lpk_MapTree_rec( Lpk_Man_t * p, Kit_DsdNtk_t * pNtk, If_Obj_t ** ppLe If_ObjSetChoice( If_Regular(pObjNew), If_Regular(pObjNew2) ); If_ManCreateChoice( p->pIfMan, If_Regular(pObjNew) ); } - return If_NotCond( pObjNew, Kit_DsdLitIsCompl(iLit) ); + return If_NotCond( pObjNew, Abc_LitIsCompl(iLit) ); } //////////////////////////////////////////////////////////////////////// diff --git a/src/opt/lpk/lpkMulti.c b/src/opt/lpk/lpkMulti.c index cce154ee..d2bdcf45 100644 --- a/src/opt/lpk/lpkMulti.c +++ b/src/opt/lpk/lpkMulti.c @@ -57,7 +57,7 @@ void Lpk_CreateVarOrder( Kit_DsdNtk_t * pNtk, char pTable[][16] ) Kit_DsdObjForEachFanin( pNtk, pObj, iFaninLit, k ) { if ( Kit_DsdLitIsLeaf( pNtk, iFaninLit ) ) - Above[nAbove++] = Kit_DsdLit2Var(iFaninLit); + Above[nAbove++] = Abc_Lit2Var(iFaninLit); else uSuppFanins |= Kit_DsdLitSupport( pNtk, iFaninLit ); } @@ -190,7 +190,7 @@ int Lpk_FindHighest( Kit_DsdNtk_t ** ppNtks, int * piLits, int nSize, int * pPri uSupps[i] = Kit_DsdLitSupport( ppNtks[i], piLits[i] ); else { - pObj = Kit_DsdNtkObj( ppNtks[i], Kit_DsdLit2Var(piLits[i]) ); + pObj = Kit_DsdNtkObj( ppNtks[i], Abc_Lit2Var(piLits[i]) ); if ( pObj->Type == KIT_DSD_PRIME ) { pTriv[i] = 0; @@ -292,7 +292,7 @@ If_Obj_t * Lpk_MapTreeMulti_rec( Lpk_Man_t * p, Kit_DsdNtk_t ** ppNtks, int * pi if ( p->pPars->fVeryVerbose ) printf( "%d ", i ); assert( piLits[i] >= 0 ); - pObj = Kit_DsdNtkObj( ppNtks[i], Kit_DsdLit2Var(piLits[i]) ); + pObj = Kit_DsdNtkObj( ppNtks[i], Abc_Lit2Var(piLits[i]) ); if ( pObj == NULL ) piLitsNew[i] = -2; else if ( pObj->Type == KIT_DSD_PRIME ) @@ -464,9 +464,9 @@ If_Obj_t * Lpk_MapTreeMulti( Lpk_Man_t * p, unsigned * pTruth, int nVars, If_Obj // collect the roots pRoot = Kit_DsdNtkRoot(ppNtks[i]); if ( pRoot->Type == KIT_DSD_CONST1 ) - piLits[i] = Kit_DsdLitIsCompl(ppNtks[i]->Root)? -2: -1; + piLits[i] = Abc_LitIsCompl(ppNtks[i]->Root)? -2: -1; else if ( pRoot->Type == KIT_DSD_VAR ) - piLits[i] = Kit_DsdLitNotCond( pRoot->pFans[0], Kit_DsdLitIsCompl(ppNtks[i]->Root) ); + piLits[i] = Abc_LitNotCond( pRoot->pFans[0], Abc_LitIsCompl(ppNtks[i]->Root) ); else piLits[i] = ppNtks[i]->Root; } diff --git a/src/opt/lpk/lpkSets.c b/src/opt/lpk/lpkSets.c index 65b23ea9..980a49e3 100644 --- a/src/opt/lpk/lpkSets.c +++ b/src/opt/lpk/lpkSets.c @@ -58,9 +58,9 @@ unsigned Lpk_ComputeSets_rec( Kit_DsdNtk_t * p, int iLit, Vec_Int_t * vSets ) unsigned i, iLitFanin, uSupport, uSuppCur; Kit_DsdObj_t * pObj; // consider the case of simple gate - pObj = Kit_DsdNtkObj( p, Kit_DsdLit2Var(iLit) ); + pObj = Kit_DsdNtkObj( p, Abc_Lit2Var(iLit) ); if ( pObj == NULL ) - return (1 << Kit_DsdLit2Var(iLit)); + return (1 << Abc_Lit2Var(iLit)); if ( pObj->Type == KIT_DSD_AND || pObj->Type == KIT_DSD_XOR ) { unsigned uSupps[16], Limit, s; @@ -116,7 +116,7 @@ unsigned Lpk_ComputeSets( Kit_DsdNtk_t * p, Vec_Int_t * vSets ) return 0; if ( Kit_DsdNtkRoot(p)->Type == KIT_DSD_VAR ) { - uSupport = ( 1 << Kit_DsdLit2Var(Kit_DsdNtkRoot(p)->pFans[0]) ); + uSupport = ( 1 << Abc_Lit2Var(Kit_DsdNtkRoot(p)->pFans[0]) ); Vec_IntPush( vSets, uSupport ); return uSupport; } |