diff options
Diffstat (limited to 'src/map')
44 files changed, 182 insertions, 194 deletions
diff --git a/src/map/amap/amap.h b/src/map/amap/amap.h index de7fcc18..0a0c7cc0 100644 --- a/src/map/amap/amap.h +++ b/src/map/amap/amap.h @@ -18,8 +18,8 @@ ***********************************************************************/ -#ifndef __AMAP_H__ -#define __AMAP_H__ +#ifndef ABC__map__amap__amap_h +#define ABC__map__amap__amap_h //////////////////////////////////////////////////////////////////////// diff --git a/src/map/amap/amapCore.c b/src/map/amap/amapCore.c index 4f2d2310..ce1f61bd 100644 --- a/src/map/amap/amapCore.c +++ b/src/map/amap/amapCore.c @@ -19,7 +19,7 @@ ***********************************************************************/ #include "amapInt.h" -#include "main.h" +#include "src/base/main/main.h" ABC_NAMESPACE_IMPL_START diff --git a/src/map/amap/amapGraph.c b/src/map/amap/amapGraph.c index bc0878d1..c346ca98 100644 --- a/src/map/amap/amapGraph.c +++ b/src/map/amap/amapGraph.c @@ -141,9 +141,9 @@ Amap_Obj_t * Amap_ManCreateAnd( Amap_Man_t * p, Amap_Obj_t * pFan0, Amap_Obj_t * pObj->Type = AMAP_OBJ_AND; pObj->Fan[0] = Amap_ObjToLit(pFan0); Amap_Regular(pFan0)->nRefs++; pObj->Fan[1] = Amap_ObjToLit(pFan1); Amap_Regular(pFan1)->nRefs++; - assert( Amap_Lit2Var(pObj->Fan[0]) != Amap_Lit2Var(pObj->Fan[1]) ); + assert( Abc_Lit2Var(pObj->Fan[0]) != Abc_Lit2Var(pObj->Fan[1]) ); pObj->fPhase = Amap_ObjPhaseReal(pFan0) & Amap_ObjPhaseReal(pFan1); - pObj->Level = 1 + ABC_MAX( Amap_Regular(pFan0)->Level, Amap_Regular(pFan1)->Level ); + pObj->Level = 1 + Abc_MaxInt( Amap_Regular(pFan0)->Level, Amap_Regular(pFan1)->Level ); if ( p->nLevelMax < (int)pObj->Level ) p->nLevelMax = (int)pObj->Level; assert( p->nLevelMax < 4094 ); // 2^12-2 @@ -170,7 +170,7 @@ Amap_Obj_t * Amap_ManCreateXor( Amap_Man_t * p, Amap_Obj_t * pFan0, Amap_Obj_t * pObj->Fan[0] = Amap_ObjToLit(pFan0); Amap_Regular(pFan0)->nRefs++; pObj->Fan[1] = Amap_ObjToLit(pFan1); Amap_Regular(pFan1)->nRefs++; pObj->fPhase = Amap_ObjPhaseReal(pFan0) ^ Amap_ObjPhaseReal(pFan1); - pObj->Level = 2 + ABC_MAX( Amap_Regular(pFan0)->Level, Amap_Regular(pFan1)->Level ); + pObj->Level = 2 + Abc_MaxInt( Amap_Regular(pFan0)->Level, Amap_Regular(pFan1)->Level ); if ( p->nLevelMax < (int)pObj->Level ) p->nLevelMax = (int)pObj->Level; assert( p->nLevelMax < 4094 ); // 2^12-2 @@ -199,8 +199,8 @@ Amap_Obj_t * Amap_ManCreateMux( Amap_Man_t * p, Amap_Obj_t * pFan0, Amap_Obj_t * pObj->Fan[2] = Amap_ObjToLit(pFanC); Amap_Regular(pFanC)->nRefs++; pObj->fPhase = (Amap_ObjPhaseReal(pFan1) & Amap_ObjPhaseReal(pFanC)) | (Amap_ObjPhaseReal(pFan0) & ~Amap_ObjPhaseReal(pFanC)); - pObj->Level = ABC_MAX( Amap_Regular(pFan0)->Level, Amap_Regular(pFan1)->Level ); - pObj->Level = 2 + ABC_MAX( pObj->Level, Amap_Regular(pFanC)->Level ); + pObj->Level = Abc_MaxInt( Amap_Regular(pFan0)->Level, Amap_Regular(pFan1)->Level ); + pObj->Level = 2 + Abc_MaxInt( pObj->Level, Amap_Regular(pFanC)->Level ); if ( p->nLevelMax < (int)pObj->Level ) p->nLevelMax = (int)pObj->Level; assert( p->nLevelMax < 4094 ); // 2^12-2 @@ -228,7 +228,7 @@ void Amap_ManCreateChoice( Amap_Man_t * p, Amap_Obj_t * pObj ) // update the level of this node (needed for correct required time computation) for ( pTemp = pObj; pTemp; pTemp = Amap_ObjChoice(p, pTemp) ) { - pObj->Level = ABC_MAX( pObj->Level, pTemp->Level ); + pObj->Level = Abc_MaxInt( pObj->Level, pTemp->Level ); // pTemp->nVisits++; pTemp->nVisitsCopy++; } // mark the largest level diff --git a/src/map/amap/amapInt.h b/src/map/amap/amapInt.h index 92e77e10..86e3e18f 100644 --- a/src/map/amap/amapInt.h +++ b/src/map/amap/amapInt.h @@ -18,15 +18,15 @@ ***********************************************************************/ -#ifndef __AMAP_INT_H__ -#define __AMAP_INT_H__ +#ifndef ABC__map__amap__amapInt_h +#define ABC__map__amap__amapInt_h //////////////////////////////////////////////////////////////////////// /// INCLUDES /// //////////////////////////////////////////////////////////////////////// -#include "aig.h" +#include "src/aig/aig/aig.h" #include "amap.h" //////////////////////////////////////////////////////////////////////// @@ -216,13 +216,6 @@ struct Amap_Obj_t_ Amap_Mat_t Best; // the best match of the node }; -static inline int Amap_Var2Lit( int Var, int fCompl ) { return Var + Var + fCompl; } -static inline int Amap_Lit2Var( int Lit ) { return Lit >> 1; } -static inline int Amap_LitIsCompl( int Lit ) { return Lit & 1; } -static inline int Amap_LitNot( int Lit ) { return Lit ^ 1; } -static inline int Amap_LitNotCond( int Lit, int c ) { return Lit ^ (int)(c > 0); } -static inline int Amap_LitRegular( int Lit ) { return Lit & ~01; } - static inline Amap_Obj_t * Amap_Regular( Amap_Obj_t * p ) { return (Amap_Obj_t *)((ABC_PTRUINT_T)(p) & ~01); } static inline Amap_Obj_t * Amap_Not( Amap_Obj_t * p ) { return (Amap_Obj_t *)((ABC_PTRUINT_T)(p) ^ 01); } static inline Amap_Obj_t * Amap_NotCond( Amap_Obj_t * p, int c ) { return (Amap_Obj_t *)((ABC_PTRUINT_T)(p) ^ (c)); } @@ -249,13 +242,13 @@ static inline int Amap_ObjIsXor( Amap_Obj_t * pObj ) static inline int Amap_ObjIsMux( Amap_Obj_t * pObj ) { return pObj->Type == AMAP_OBJ_MUX; } static inline int Amap_ObjIsNode( Amap_Obj_t * pObj ) { return pObj->Type == AMAP_OBJ_AND || pObj->Type == AMAP_OBJ_XOR || pObj->Type == AMAP_OBJ_MUX; } -static inline int Amap_ObjToLit( Amap_Obj_t * pObj ) { return Amap_Var2Lit( Amap_Regular(pObj)->Id, Amap_IsComplement(pObj) ); } -static inline Amap_Obj_t * Amap_ObjFanin0( Amap_Man_t * p, Amap_Obj_t * pObj ) { return Amap_ManObj(p, Amap_Lit2Var(pObj->Fan[0])); } -static inline Amap_Obj_t * Amap_ObjFanin1( Amap_Man_t * p, Amap_Obj_t * pObj ) { return Amap_ManObj(p, Amap_Lit2Var(pObj->Fan[1])); } -static inline Amap_Obj_t * Amap_ObjFanin2( Amap_Man_t * p, Amap_Obj_t * pObj ) { return Amap_ManObj(p, Amap_Lit2Var(pObj->Fan[2])); } -static inline int Amap_ObjFaninC0( Amap_Obj_t * pObj ) { return Amap_LitIsCompl(pObj->Fan[0]); } -static inline int Amap_ObjFaninC1( Amap_Obj_t * pObj ) { return Amap_LitIsCompl(pObj->Fan[1]); } -static inline int Amap_ObjFaninC2( Amap_Obj_t * pObj ) { return Amap_LitIsCompl(pObj->Fan[2]); } +static inline int Amap_ObjToLit( Amap_Obj_t * pObj ) { return Abc_Var2Lit( Amap_Regular(pObj)->Id, Amap_IsComplement(pObj) ); } +static inline Amap_Obj_t * Amap_ObjFanin0( Amap_Man_t * p, Amap_Obj_t * pObj ) { return Amap_ManObj(p, Abc_Lit2Var(pObj->Fan[0])); } +static inline Amap_Obj_t * Amap_ObjFanin1( Amap_Man_t * p, Amap_Obj_t * pObj ) { return Amap_ManObj(p, Abc_Lit2Var(pObj->Fan[1])); } +static inline Amap_Obj_t * Amap_ObjFanin2( Amap_Man_t * p, Amap_Obj_t * pObj ) { return Amap_ManObj(p, Abc_Lit2Var(pObj->Fan[2])); } +static inline int Amap_ObjFaninC0( Amap_Obj_t * pObj ) { return Abc_LitIsCompl(pObj->Fan[0]); } +static inline int Amap_ObjFaninC1( Amap_Obj_t * pObj ) { return Abc_LitIsCompl(pObj->Fan[1]); } +static inline int Amap_ObjFaninC2( Amap_Obj_t * pObj ) { return Abc_LitIsCompl(pObj->Fan[2]); } static inline void * Amap_ObjCopy( Amap_Obj_t * pObj ) { return pObj->pData; } static inline int Amap_ObjLevel( Amap_Obj_t * pObj ) { return pObj->Level; } static inline void Amap_ObjSetLevel( Amap_Obj_t * pObj, int Level ) { pObj->Level = Level; } @@ -313,14 +306,14 @@ extern void Kit_DsdPrintFromTruth( unsigned * pTruth, int nVars ); // iterates through each fanin of the match #define Amap_MatchForEachFaninCompl( p, pM, pFanin, fCompl, i ) \ for ( i = 0; i < (int)(pM)->pCut->nFans && \ - ((pFanin = Amap_ManObj((p), Amap_Lit2Var((pM)->pCut->Fans[Amap_Lit2Var((pM)->pSet->Ins[i])]))), 1) && \ - ((fCompl = Amap_LitIsCompl((pM)->pSet->Ins[i]) ^ Amap_LitIsCompl((pM)->pCut->Fans[Amap_Lit2Var((pM)->pSet->Ins[i])])), 1); \ + ((pFanin = Amap_ManObj((p), Abc_Lit2Var((pM)->pCut->Fans[Abc_Lit2Var((pM)->pSet->Ins[i])]))), 1) && \ + ((fCompl = Abc_LitIsCompl((pM)->pSet->Ins[i]) ^ Abc_LitIsCompl((pM)->pCut->Fans[Abc_Lit2Var((pM)->pSet->Ins[i])])), 1); \ i++ ) // iterates through each fanin of the match #define Amap_MatchForEachFanin( p, pM, pFanin, i ) \ for ( i = 0; i < (int)(pM)->pCut->nFans && \ - ((pFanin = Amap_ManObj((p), Amap_Lit2Var((pM)->pCut->Fans[Amap_Lit2Var((pM)->pSet->Ins[i])]))), 1); \ + ((pFanin = Amap_ManObj((p), Abc_Lit2Var((pM)->pCut->Fans[Abc_Lit2Var((pM)->pSet->Ins[i])]))), 1); \ i++ ) //////////////////////////////////////////////////////////////////////// diff --git a/src/map/amap/amapLib.c b/src/map/amap/amapLib.c index 74017dde..bbf76a64 100644 --- a/src/map/amap/amapLib.c +++ b/src/map/amap/amapLib.c @@ -277,7 +277,7 @@ Vec_Ptr_t * Amap_LibSelectGates( Amap_Lib_t * p, int fVerbose ) continue; if ( pGate2->nPins != pGate->nPins ) continue; - if ( !memcmp( pGate2->pFunc, pGate->pFunc, sizeof(unsigned) * Aig_TruthWordNum(pGate->nPins) ) ) + if ( !memcmp( pGate2->pFunc, pGate->pFunc, sizeof(unsigned) * Abc_TruthWordNum(pGate->nPins) ) ) break; } if ( k < i ) diff --git a/src/map/amap/amapLiberty.c b/src/map/amap/amapLiberty.c index 8006d61d..9a213d2a 100644 --- a/src/map/amap/amapLiberty.c +++ b/src/map/amap/amapLiberty.c @@ -843,7 +843,7 @@ Amap_Tree_t * Amap_LibertyStart( char * pFileName ) fclose( pFile ); p->pContents[p->nContents] = 0; // other - p->pFileName = Aig_UtilStrsav( pFileName ); + p->pFileName = Abc_UtilStrsav( pFileName ); p->nItermAlloc = 10 + Amap_LibertyCountItems( p->pContents, p->pContents+p->nContents ); p->pItems = ABC_CALLOC( Amap_Item_t, p->nItermAlloc ); p->nItems = 0; diff --git a/src/map/amap/amapMatch.c b/src/map/amap/amapMatch.c index ca513e61..40409e0d 100644 --- a/src/map/amap/amapMatch.c +++ b/src/map/amap/amapMatch.c @@ -105,7 +105,7 @@ float Amap_ManMaxDelay( Amap_Man_t * p ) float Delay = 0.0; int i; Amap_ManForEachPo( p, pObj, i ) - Delay = ABC_MAX( Delay, Amap_ObjFanin0(p,pObj)->Best.Delay ); + Delay = Abc_MaxInt( Delay, Amap_ObjFanin0(p,pObj)->Best.Delay ); return Delay; } @@ -157,9 +157,9 @@ float Amap_ManComputeMapping_rec( Amap_Man_t * p, Amap_Obj_t * pObj, int fCompl Area = pGate->dArea; for ( i = 0; i < (int)pGate->nPins; i++ ) { - iFanin = Amap_Lit2Var( pM->pSet->Ins[i] ); - pFanin = Amap_ManObj( p, Amap_Lit2Var(pM->pCut->Fans[iFanin]) ); - fComplFanin = Amap_LitIsCompl( pM->pSet->Ins[i] ) ^ Amap_LitIsCompl( pM->pCut->Fans[iFanin] ); + iFanin = Abc_Lit2Var( pM->pSet->Ins[i] ); + pFanin = Amap_ManObj( p, Abc_Lit2Var(pM->pCut->Fans[iFanin]) ); + fComplFanin = Abc_LitIsCompl( pM->pSet->Ins[i] ) ^ Abc_LitIsCompl( pM->pCut->Fans[iFanin] ); Area += Amap_ManComputeMapping_rec( p, pFanin, fComplFanin ); } return Area; @@ -376,7 +376,7 @@ static inline void Amap_ManMatchGetFlows( Amap_Man_t * p, Amap_Mat_t * pM ) Amap_MatchForEachFanin( p, pM, pFanin, i ) { pMFanin = &pFanin->Best; - pM->Delay = ABC_MAX( pM->Delay, pMFanin->Delay ); + pM->Delay = Abc_MaxInt( pM->Delay, pMFanin->Delay ); pM->AveFan += Amap_ObjRefsTotal(pFanin); if ( Amap_ObjRefsTotal(pFanin) == 0 ) pM->Area += pMFanin->Area; @@ -412,7 +412,7 @@ static inline void Amap_ManMatchGetExacts( Amap_Man_t * p, Amap_Obj_t * pNode, A Amap_MatchForEachFanin( p, pM, pFanin, i ) { pMFanin = &pFanin->Best; - pM->Delay = ABC_MAX( pM->Delay, pMFanin->Delay ); + pM->Delay = Abc_MaxInt( pM->Delay, pMFanin->Delay ); pM->AveFan += Amap_ObjRefsTotal(pFanin); } pM->AveFan /= pGate->nPins; diff --git a/src/map/amap/amapMerge.c b/src/map/amap/amapMerge.c index ecf11b07..c52642e3 100644 --- a/src/map/amap/amapMerge.c +++ b/src/map/amap/amapMerge.c @@ -54,7 +54,7 @@ Amap_Cut_t * Amap_ManSetupPis( Amap_Man_t * p ) pCut->iMat = 0; pCut->fInv = 0; pCut->nFans = 1; - pCut->Fans[0] = Amap_Var2Lit( pObj->Id, 0 ); + pCut->Fans[0] = Abc_Var2Lit( pObj->Id, 0 ); pObj->pData = pCut; pObj->nCuts = 1; pObj->EstRefs = (float)1.0; @@ -83,7 +83,7 @@ Amap_Cut_t * Amap_ManCutStore( Amap_Man_t * p, Amap_Cut_t * pCut, int fCompl ) pNew->nFans = pCut->nFans; memcpy( pNew->Fans, pCut->Fans, sizeof(int) * pCut->nFans ); // add it to storage - iFan = Amap_Var2Lit( pNew->iMat, pNew->fInv ); + iFan = Abc_Var2Lit( pNew->iMat, pNew->fInv ); if ( p->ppCutsTemp[ iFan ] == NULL ) Vec_IntPushOrder( p->vTemp, iFan ); *Amap_ManCutNextP( pNew ) = p->ppCutsTemp[ iFan ]; @@ -198,7 +198,7 @@ void Amap_ManCutSaveStored( Amap_Man_t * p, Amap_Obj_t * pNode ) pNext->iMat = 0; pNext->fInv = 0; pNext->nFans = 1; - pNext->Fans[0] = Amap_Var2Lit(pNode->Id, 0); + pNext->Fans[0] = Abc_Var2Lit(pNode->Id, 0); pNext = (Amap_Cut_t *)(pBuffer + 2); // add other cuts nCuts2 = 1; @@ -224,7 +224,7 @@ void Amap_ManCutSaveStored( Amap_Man_t * p, Amap_Obj_t * pNode ) if ( p->ppCutsTemp[i] != NULL ) printf( "Amap_ManCutSaveStored(): Error!\n" ); pNode->pData = (Amap_Cut_t *)pBuffer; - pNode->nCuts = ABC_MIN( nCuts, nMaxCuts-1 ); + pNode->nCuts = Abc_MinInt( nCuts, nMaxCuts-1 ); assert( nCuts < (1<<20) ); // printf("%d ", nCuts ); // verify cuts @@ -263,8 +263,8 @@ int Amap_ManMergeCountCuts( Amap_Man_t * p, Amap_Obj_t * pNode ) { iCompl0 = pCut0->fInv ^ Amap_ObjFaninC0(pNode); iCompl1 = pCut1->fInv ^ Amap_ObjFaninC1(pNode); - iFan0 = !pCut0->iMat? 0: Amap_Var2Lit( pCut0->iMat, iCompl0 ); - iFan1 = !pCut1->iMat? 0: Amap_Var2Lit( pCut1->iMat, iCompl1 ); + iFan0 = !pCut0->iMat? 0: Abc_Var2Lit( pCut0->iMat, iCompl0 ); + iFan1 = !pCut1->iMat? 0: Abc_Var2Lit( pCut1->iMat, iCompl1 ); Entry = Amap_LibFindNode( p->pLib, iFan0, iFan1, pNode->Type == AMAP_OBJ_XOR ); Counter += ( Entry >=0 ); // if ( Entry >=0 ) @@ -300,7 +300,7 @@ void Amap_ManPrintCuts( Amap_Obj_t * pNode ) { printf( "%3d : Mat= %3d Inv=%d ", c, pCut->iMat, pCut->fInv ); for ( i = 0; i < (int)pCut->nFans; i++ ) - printf( "%d%c ", Amap_Lit2Var(pCut->Fans[i]), Amap_LitIsCompl(pCut->Fans[i])?'-':'+' ); + printf( "%d%c ", Abc_Lit2Var(pCut->Fans[i]), Abc_LitIsCompl(pCut->Fans[i])?'-':'+' ); printf( "\n" ); } } @@ -356,7 +356,7 @@ int Amap_ManFindCut( Amap_Obj_t * pNode, Amap_Obj_t * pFanin, int fComplFanin, i Amap_NodeForEachCut( pFanin, pCut, c ) { iCompl = pCut->fInv ^ fComplFanin; - iFan = !pCut->iMat? 0: Amap_Var2Lit( pCut->iMat, iCompl ); + iFan = !pCut->iMat? 0: Abc_Var2Lit( pCut->iMat, iCompl ); if ( iFan == Val ) Vec_PtrPush( vCuts, pCut ); } @@ -406,20 +406,20 @@ void Amap_ManMergeNodeCutsMux( Amap_Man_t * p, Amap_Obj_t * pNode ) continue; // complement literals if ( pCut0->nFans == 1 && (pCut0->fInv ^ fComplFanin0) ) - pCut0->Fans[0] = Amap_LitNot(pCut0->Fans[0]); + pCut0->Fans[0] = Abc_LitNot(pCut0->Fans[0]); if ( pCut1->nFans == 1 && (pCut1->fInv ^ fComplFanin1) ) - pCut1->Fans[0] = Amap_LitNot(pCut1->Fans[0]); + pCut1->Fans[0] = Abc_LitNot(pCut1->Fans[0]); if ( pCut2->nFans == 1 && (pCut2->fInv ^ fComplFanin2) ) - pCut2->Fans[0] = Amap_LitNot(pCut2->Fans[0]); + pCut2->Fans[0] = Abc_LitNot(pCut2->Fans[0]); // create new cut Amap_ManCutCreate3( p, pCut0, pCut1, pCut2, Vec_IntEntry(vRules, x+3) ); // uncomplement literals if ( pCut0->nFans == 1 && (pCut0->fInv ^ fComplFanin0) ) - pCut0->Fans[0] = Amap_LitNot(pCut0->Fans[0]); + pCut0->Fans[0] = Abc_LitNot(pCut0->Fans[0]); if ( pCut1->nFans == 1 && (pCut1->fInv ^ fComplFanin1) ) - pCut1->Fans[0] = Amap_LitNot(pCut1->Fans[0]); + pCut1->Fans[0] = Abc_LitNot(pCut1->Fans[0]); if ( pCut2->nFans == 1 && (pCut2->fInv ^ fComplFanin2) ) - pCut2->Fans[0] = Amap_LitNot(pCut2->Fans[0]); + pCut2->Fans[0] = Abc_LitNot(pCut2->Fans[0]); } } Amap_ManCutSaveStored( p, pNode ); @@ -457,10 +457,10 @@ void Amap_ManMergeNodeCuts( Amap_Man_t * p, Amap_Obj_t * pNode ) Amap_NodeForEachCut( pFanin0, pCut0, c ) { iCompl0 = pCut0->fInv ^ Amap_ObjFaninC0(pNode); - iFan0 = !pCut0->iMat? 0: Amap_Var2Lit( pCut0->iMat, iCompl0 ); + iFan0 = !pCut0->iMat? 0: Abc_Var2Lit( pCut0->iMat, iCompl0 ); // complement literals if ( pCut0->nFans == 1 && iCompl0 ) - pCut0->Fans[0] = Amap_LitNot(pCut0->Fans[0]); + pCut0->Fans[0] = Abc_LitNot(pCut0->Fans[0]); // label resulting sets for ( i = 0; (Entry = pRules[iFan0][i]); i++ ) p->pMatsTemp[Entry & 0xffff] = (Entry >> 16); @@ -468,12 +468,12 @@ void Amap_ManMergeNodeCuts( Amap_Man_t * p, Amap_Obj_t * pNode ) Amap_NodeForEachCut( pFanin1, pCut1, k ) { iCompl1 = pCut1->fInv ^ Amap_ObjFaninC1(pNode); - iFan1 = !pCut1->iMat? 0: Amap_Var2Lit( pCut1->iMat, iCompl1 ); + iFan1 = !pCut1->iMat? 0: Abc_Var2Lit( pCut1->iMat, iCompl1 ); if ( p->pMatsTemp[iFan1] == 0 ) continue; // complement literals if ( pCut1->nFans == 1 && iCompl1 ) - pCut1->Fans[0] = Amap_LitNot(pCut1->Fans[0]); + pCut1->Fans[0] = Abc_LitNot(pCut1->Fans[0]); // create new cut if ( iFan0 >= iFan1 ) Amap_ManCutCreate( p, pCut0, pCut1, p->pMatsTemp[iFan1] ); @@ -481,11 +481,11 @@ void Amap_ManMergeNodeCuts( Amap_Man_t * p, Amap_Obj_t * pNode ) Amap_ManCutCreate( p, pCut1, pCut0, p->pMatsTemp[iFan1] ); // uncomplement literals if ( pCut1->nFans == 1 && iCompl1 ) - pCut1->Fans[0] = Amap_LitNot(pCut1->Fans[0]); + pCut1->Fans[0] = Abc_LitNot(pCut1->Fans[0]); } // uncomplement literals if ( pCut0->nFans == 1 && iCompl0 ) - pCut0->Fans[0] = Amap_LitNot(pCut0->Fans[0]); + pCut0->Fans[0] = Abc_LitNot(pCut0->Fans[0]); // label resulting sets for ( i = 0; (Entry = pRules[iFan0][i]); i++ ) p->pMatsTemp[Entry & 0xffff] = 0; diff --git a/src/map/amap/amapParse.c b/src/map/amap/amapParse.c index 49c1eb66..6fa469a9 100644 --- a/src/map/amap/amapParse.c +++ b/src/map/amap/amapParse.c @@ -19,8 +19,8 @@ ***********************************************************************/ #include "amapInt.h" -#include "hop.h" -#include "kit.h" +#include "src/aig/hop/hop.h" +#include "src/bool/kit/kit.h" ABC_NAMESPACE_IMPL_START @@ -437,8 +437,8 @@ int Amap_LibParseEquations( Amap_Lib_t * p, int fVerbose ) printf( "Skipping gate \"%s\" because its output \"%s\" does not depend on all input variables.\n", pGate->pName, pGate->pForm ); continue; } - pGate->pFunc = (unsigned *)Aig_MmFlexEntryFetch( p->pMemGates, sizeof(unsigned)*Aig_TruthWordNum(pGate->nPins) ); - memcpy( pGate->pFunc, pTruth, sizeof(unsigned)*Aig_TruthWordNum(pGate->nPins) ); + pGate->pFunc = (unsigned *)Aig_MmFlexEntryFetch( p->pMemGates, sizeof(unsigned)*Abc_TruthWordNum(pGate->nPins) ); + memcpy( pGate->pFunc, pTruth, sizeof(unsigned)*Abc_TruthWordNum(pGate->nPins) ); } Vec_PtrFree( vNames ); Vec_IntFree( vTruth ); diff --git a/src/map/amap/amapPerm.c b/src/map/amap/amapPerm.c index 71d4749a..0177a66c 100644 --- a/src/map/amap/amapPerm.c +++ b/src/map/amap/amapPerm.c @@ -19,7 +19,7 @@ ***********************************************************************/ #include "amapInt.h" -#include "kit.h" +#include "src/bool/kit/kit.h" ABC_NAMESPACE_IMPL_START @@ -51,13 +51,13 @@ void Amap_LibCollectFanins_rec( Amap_Lib_t * pLib, Amap_Nod_t * pNod, Vec_Int_t Vec_IntPush( vFanins, 0 ); return; } - pFan0 = Amap_LibNod( pLib, Amap_Lit2Var(pNod->iFan0) ); - if ( Amap_LitIsCompl(pNod->iFan0) || pFan0->Type != pNod->Type ) + pFan0 = Amap_LibNod( pLib, Abc_Lit2Var(pNod->iFan0) ); + if ( Abc_LitIsCompl(pNod->iFan0) || pFan0->Type != pNod->Type ) Vec_IntPush( vFanins, pNod->iFan0 ); else Amap_LibCollectFanins_rec( pLib, pFan0, vFanins ); - pFan1 = Amap_LibNod( pLib, Amap_Lit2Var(pNod->iFan1) ); - if ( Amap_LitIsCompl(pNod->iFan1) || pFan1->Type != pNod->Type ) + pFan1 = Amap_LibNod( pLib, Abc_Lit2Var(pNod->iFan1) ); + if ( Abc_LitIsCompl(pNod->iFan1) || pFan1->Type != pNod->Type ) Vec_IntPush( vFanins, pNod->iFan1 ); else Amap_LibCollectFanins_rec( pLib, pFan1, vFanins ); @@ -98,8 +98,8 @@ Vec_Int_t * Amap_LibDeriveGatePerm_rec( Amap_Lib_t * pLib, Kit_DsdNtk_t * pNtk, Kit_DsdObj_t * pDsdObj, * pDsdFanin; Amap_Nod_t * pNodFanin; int iDsdFanin, iNodFanin, Value, iDsdLit, i, k, j; - assert( !Kit_DsdLitIsCompl(iLit) ); - pDsdObj = Kit_DsdNtkObj( pNtk, Kit_DsdLit2Var(iLit) ); + assert( !Abc_LitIsCompl(iLit) ); + pDsdObj = Kit_DsdNtkObj( pNtk, Abc_Lit2Var(iLit) ); if ( pDsdObj == NULL ) { vPerm = Vec_IntAlloc( 1 ); @@ -110,22 +110,22 @@ Vec_Int_t * Amap_LibDeriveGatePerm_rec( Amap_Lib_t * pLib, Kit_DsdNtk_t * pNtk, { vPerm = Vec_IntAlloc( 10 ); - iDsdFanin = Kit_DsdLitRegular(pDsdObj->pFans[0]); - pNodFanin = Amap_LibNod( pLib, Amap_Lit2Var(pNod->iFan0) ); + iDsdFanin = Abc_LitRegular(pDsdObj->pFans[0]); + pNodFanin = Amap_LibNod( pLib, Abc_Lit2Var(pNod->iFan0) ); vPermFanin = Amap_LibDeriveGatePerm_rec( pLib, pNtk, iDsdFanin, pNodFanin ); Vec_IntForEachEntry( vPermFanin, Value, k ) Vec_IntPush( vPerm, Value ); Vec_IntFree( vPermFanin ); - iDsdFanin = Kit_DsdLitRegular(pDsdObj->pFans[1]); - pNodFanin = Amap_LibNod( pLib, Amap_Lit2Var(pNod->iFan1) ); + iDsdFanin = Abc_LitRegular(pDsdObj->pFans[1]); + pNodFanin = Amap_LibNod( pLib, Abc_Lit2Var(pNod->iFan1) ); vPermFanin = Amap_LibDeriveGatePerm_rec( pLib, pNtk, iDsdFanin, pNodFanin ); Vec_IntForEachEntry( vPermFanin, Value, k ) Vec_IntPush( vPerm, Value ); Vec_IntFree( vPermFanin ); - iDsdFanin = Kit_DsdLitRegular(pDsdObj->pFans[2]); - pNodFanin = Amap_LibNod( pLib, Amap_Lit2Var(pNod->iFan2) ); + iDsdFanin = Abc_LitRegular(pDsdObj->pFans[2]); + pNodFanin = Amap_LibNod( pLib, Abc_Lit2Var(pNod->iFan2) ); vPermFanin = Amap_LibDeriveGatePerm_rec( pLib, pNtk, iDsdFanin, pNodFanin ); Vec_IntForEachEntry( vPermFanin, Value, k ) Vec_IntPush( vPerm, Value ); @@ -149,7 +149,7 @@ Vec_Int_t * Amap_LibDeriveGatePerm_rec( Amap_Lib_t * pLib, Kit_DsdNtk_t * pNtk, vDsdLits = Vec_IntAlloc( 10 ); Kit_DsdObjForEachFaninReverse( pNtk, pDsdObj, iDsdFanin, i ) { - pDsdFanin = Kit_DsdNtkObj( pNtk, Kit_DsdLit2Var(iDsdFanin) ); + pDsdFanin = Kit_DsdNtkObj( pNtk, Abc_Lit2Var(iDsdFanin) ); if ( pDsdFanin ) pDsdFanin->fMark = 0; else @@ -166,10 +166,10 @@ Vec_Int_t * Amap_LibDeriveGatePerm_rec( Amap_Lib_t * pLib, Kit_DsdNtk_t * pNtk, continue; } // find a matching component - pNodFanin = Amap_LibNod( pLib, Amap_Lit2Var(iNodFanin) ); + pNodFanin = Amap_LibNod( pLib, Abc_Lit2Var(iNodFanin) ); Kit_DsdObjForEachFaninReverse( pNtk, pDsdObj, iDsdFanin, i ) { - pDsdFanin = Kit_DsdNtkObj( pNtk, Kit_DsdLit2Var(iDsdFanin) ); + pDsdFanin = Kit_DsdNtkObj( pNtk, Abc_Lit2Var(iDsdFanin) ); if ( pDsdFanin == NULL ) continue; if ( pDsdFanin->fMark == 1 ) @@ -178,7 +178,7 @@ Vec_Int_t * Amap_LibDeriveGatePerm_rec( Amap_Lib_t * pLib, Kit_DsdNtk_t * pNtk, (pDsdFanin->Type == KIT_DSD_XOR && pNodFanin->Type == AMAP_OBJ_XOR) || (pDsdFanin->Type == KIT_DSD_PRIME && pNodFanin->Type == AMAP_OBJ_MUX)) ) continue; - vPermFanin = Amap_LibDeriveGatePerm_rec( pLib, pNtk, Kit_DsdLitRegular(iDsdFanin), pNodFanin ); + vPermFanin = Amap_LibDeriveGatePerm_rec( pLib, pNtk, Abc_LitRegular(iDsdFanin), pNodFanin ); if ( vPermFanin == NULL ) continue; pDsdFanin->fMark = 1; @@ -214,24 +214,24 @@ unsigned * Amap_LibVerifyPerm_rec( Amap_Lib_t * pLib, Amap_Nod_t * pNod, assert( pNod->Type != AMAP_OBJ_MUX ); if ( pNod->Id == 0 ) return (unsigned *)Vec_PtrEntry( vTtElems, (*piInput)++ ); - pFan0 = Amap_LibNod( pLib, Amap_Lit2Var(pNod->iFan0) ); + pFan0 = Amap_LibNod( pLib, Abc_Lit2Var(pNod->iFan0) ); pTruth0 = Amap_LibVerifyPerm_rec( pLib, pFan0, vTtElems, vTruth, nWords, piInput ); - pFan1 = Amap_LibNod( pLib, Amap_Lit2Var(pNod->iFan1) ); + pFan1 = Amap_LibNod( pLib, Abc_Lit2Var(pNod->iFan1) ); pTruth1 = Amap_LibVerifyPerm_rec( pLib, pFan1, vTtElems, vTruth, nWords, piInput ); pTruth = Vec_IntFetch( vTruth, nWords ); if ( pNod->Type == AMAP_OBJ_XOR ) for ( i = 0; i < nWords; i++ ) pTruth[i] = pTruth0[i] ^ pTruth1[i]; - else if ( !Amap_LitIsCompl(pNod->iFan0) && !Amap_LitIsCompl(pNod->iFan1) ) + else if ( !Abc_LitIsCompl(pNod->iFan0) && !Abc_LitIsCompl(pNod->iFan1) ) for ( i = 0; i < nWords; i++ ) pTruth[i] = pTruth0[i] & pTruth1[i]; - else if ( !Amap_LitIsCompl(pNod->iFan0) && Amap_LitIsCompl(pNod->iFan1) ) + else if ( !Abc_LitIsCompl(pNod->iFan0) && Abc_LitIsCompl(pNod->iFan1) ) for ( i = 0; i < nWords; i++ ) pTruth[i] = pTruth0[i] & ~pTruth1[i]; - else if ( Amap_LitIsCompl(pNod->iFan0) && !Amap_LitIsCompl(pNod->iFan1) ) + else if ( Abc_LitIsCompl(pNod->iFan0) && !Abc_LitIsCompl(pNod->iFan1) ) for ( i = 0; i < nWords; i++ ) pTruth[i] = ~pTruth0[i] & pTruth1[i]; - else // if ( Amap_LitIsCompl(pNod->iFan0) && Hop_ObjFaninC1(pObj) ) + else // if ( Abc_LitIsCompl(pNod->iFan0) && Hop_ObjFaninC1(pObj) ) for ( i = 0; i < nWords; i++ ) pTruth[i] = ~pTruth0[i] & ~pTruth1[i]; return pTruth; @@ -265,8 +265,8 @@ void Amap_LibVerifyPerm( Amap_Lib_t * pLib, Amap_Gat_t * pGate, Kit_DsdNtk_t * p vTtElemsPol = Vec_PtrAlloc( pGate->nPins ); for ( i = 0; i < (int)pGate->nPins; i++ ) { - pTruth = (unsigned *)Vec_PtrEntry( vTtElems, Amap_Lit2Var(pArray[i]) ); - if ( Amap_LitIsCompl( pArray[i] ) ) + pTruth = (unsigned *)Vec_PtrEntry( vTtElems, Abc_Lit2Var(pArray[i]) ); + if ( Abc_LitIsCompl( pArray[i] ) ) Kit_TruthNot( pTruth, pTruth, pGate->nPins ); Vec_PtrPush( vTtElemsPol, pTruth ); } @@ -275,7 +275,7 @@ void Amap_LibVerifyPerm( Amap_Lib_t * pLib, Amap_Gat_t * pGate, Kit_DsdNtk_t * p // compute the truth table recursively pTruth = Amap_LibVerifyPerm_rec( pLib, pNod, vTtElemsPol, vTruth, nWords, &iInput ); assert( iInput == (int)pGate->nPins ); - if ( Kit_DsdLitIsCompl(pNtk->Root) ) + if ( Abc_LitIsCompl(pNtk->Root) ) Kit_TruthNot( pTruth, pTruth, pGate->nPins ); //Extra_PrintBinary( stdout, pTruth, 4 ); printf("\n" ); //Extra_PrintBinary( stdout, pGate->pFunc, 4 ); printf("\n" ); @@ -304,14 +304,14 @@ int Amap_LibDeriveGatePerm( Amap_Lib_t * pLib, Amap_Gat_t * pGate, Kit_DsdNtk_t int fVerbose = 0; Vec_Int_t * vPerm; int Entry, Entry2, i, k; - vPerm = Amap_LibDeriveGatePerm_rec( pLib, pNtk, Kit_DsdLitRegular(pNtk->Root), pNod ); + vPerm = Amap_LibDeriveGatePerm_rec( pLib, pNtk, Abc_LitRegular(pNtk->Root), pNod ); if ( vPerm == NULL ) return 0; // check that the permutation is valid assert( Vec_IntSize(vPerm) == (int)pNod->nSuppSize ); Vec_IntForEachEntry( vPerm, Entry, i ) Vec_IntForEachEntryStart( vPerm, Entry2, k, i+1 ) - if ( Amap_Lit2Var(Entry) == Amap_Lit2Var(Entry2) ) + if ( Abc_Lit2Var(Entry) == Abc_Lit2Var(Entry2) ) { Vec_IntFree( vPerm ); return 0; @@ -321,9 +321,9 @@ int Amap_LibDeriveGatePerm( Amap_Lib_t * pLib, Amap_Gat_t * pGate, Kit_DsdNtk_t Vec_IntForEachEntry( vPerm, Entry, i ) { assert( Entry < 2 * (int)pNod->nSuppSize ); - pArray[Kit_DsdLit2Var(Entry)] = Amap_Var2Lit( i, Kit_DsdLitIsCompl(Entry) ); + pArray[Abc_Lit2Var(Entry)] = Abc_Var2Lit( i, Abc_LitIsCompl(Entry) ); // pArray[i] = Entry; -//printf( "%d=%d%c ", Kit_DsdLit2Var(Entry), i, Kit_DsdLitIsCompl(Entry)?'-':'+' ); +//printf( "%d=%d%c ", Abc_Lit2Var(Entry), i, Abc_LitIsCompl(Entry)?'-':'+' ); } //printf( "\n" ); // if ( Kit_DsdNonDsdSizeMax(pNtk) < 3 ) @@ -334,7 +334,7 @@ int Amap_LibDeriveGatePerm( Amap_Lib_t * pLib, Amap_Gat_t * pGate, Kit_DsdNtk_t { printf( "node %4d : ", pNod->Id ); for ( i = 0; i < (int)pNod->nSuppSize; i++ ) - printf( "%d=%d%c ", i, Amap_Lit2Var(pArray[i]), Amap_LitIsCompl(pArray[i])?'-':'+' ); + printf( "%d=%d%c ", i, Abc_Lit2Var(pArray[i]), Abc_LitIsCompl(pArray[i])?'-':'+' ); printf( "\n" ); } return 1; diff --git a/src/map/amap/amapRead.c b/src/map/amap/amapRead.c index 77292099..5776c3ff 100644 --- a/src/map/amap/amapRead.c +++ b/src/map/amap/amapRead.c @@ -19,7 +19,7 @@ ***********************************************************************/ #include "amapInt.h" -#include "ioAbc.h" +#include "src/base/io/ioAbc.h" ABC_NAMESPACE_IMPL_START diff --git a/src/map/amap/amapRule.c b/src/map/amap/amapRule.c index 8308a197..0f6c7708 100644 --- a/src/map/amap/amapRule.c +++ b/src/map/amap/amapRule.c @@ -19,7 +19,7 @@ ***********************************************************************/ #include "amapInt.h" -#include "kit.h" +#include "src/bool/kit/kit.h" ABC_NAMESPACE_IMPL_START @@ -59,7 +59,7 @@ Vec_Int_t * Amap_CreateRulesPrime( Amap_Lib_t * p, Vec_Int_t * vNods0, Vec_Int_t iNod = Amap_LibFindMux( p, iNod0, iNod1, iNod2 ); if ( iNod == -1 ) iNod = Amap_LibCreateMux( p, iNod0, iNod1, iNod2 ); - Vec_IntPush( vRes, Amap_Var2Lit(iNod, 0) ); + Vec_IntPush( vRes, Abc_Var2Lit(iNod, 0) ); } return vRes; } @@ -84,7 +84,7 @@ void Amap_CreateRulesTwo( Amap_Lib_t * p, Vec_Int_t * vNods, Vec_Int_t * vNods0, iNod = Amap_LibFindNode( p, iNod0, iNod1, fXor ); if ( iNod == -1 ) iNod = Amap_LibCreateNode( p, iNod0, iNod1, fXor ); - Vec_IntPushUnique( vNods, Amap_Var2Lit(iNod, 0) ); + Vec_IntPushUnique( vNods, Abc_Var2Lit(iNod, 0) ); } } @@ -196,20 +196,20 @@ Vec_Int_t * Amap_CreateRulesFromDsd_rec( Amap_Lib_t * pLib, Kit_DsdNtk_t * p, in Kit_DsdObj_t * pObj; unsigned i; int iFanin, iNod, k; - assert( !Kit_DsdLitIsCompl(iLit) ); - pObj = Kit_DsdNtkObj( p, Kit_DsdLit2Var(iLit) ); + assert( !Abc_LitIsCompl(iLit) ); + pObj = Kit_DsdNtkObj( p, Abc_Lit2Var(iLit) ); if ( pObj == NULL ) return Vec_IntStartNatural( 1 ); // solve for the inputs vVecNods = Vec_PtrAlloc( pObj->nFans ); Kit_DsdObjForEachFanin( p, pObj, iFanin, i ) { - vNodsFanin = Amap_CreateRulesFromDsd_rec( pLib, p, Kit_DsdLitRegular(iFanin) ); - if ( Kit_DsdLitIsCompl(iFanin) ) + vNodsFanin = Amap_CreateRulesFromDsd_rec( pLib, p, Abc_LitRegular(iFanin) ); + if ( Abc_LitIsCompl(iFanin) ) { Vec_IntForEachEntry( vNodsFanin, iNod, k ) if ( iNod > 0 ) - Vec_IntWriteEntry( vNodsFanin, k, Amap_LitNot(iNod) ); + Vec_IntWriteEntry( vNodsFanin, k, Abc_LitNot(iNod) ); } Vec_PtrPush( vVecNods, vNodsFanin ); } @@ -247,13 +247,13 @@ Vec_Int_t * Amap_CreateRulesFromDsd( Amap_Lib_t * pLib, Kit_DsdNtk_t * p ) Vec_Int_t * vNods; int iNod, i; assert( p->nVars >= 2 ); - vNods = Amap_CreateRulesFromDsd_rec( pLib, p, Kit_DsdLitRegular(p->Root) ); + vNods = Amap_CreateRulesFromDsd_rec( pLib, p, Abc_LitRegular(p->Root) ); if ( vNods == NULL ) return NULL; - if ( Kit_DsdLitIsCompl(p->Root) ) + if ( Abc_LitIsCompl(p->Root) ) { Vec_IntForEachEntry( vNods, iNod, i ) - Vec_IntWriteEntry( vNods, i, Amap_LitNot(iNod) ); + Vec_IntWriteEntry( vNods, i, Abc_LitNot(iNod) ); } return vNods; } @@ -298,12 +298,12 @@ Kit_DsdPrint( stdout, pNtk ); Vec_IntForEachEntry( vNods, iNod, i ) { assert( iNod > 1 ); - pNod = Amap_LibNod( pLib, Amap_Lit2Var(iNod) ); + pNod = Amap_LibNod( pLib, Abc_Lit2Var(iNod) ); // assert( pNod->Type == AMAP_OBJ_MUX || pNod->nSuppSize == pGate->nPins ); pSet = (Amap_Set_t *)Aig_MmFlexEntryFetch( pLib->pMemSet, sizeof(Amap_Set_t) ); memset( pSet, 0, sizeof(Amap_Set_t) ); pSet->iGate = pGate->Id; - pSet->fInv = Amap_LitIsCompl(iNod); + pSet->fInv = Abc_LitIsCompl(iNod); pSet->nIns = pGate->nPins; if ( Amap_LibDeriveGatePerm( pLib, pGate, pNtk, pNod, pSet->Ins ) == 0 ) { diff --git a/src/map/amap/amapUniq.c b/src/map/amap/amapUniq.c index a2375389..dd858c96 100644 --- a/src/map/amap/amapUniq.c +++ b/src/map/amap/amapUniq.c @@ -198,14 +198,14 @@ int Amap_LibCreateNode( Amap_Lib_t * p, int iFan0, int iFan1, int fXor ) } pNode = Amap_LibCreateObj( p ); pNode->Type = fXor? AMAP_OBJ_XOR : AMAP_OBJ_AND; - pNode->nSuppSize = p->pNodes[Amap_Lit2Var(iFan0)].nSuppSize + p->pNodes[Amap_Lit2Var(iFan1)].nSuppSize; + pNode->nSuppSize = p->pNodes[Abc_Lit2Var(iFan0)].nSuppSize + p->pNodes[Abc_Lit2Var(iFan1)].nSuppSize; pNode->iFan0 = iFan0; pNode->iFan1 = iFan1; if ( p->fVerbose ) printf( "Creating node %5d %c : iFan0 = %5d%c iFan1 = %5d%c\n", pNode->Id, (fXor?'x':' '), -Amap_Lit2Var(iFan0), (Amap_LitIsCompl(iFan0)?'-':'+'), -Amap_Lit2Var(iFan1), (Amap_LitIsCompl(iFan1)?'-':'+') ); +Abc_Lit2Var(iFan0), (Abc_LitIsCompl(iFan0)?'-':'+'), +Abc_Lit2Var(iFan1), (Abc_LitIsCompl(iFan1)?'-':'+') ); if ( fXor ) { @@ -246,16 +246,16 @@ int Amap_LibCreateMux( Amap_Lib_t * p, int iFan0, int iFan1, int iFan2 ) Amap_Nod_t * pNode; pNode = Amap_LibCreateObj( p ); pNode->Type = AMAP_OBJ_MUX; - pNode->nSuppSize = p->pNodes[Amap_Lit2Var(iFan0)].nSuppSize + p->pNodes[Amap_Lit2Var(iFan1)].nSuppSize + p->pNodes[Amap_Lit2Var(iFan2)].nSuppSize; + pNode->nSuppSize = p->pNodes[Abc_Lit2Var(iFan0)].nSuppSize + p->pNodes[Abc_Lit2Var(iFan1)].nSuppSize + p->pNodes[Abc_Lit2Var(iFan2)].nSuppSize; pNode->iFan0 = iFan0; pNode->iFan1 = iFan1; pNode->iFan2 = iFan2; if ( p->fVerbose ) printf( "Creating node %5d %c : iFan0 = %5d%c iFan1 = %5d%c iFan2 = %5d%c\n", pNode->Id, 'm', -Amap_Lit2Var(iFan0), (Amap_LitIsCompl(iFan0)?'-':'+'), -Amap_Lit2Var(iFan1), (Amap_LitIsCompl(iFan1)?'-':'+'), -Amap_Lit2Var(iFan2), (Amap_LitIsCompl(iFan2)?'-':'+') ); +Abc_Lit2Var(iFan0), (Abc_LitIsCompl(iFan0)?'-':'+'), +Abc_Lit2Var(iFan1), (Abc_LitIsCompl(iFan1)?'-':'+'), +Abc_Lit2Var(iFan2), (Abc_LitIsCompl(iFan2)?'-':'+') ); Vec_IntPush( p->vRules3, iFan0 ); Vec_IntPush( p->vRules3, iFan1 ); diff --git a/src/map/cov/cov.h b/src/map/cov/cov.h index 80ef1925..135fee8c 100644 --- a/src/map/cov/cov.h +++ b/src/map/cov/cov.h @@ -18,11 +18,10 @@ ***********************************************************************/ -#ifndef __COV_H__ -#define __COV_H__ +#ifndef ABC__map__cov__cov_h +#define ABC__map__cov__cov_h -#include "abc.h" -#include "extra.h" +#include "src/base/abc/abc.h" #include "covInt.h" diff --git a/src/map/cov/covCore.c b/src/map/cov/covCore.c index a53f6b49..b128ed65 100644 --- a/src/map/cov/covCore.c +++ b/src/map/cov/covCore.c @@ -447,7 +447,7 @@ int Abc_NodeCovPropagate( Cov_Man_t * p, Abc_Obj_t * pObj ) // count statistics p->nSupps++; - p->nSuppsMax = ABC_MAX( p->nSuppsMax, p->nSupps ); + p->nSuppsMax = Abc_MaxInt( p->nSuppsMax, p->nSupps ); return 1; } @@ -732,7 +732,7 @@ int Abc_NodeCovPropagateEsop( Cov_Man_t * p, Abc_Obj_t * pObj, Abc_Obj_t * pObj0 // count statistics p->nSupps++; - p->nSuppsMax = ABC_MAX( p->nSuppsMax, p->nSupps ); + p->nSuppsMax = Abc_MaxInt( p->nSuppsMax, p->nSupps ); // set the covers assert( Abc_ObjGetSupp(pObj) == NULL ); @@ -835,7 +835,7 @@ int Abc_NodeCovPropagateSop( Cov_Man_t * p, Abc_Obj_t * pObj, Abc_Obj_t * pObj0, // count statistics p->nSupps++; - p->nSuppsMax = ABC_MAX( p->nSuppsMax, p->nSupps ); + p->nSuppsMax = Abc_MaxInt( p->nSuppsMax, p->nSupps ); // set the covers assert( Abc_ObjGetSupp(pObj) == NULL ); diff --git a/src/map/cov/covInt.h b/src/map/cov/covInt.h index 73c6bc20..5a75a8f3 100644 --- a/src/map/cov/covInt.h +++ b/src/map/cov/covInt.h @@ -18,11 +18,10 @@ ***********************************************************************/ -#ifndef __COV_INT_H__ -#define __COV_INT_H__ +#ifndef ABC__map__cov__covInt_h +#define ABC__map__cov__covInt_h -#include "abc.h" -#include "extra.h" +#include "src/base/abc/abc.h" ABC_NAMESPACE_HEADER_START diff --git a/src/map/fpga/fpga.c b/src/map/fpga/fpga.c index 08adb52e..94a84ffd 100644 --- a/src/map/fpga/fpga.c +++ b/src/map/fpga/fpga.c @@ -17,7 +17,7 @@ ***********************************************************************/ #include "fpgaInt.h" -#include "main.h" +#include "src/base/main/main.h" ABC_NAMESPACE_IMPL_START diff --git a/src/map/fpga/fpga.h b/src/map/fpga/fpga.h index 082e6635..b63d2448 100644 --- a/src/map/fpga/fpga.h +++ b/src/map/fpga/fpga.h @@ -16,8 +16,8 @@ ***********************************************************************/ -#ifndef __FPGA_H__ -#define __FPGA_H__ +#ifndef ABC__map__fpga__fpga_h +#define ABC__map__fpga__fpga_h //////////////////////////////////////////////////////////////////////// diff --git a/src/map/fpga/fpgaCreate.c b/src/map/fpga/fpgaCreate.c index 168b69c6..64f6d750 100644 --- a/src/map/fpga/fpgaCreate.c +++ b/src/map/fpga/fpgaCreate.c @@ -17,7 +17,7 @@ ***********************************************************************/ #include "fpgaInt.h" -#include "main.h" +#include "src/base/main/main.h" ABC_NAMESPACE_IMPL_START @@ -346,7 +346,7 @@ Fpga_Node_t * Fpga_NodeCreate( Fpga_Man_t * p, Fpga_Node_t * p1, Fpga_Node_t * p void Fpga_TableCreate( Fpga_Man_t * pMan ) { assert( pMan->pBins == NULL ); - pMan->nBins = Cudd_Prime(50000); + pMan->nBins = Abc_PrimeCudd(50000); pMan->pBins = ABC_ALLOC( Fpga_Node_t *, pMan->nBins ); memset( pMan->pBins, 0, sizeof(Fpga_Node_t *) * pMan->nBins ); pMan->nNodes = 0; @@ -430,7 +430,7 @@ void Fpga_TableResize( Fpga_Man_t * pMan ) clk = clock(); // get the new table size - nBinsNew = Cudd_Prime(2 * pMan->nBins); + nBinsNew = Abc_PrimeCudd(2 * pMan->nBins); // allocate a new array pBinsNew = ABC_ALLOC( Fpga_Node_t *, nBinsNew ); memset( pBinsNew, 0, sizeof(Fpga_Node_t *) * nBinsNew ); diff --git a/src/map/fpga/fpgaCut.c b/src/map/fpga/fpgaCut.c index 5f46be18..2e9ea77e 100644 --- a/src/map/fpga/fpgaCut.c +++ b/src/map/fpga/fpgaCut.c @@ -918,7 +918,7 @@ Fpga_CutTable_t * Fpga_CutTableStart( Fpga_Man_t * pMan ) // allocate the table p = ABC_ALLOC( Fpga_CutTable_t, 1 ); memset( p, 0, sizeof(Fpga_CutTable_t) ); - p->nBins = Cudd_Prime( 10 * FPGA_CUTS_MAX_COMPUTE ); + p->nBins = Abc_PrimeCudd( 10 * FPGA_CUTS_MAX_COMPUTE ); p->pBins = ABC_ALLOC( Fpga_Cut_t *, p->nBins ); memset( p->pBins, 0, sizeof(Fpga_Cut_t *) * p->nBins ); p->pCuts = ABC_ALLOC( int, 2 * FPGA_CUTS_MAX_COMPUTE ); diff --git a/src/map/fpga/fpgaInt.h b/src/map/fpga/fpgaInt.h index 26de9b80..c9272154 100644 --- a/src/map/fpga/fpgaInt.h +++ b/src/map/fpga/fpgaInt.h @@ -16,8 +16,8 @@ ***********************************************************************/ -#ifndef __FPGA_INT_H__ -#define __FPGA_INT_H__ +#ifndef ABC__map__fpga__fpgaInt_h +#define ABC__map__fpga__fpgaInt_h //////////////////////////////////////////////////////////////////////// @@ -27,7 +27,7 @@ #include <stdio.h> #include <stdlib.h> #include <string.h> -#include "extra.h" +#include "src/misc/extra/extra.h" #include "fpga.h" ABC_NAMESPACE_HEADER_START @@ -378,9 +378,6 @@ extern int Fpga_MappingMaxLevel( Fpga_Man_t * pMan ); extern void Fpga_ManReportChoices( Fpga_Man_t * pMan ); extern void Fpga_MappingSetChoiceLevels( Fpga_Man_t * pMan ); -/*=== CUDD package.c ===============================================================*/ -extern unsigned int Cudd_Prime( unsigned int p ); - ABC_NAMESPACE_HEADER_END diff --git a/src/map/fpga/fpgaTruth.c b/src/map/fpga/fpgaTruth.c index d37ff81d..d41b1184 100644 --- a/src/map/fpga/fpgaTruth.c +++ b/src/map/fpga/fpgaTruth.c @@ -17,7 +17,7 @@ ***********************************************************************/ #include "fpgaInt.h" -#include "cudd.h" +#include "src/bdd/cudd/cudd.h" ABC_NAMESPACE_IMPL_START diff --git a/src/map/if/if.h b/src/map/if/if.h index 9f04902b..09be93e0 100644 --- a/src/map/if/if.h +++ b/src/map/if/if.h @@ -18,8 +18,8 @@ ***********************************************************************/ -#ifndef __IF_H__ -#define __IF_H__ +#ifndef ABC__map__if__if_h +#define ABC__map__if__if_h //////////////////////////////////////////////////////////////////////// @@ -31,9 +31,9 @@ #include <string.h> #include <assert.h> #include <time.h> -#include "vec.h" -#include "mem.h" -#include "tim.h" +#include "src/misc/vec/vec.h" +#include "src/misc/mem/mem.h" +#include "src/misc/tim/tim.h" diff --git a/src/map/if/ifDec07.c b/src/map/if/ifDec07.c index 41949a2f..074ac6ef 100644 --- a/src/map/if/ifDec07.c +++ b/src/map/if/ifDec07.c @@ -19,8 +19,8 @@ ***********************************************************************/ #include "if.h" -#include "extra.h" -#include "kit.h" +#include "src/misc/extra/extra.h" +#include "src/bool/kit/kit.h" ABC_NAMESPACE_IMPL_START diff --git a/src/map/if/ifDec08.c b/src/map/if/ifDec08.c index 06081414..54eff63e 100644 --- a/src/map/if/ifDec08.c +++ b/src/map/if/ifDec08.c @@ -19,8 +19,8 @@ ***********************************************************************/ #include "if.h" -#include "extra.h" -#include "kit.h" +#include "src/misc/extra/extra.h" +#include "src/bool/kit/kit.h" ABC_NAMESPACE_IMPL_START diff --git a/src/map/if/ifDec10.c b/src/map/if/ifDec10.c index 9280e193..01aa32ae 100644 --- a/src/map/if/ifDec10.c +++ b/src/map/if/ifDec10.c @@ -19,8 +19,8 @@ ***********************************************************************/ #include "if.h" -#include "extra.h" -#include "kit.h" +#include "src/misc/extra/extra.h" +#include "src/bool/kit/kit.h" ABC_NAMESPACE_IMPL_START diff --git a/src/map/if/ifDec16.c b/src/map/if/ifDec16.c index 5972c2ea..c1e87aaa 100644 --- a/src/map/if/ifDec16.c +++ b/src/map/if/ifDec16.c @@ -19,7 +19,7 @@ ***********************************************************************/ #include "if.h" -#include "kit.h" +#include "src/bool/kit/kit.h" ABC_NAMESPACE_IMPL_START diff --git a/src/map/if/ifTime.c b/src/map/if/ifTime.c index b901a363..b5e2a3d0 100644 --- a/src/map/if/ifTime.c +++ b/src/map/if/ifTime.c @@ -19,7 +19,7 @@ ***********************************************************************/ #include "if.h" -#include "kit.h" +#include "src/bool/kit/kit.h" ABC_NAMESPACE_IMPL_START @@ -143,7 +143,7 @@ If_And_t If_CutDelaySopCube( Vec_Wrd_t * vCube, Vec_Wrd_t * vAnds, int fOrGate ) Next.fCompl1 = This.fCompl ^ fOrGate; Next.Id = Vec_WrdSize(vAnds); Next.fCompl = fOrGate; - Next.Delay = 1 + ABC_MAX( This.Delay, Prev.Delay ); + Next.Delay = 1 + Abc_MaxInt( This.Delay, Prev.Delay ); // add new If_AndInsertSorted( vCube, Next ); Vec_WrdPush( vAnds, If_AndToWrd(Next) ); @@ -313,7 +313,7 @@ int If_CutDelayLeafDepth_rec( Vec_Wrd_t * vAnds, If_And_t And, int iLeaf ) return -IF_BIG_CHAR; Depth0 = If_CutDelayLeafDepth_rec( vAnds, If_WrdToAnd(Vec_WrdEntry(vAnds, And.iFan0)), iLeaf ); Depth1 = If_CutDelayLeafDepth_rec( vAnds, If_WrdToAnd(Vec_WrdEntry(vAnds, And.iFan1)), iLeaf ); - Depth = ABC_MAX( Depth0, Depth1 ); + Depth = Abc_MaxInt( Depth0, Depth1 ); Depth = (Depth == -IF_BIG_CHAR) ? -IF_BIG_CHAR : Depth + 1; return Depth; } diff --git a/src/map/mapper/mapper.c b/src/map/mapper/mapper.c index f13a7641..87a0d4b8 100644 --- a/src/map/mapper/mapper.c +++ b/src/map/mapper/mapper.c @@ -16,9 +16,9 @@ ***********************************************************************/ -#include "abc.h" -#include "mainInt.h" -#include "mio.h" +#include "src/base/abc/abc.h" +#include "src/base/main/mainInt.h" +#include "src/map/mio/mio.h" #include "mapperInt.h" ABC_NAMESPACE_IMPL_START diff --git a/src/map/mapper/mapper.h b/src/map/mapper/mapper.h index aaad08ee..3fd5fd9e 100644 --- a/src/map/mapper/mapper.h +++ b/src/map/mapper/mapper.h @@ -16,8 +16,8 @@ ***********************************************************************/ -#ifndef __MAPPER_H__ -#define __MAPPER_H__ +#ifndef ABC__map__mapper__mapper_h +#define ABC__map__mapper__mapper_h //////////////////////////////////////////////////////////////////////// diff --git a/src/map/mapper/mapperCreate.c b/src/map/mapper/mapperCreate.c index af1a858f..73ccdb19 100644 --- a/src/map/mapper/mapperCreate.c +++ b/src/map/mapper/mapperCreate.c @@ -390,7 +390,7 @@ Map_Node_t * Map_NodeCreate( Map_Man_t * p, Map_Node_t * p1, Map_Node_t * p2 ) void Map_TableCreate( Map_Man_t * pMan ) { assert( pMan->pBins == NULL ); - pMan->nBins = Cudd_Prime(5000); + pMan->nBins = Abc_PrimeCudd(5000); pMan->pBins = ABC_ALLOC( Map_Node_t *, pMan->nBins ); memset( pMan->pBins, 0, sizeof(Map_Node_t *) * pMan->nBins ); pMan->nNodes = 0; @@ -474,7 +474,7 @@ void Map_TableResize( Map_Man_t * pMan ) clk = clock(); // get the new table size - nBinsNew = Cudd_Prime(2 * pMan->nBins); + nBinsNew = Abc_PrimeCudd(2 * pMan->nBins); // allocate a new array pBinsNew = ABC_ALLOC( Map_Node_t *, nBinsNew ); memset( pBinsNew, 0, sizeof(Map_Node_t *) * nBinsNew ); diff --git a/src/map/mapper/mapperCut.c b/src/map/mapper/mapperCut.c index e0afa792..29861531 100644 --- a/src/map/mapper/mapperCut.c +++ b/src/map/mapper/mapperCut.c @@ -814,7 +814,7 @@ Map_CutTable_t * Map_CutTableStart( Map_Man_t * pMan ) // allocate the table p = ABC_ALLOC( Map_CutTable_t, 1 ); memset( p, 0, sizeof(Map_CutTable_t) ); - p->nBins = Cudd_Prime( 10 * MAP_CUTS_MAX_COMPUTE ); + p->nBins = Abc_PrimeCudd( 10 * MAP_CUTS_MAX_COMPUTE ); p->pBins = ABC_ALLOC( Map_Cut_t *, p->nBins ); memset( p->pBins, 0, sizeof(Map_Cut_t *) * p->nBins ); p->pCuts = ABC_ALLOC( int, 2 * MAP_CUTS_MAX_COMPUTE ); diff --git a/src/map/mapper/mapperInt.h b/src/map/mapper/mapperInt.h index ac8110fc..08a27e68 100644 --- a/src/map/mapper/mapperInt.h +++ b/src/map/mapper/mapperInt.h @@ -16,8 +16,8 @@ ***********************************************************************/ -#ifndef __MAPPER_INT_H__ -#define __MAPPER_INT_H__ +#ifndef ABC__map__mapper__mapperInt_h +#define ABC__map__mapper__mapperInt_h //////////////////////////////////////////////////////////////////////// @@ -28,10 +28,10 @@ #include <stdlib.h> #include <string.h> #include <float.h> -#include "main.h" -#include "mio.h" +#include "src/base/main/main.h" +#include "src/map/mio/mio.h" #include "mapper.h" -#include "cuddInt.h" +#include "src/misc/extra/extraBdd.h" ABC_NAMESPACE_HEADER_START diff --git a/src/map/mapper/mapperTable.c b/src/map/mapper/mapperTable.c index 2120b5ce..7e12d8dc 100644 --- a/src/map/mapper/mapperTable.c +++ b/src/map/mapper/mapperTable.c @@ -53,7 +53,7 @@ Map_HashTable_t * Map_SuperTableCreate( Map_SuperLib_t * pLib ) memset( p, 0, sizeof(Map_HashTable_t) ); p->mmMan = pLib->mmEntries; // allocate and clean the bins - p->nBins = Cudd_Prime(20000); + p->nBins = Abc_PrimeCudd(20000); p->pBins = ABC_ALLOC( Map_HashEntry_t *, p->nBins ); memset( p->pBins, 0, sizeof(Map_HashEntry_t *) * p->nBins ); return p; @@ -237,7 +237,7 @@ void Map_SuperTableResize( Map_HashTable_t * p ) int nBinsNew, Counter, i; unsigned Key; // get the new table size - nBinsNew = Cudd_Prime(2 * p->nBins); + nBinsNew = Abc_PrimeCudd(2 * p->nBins); // allocate a new array pBinsNew = ABC_ALLOC( Map_HashEntry_t *, nBinsNew ); memset( pBinsNew, 0, sizeof(Map_HashEntry_t *) * nBinsNew ); diff --git a/src/map/mio/exp.h b/src/map/mio/exp.h index fa643325..40dff2e8 100644 --- a/src/map/mio/exp.h +++ b/src/map/mio/exp.h @@ -18,8 +18,8 @@ ***********************************************************************/ -#ifndef __EXP_H__ -#define __EXP_H__ +#ifndef ABC__map__mio__exp_h +#define ABC__map__mio__exp_h //////////////////////////////////////////////////////////////////////// /// INCLUDES /// diff --git a/src/map/mio/mio.c b/src/map/mio/mio.c index a034e549..f7eddab2 100644 --- a/src/map/mio/mio.c +++ b/src/map/mio/mio.c @@ -22,10 +22,10 @@ #include <unistd.h> #endif -#include "main.h" +#include "src/base/main/main.h" #include "mio.h" -#include "mapper.h" -#include "amap.h" +#include "src/map/mapper/mapper.h" +#include "src/map/amap/amap.h" ABC_NAMESPACE_IMPL_START diff --git a/src/map/mio/mio.h b/src/map/mio/mio.h index de35b637..a31e2e2b 100644 --- a/src/map/mio/mio.h +++ b/src/map/mio/mio.h @@ -16,8 +16,8 @@ ***********************************************************************/ -#ifndef __MIO_H__ -#define __MIO_H__ +#ifndef ABC__map__mio__mio_h +#define ABC__map__mio__mio_h //////////////////////////////////////////////////////////////////////// diff --git a/src/map/mio/mioForm.c b/src/map/mio/mioForm.c index 5c7a48e6..b3b962c0 100644 --- a/src/map/mio/mioForm.c +++ b/src/map/mio/mioForm.c @@ -17,7 +17,7 @@ ***********************************************************************/ #include "mioInt.h" -#include "parse.h" +#include "bdd/parse/parse.h" ABC_NAMESPACE_IMPL_START diff --git a/src/map/mio/mioInt.h b/src/map/mio/mioInt.h index 0752e29a..02f081fa 100644 --- a/src/map/mio/mioInt.h +++ b/src/map/mio/mioInt.h @@ -16,8 +16,8 @@ ***********************************************************************/ -#ifndef __MIO_INT_H__ -#define __MIO_INT_H__ +#ifndef ABC__map__mio__mioInt_h +#define ABC__map__mio__mioInt_h //////////////////////////////////////////////////////////////////////// @@ -28,9 +28,9 @@ #include <stdlib.h> #include <string.h> #include <assert.h> -#include "vec.h" -#include "mem.h" -#include "st.h" +#include "src/misc/vec/vec.h" +#include "src/misc/mem/mem.h" +#include "src/misc/st/st.h" #include "mio.h" ABC_NAMESPACE_HEADER_START diff --git a/src/map/mio/mioRead.c b/src/map/mio/mioRead.c index dd57d766..ccbc0ac6 100644 --- a/src/map/mio/mioRead.c +++ b/src/map/mio/mioRead.c @@ -18,7 +18,7 @@ #include <ctype.h> #include "mioInt.h" -#include "ioAbc.h" +#include "src/base/io/ioAbc.h" ABC_NAMESPACE_IMPL_START diff --git a/src/map/mio/mioUtils.c b/src/map/mio/mioUtils.c index 09f1ec96..d9447085 100644 --- a/src/map/mio/mioUtils.c +++ b/src/map/mio/mioUtils.c @@ -17,7 +17,7 @@ ***********************************************************************/ #include "mioInt.h" -#include "main.h" +#include "src/base/main/main.h" #include "exp.h" ABC_NAMESPACE_IMPL_START diff --git a/src/map/super/super.c b/src/map/super/super.c index 2cc52a44..2cbf0718 100644 --- a/src/map/super/super.c +++ b/src/map/super/super.c @@ -17,8 +17,8 @@ ***********************************************************************/ #include "superInt.h" -#include "mainInt.h" -#include "mio.h" +#include "src/base/main/mainInt.h" +#include "src/map/mio/mio.h" ABC_NAMESPACE_IMPL_START diff --git a/src/map/super/super.h b/src/map/super/super.h index 246ea092..e2af9a85 100644 --- a/src/map/super/super.h +++ b/src/map/super/super.h @@ -16,8 +16,8 @@ ***********************************************************************/ -#ifndef __SUPER_H__ -#define __SUPER_H__ +#ifndef ABC__map__super__super_h +#define ABC__map__super__super_h //////////////////////////////////////////////////////////////////////// diff --git a/src/map/super/superInt.h b/src/map/super/superInt.h index 0d4215ff..63df0f38 100644 --- a/src/map/super/superInt.h +++ b/src/map/super/superInt.h @@ -16,19 +16,19 @@ ***********************************************************************/ -#ifndef __super_INT_H__ -#define __super_INT_H__ +#ifndef ABC__map__super__superInt_h +#define ABC__map__super__superInt_h //////////////////////////////////////////////////////////////////////// /// INCLUDES /// //////////////////////////////////////////////////////////////////////// -#include "abc.h" -#include "mainInt.h" -#include "mvc.h" -#include "mio.h" -#include "stmm.h" +#include "src/base/abc/abc.h" +#include "src/base/main/mainInt.h" +#include "src/misc/mvc/mvc.h" +#include "src/map/mio/mio.h" +#include "src/misc/st/stmm.h" #include "super.h" ABC_NAMESPACE_HEADER_START |