From 148a786b694b5cad9035e53f35a349d6274f0291 Mon Sep 17 00:00:00 2001 From: Alan Mishchenko Date: Thu, 3 Mar 2011 12:28:52 -0800 Subject: Made abc.h independent of CUDD and Extra. --- src/map/cov/cov.h | 1 + src/map/cov/covBuild.c | 12 ++++++------ src/map/cov/covInt.h | 1 + src/map/mio/mioFunc.c | 5 +++-- src/map/mio/mioInt.h | 3 ++- src/map/mio/mioRead.c | 2 +- src/map/mio/mioUtils.c | 2 +- 7 files changed, 15 insertions(+), 11 deletions(-) (limited to 'src/map') diff --git a/src/map/cov/cov.h b/src/map/cov/cov.h index f8136a7f..80ef1925 100644 --- a/src/map/cov/cov.h +++ b/src/map/cov/cov.h @@ -22,6 +22,7 @@ #define __COV_H__ #include "abc.h" +#include "extra.h" #include "covInt.h" diff --git a/src/map/cov/covBuild.c b/src/map/cov/covBuild.c index 3975c91d..6ca17583 100644 --- a/src/map/cov/covBuild.c +++ b/src/map/cov/covBuild.c @@ -82,7 +82,7 @@ Abc_Obj_t * Abc_NtkCovDeriveCube( Abc_Ntk_t * pNtkNew, Abc_Obj_t * pObj, Min_Cub Vec_IntWriteEntry( vLits, i, Lit==1 ); Abc_ObjAddFanin( pNodeNew, pFanin->pCopy ); } - pNodeNew->pData = Abc_SopCreateAnd( (Extra_MmFlex_t *)pNtkNew->pManFunc, vLits->nSize, vLits->pArray ); + pNodeNew->pData = Abc_SopCreateAnd( (Mem_Flex_t *)pNtkNew->pManFunc, vLits->nSize, vLits->pArray ); if ( fCompl ) Abc_SopComplement( (char *)pNodeNew->pData ); Vec_IntFree( vLits ); @@ -153,7 +153,7 @@ Abc_Obj_t * Abc_NtkCovDeriveNode_rec( Cov_Man_t * p, Abc_Ntk_t * pNtkNew, Abc_Ob pFaninNew = Abc_NtkCovDeriveCube( pNtkNew, pObj, pCube, vSupp, 0 ); Abc_ObjAddFanin( pNodeNew, pFaninNew ); } - pNodeNew->pData = Abc_SopCreateXorSpecial( (Extra_MmFlex_t *)pNtkNew->pManFunc, nCubes ); + pNodeNew->pData = Abc_SopCreateXorSpecial( (Mem_Flex_t *)pNtkNew->pManFunc, nCubes ); } /* printf( "Created node %d(%d) at level %d: ", pNodeNew->Id, pObj->Id, Level ); @@ -280,8 +280,8 @@ Abc_Obj_t * Abc_NtkCovDeriveCubeInv( Abc_Ntk_t * pNtkNew, Abc_Obj_t * pObj, Min_ // Abc_ObjAddFanin( pNodeNew, pFanin->pCopy ); Abc_ObjAddFanin( pNodeNew, Abc_NtkCovDeriveInv( pNtkNew, pFanin, Lit==1 ) ); } -// pNodeNew->pData = Abc_SopCreateAnd( (Extra_MmFlex_t *)pNtkNew->pManFunc, vLits->nSize, vLits->pArray ); - pNodeNew->pData = Abc_SopCreateAnd( (Extra_MmFlex_t *)pNtkNew->pManFunc, vLits->nSize, NULL ); +// pNodeNew->pData = Abc_SopCreateAnd( (Mem_Flex_t *)pNtkNew->pManFunc, vLits->nSize, vLits->pArray ); + pNodeNew->pData = Abc_SopCreateAnd( (Mem_Flex_t *)pNtkNew->pManFunc, vLits->nSize, NULL ); Vec_IntFree( vLits ); return pNodeNew; } @@ -335,7 +335,7 @@ Abc_Obj_t * Abc_NtkCovDeriveNodeInv_rec( Cov_Man_t * p, Abc_Ntk_t * pNtkNew, Abc pFaninNew = Abc_NtkCovDeriveCubeInv( pNtkNew, pObj, pCube, vSupp ); Abc_ObjAddFanin( pNodeNew, pFaninNew ); } - pNodeNew->pData = Abc_SopCreateXorSpecial( (Extra_MmFlex_t *)pNtkNew->pManFunc, nCubes ); + pNodeNew->pData = Abc_SopCreateXorSpecial( (Mem_Flex_t *)pNtkNew->pManFunc, nCubes ); } pObj->pCopy = pNodeNew; @@ -472,7 +472,7 @@ Abc_Obj_t * Abc_NtkCovDerive_rec( Cov_Man_t * p, Abc_Ntk_t * pNtkNew, Abc_Obj_t // derive the function vCover = Vec_StrAlloc( 100 ); Min_CoverCreate( vCover, pCover, (char)Type ); - pNodeNew->pData = Abc_SopRegister((Extra_MmFlex_t *)pNtkNew->pManFunc, Vec_StrArray(vCover) ); + pNodeNew->pData = Abc_SopRegister((Mem_Flex_t *)pNtkNew->pManFunc, Vec_StrArray(vCover) ); Vec_StrFree( vCover ); } diff --git a/src/map/cov/covInt.h b/src/map/cov/covInt.h index b2d293d4..73c6bc20 100644 --- a/src/map/cov/covInt.h +++ b/src/map/cov/covInt.h @@ -22,6 +22,7 @@ #define __COV_INT_H__ #include "abc.h" +#include "extra.h" ABC_NAMESPACE_HEADER_START diff --git a/src/map/mio/mioFunc.c b/src/map/mio/mioFunc.c index e58d3958..c14944c4 100644 --- a/src/map/mio/mioFunc.c +++ b/src/map/mio/mioFunc.c @@ -90,6 +90,7 @@ int Mio_LibraryParseFormulas( Mio_Library_t * pLib ) ***********************************************************************/ int Mio_GateParseFormula( Mio_Gate_t * pGate ) { + extern char * Abc_ConvertBddToSop( Mem_Flex_t * pMan, DdManager * dd, DdNode * bFuncOn, DdNode * bFuncOnDc, int nFanins, int fAllPrimes, Vec_Str_t * vCube, int fMode ); DdManager * dd = pGate->pLib->dd; char * pPinNames[100]; char * pPinNamesCopy[100]; @@ -114,13 +115,13 @@ int Mio_GateParseFormula( Mio_Gate_t * pGate ) if ( strcmp( pGate->pForm, MIO_STRING_CONST0 ) == 0 ) { pGate->bFunc = b0; - pGate->pSop = Abc_SopRegister( (Extra_MmFlex_t *)pGate->pLib->pMmFlex, " 0\n" ); + pGate->pSop = Abc_SopRegister( (Mem_Flex_t *)pGate->pLib->pMmFlex, " 0\n" ); pGate->pLib->pGate0 = pGate; } else if ( strcmp( pGate->pForm, MIO_STRING_CONST1 ) == 0 ) { pGate->bFunc = b1; - pGate->pSop = Abc_SopRegister( (Extra_MmFlex_t *)pGate->pLib->pMmFlex, " 1\n" ); + pGate->pSop = Abc_SopRegister( (Mem_Flex_t *)pGate->pLib->pMmFlex, " 1\n" ); pGate->pLib->pGate1 = pGate; } else diff --git a/src/map/mio/mioInt.h b/src/map/mio/mioInt.h index 35a583b6..87bd7d4e 100644 --- a/src/map/mio/mioInt.h +++ b/src/map/mio/mioInt.h @@ -25,6 +25,7 @@ //////////////////////////////////////////////////////////////////////// #include "abc.h" +#include "mem.h" #include "mvc.h" #include "main.h" #include "mio.h" @@ -69,7 +70,7 @@ struct Mio_LibraryStruct_t_ Mio_Gate_t * pGateAnd2; // the AND2 gate st_table * tName2Gate; // the mapping of gate names into their pointer DdManager * dd; // the nanager storing functions of gates - Extra_MmFlex_t * pMmFlex; // the memory manaqer for SOPs + Mem_Flex_t * pMmFlex; // the memory manaqer for SOPs Vec_Str_t * vCube; // temporary cube }; diff --git a/src/map/mio/mioRead.c b/src/map/mio/mioRead.c index 42c6d8bf..eb5d47ea 100644 --- a/src/map/mio/mioRead.c +++ b/src/map/mio/mioRead.c @@ -101,7 +101,7 @@ Mio_Library_t * Mio_LibraryReadOne( Abc_Frame_t * pAbc, char * FileName, int fEx memset( pLib, 0, sizeof(Mio_Library_t) ); pLib->pName = Extra_UtilStrsav( FileName ); pLib->tName2Gate = st_init_table(strcmp, st_strhash); - pLib->pMmFlex = Extra_MmFlexStart(); + pLib->pMmFlex = Mem_FlexStart(); pLib->vCube = Vec_StrAlloc( 100 ); // read the file and clean comments diff --git a/src/map/mio/mioUtils.c b/src/map/mio/mioUtils.c index 0e8cbb03..d0d47060 100644 --- a/src/map/mio/mioUtils.c +++ b/src/map/mio/mioUtils.c @@ -56,7 +56,7 @@ void Mio_LibraryDelete( Mio_Library_t * pLib ) ABC_FREE( pLib->pName ); Mio_LibraryForEachGateSafe( pLib, pGate, pGate2 ) Mio_GateDelete( pGate ); - Extra_MmFlexStop( pLib->pMmFlex ); + Mem_FlexStop( pLib->pMmFlex, 0 ); Vec_StrFree( pLib->vCube ); if ( pLib->tName2Gate ) st_free_table( pLib->tName2Gate ); -- cgit v1.2.3