diff options
Diffstat (limited to 'src/opt/dec')
-rw-r--r-- | src/opt/dec/dec.h | 22 | ||||
-rw-r--r-- | src/opt/dec/decFactor.c | 4 | ||||
-rw-r--r-- | src/opt/dec/decMan.c | 14 | ||||
-rw-r--r-- | src/opt/dec/decUtil.c | 8 |
4 files changed, 24 insertions, 24 deletions
diff --git a/src/opt/dec/dec.h b/src/opt/dec/dec.h index d0d9981d..4042ac65 100644 --- a/src/opt/dec/dec.h +++ b/src/opt/dec/dec.h @@ -21,10 +21,6 @@ #ifndef __DEC_H__ #define __DEC_H__ -#ifdef __cplusplus -extern "C" { -#endif - //////////////////////////////////////////////////////////////////////// /// INCLUDES /// //////////////////////////////////////////////////////////////////////// @@ -33,6 +29,10 @@ extern "C" { /// PARAMETERS /// //////////////////////////////////////////////////////////////////////// +#ifdef __cplusplus +extern "C" { +#endif + //////////////////////////////////////////////////////////////////////// /// BASIC TYPES /// //////////////////////////////////////////////////////////////////////// @@ -212,12 +212,12 @@ static inline Dec_Edge_t Dec_IntToEdge_( unsigned Edge ) static inline Dec_Graph_t * Dec_GraphCreate( int nLeaves ) { Dec_Graph_t * pGraph; - pGraph = ALLOC( Dec_Graph_t, 1 ); + pGraph = ABC_ALLOC( Dec_Graph_t, 1 ); memset( pGraph, 0, sizeof(Dec_Graph_t) ); pGraph->nLeaves = nLeaves; pGraph->nSize = nLeaves; pGraph->nCap = 2 * nLeaves + 50; - pGraph->pNodes = ALLOC( Dec_Node_t, pGraph->nCap ); + pGraph->pNodes = ABC_ALLOC( Dec_Node_t, pGraph->nCap ); memset( pGraph->pNodes, 0, sizeof(Dec_Node_t) * pGraph->nSize ); return pGraph; } @@ -236,7 +236,7 @@ static inline Dec_Graph_t * Dec_GraphCreate( int nLeaves ) static inline Dec_Graph_t * Dec_GraphCreateConst0() { Dec_Graph_t * pGraph; - pGraph = ALLOC( Dec_Graph_t, 1 ); + pGraph = ABC_ALLOC( Dec_Graph_t, 1 ); memset( pGraph, 0, sizeof(Dec_Graph_t) ); pGraph->fConst = 1; pGraph->eRoot.fCompl = 1; @@ -257,7 +257,7 @@ static inline Dec_Graph_t * Dec_GraphCreateConst0() static inline Dec_Graph_t * Dec_GraphCreateConst1() { Dec_Graph_t * pGraph; - pGraph = ALLOC( Dec_Graph_t, 1 ); + pGraph = ABC_ALLOC( Dec_Graph_t, 1 ); memset( pGraph, 0, sizeof(Dec_Graph_t) ); pGraph->fConst = 1; return pGraph; @@ -297,8 +297,8 @@ static inline Dec_Graph_t * Dec_GraphCreateLeaf( int iLeaf, int nLeaves, int fCo ***********************************************************************/ static inline void Dec_GraphFree( Dec_Graph_t * pGraph ) { - FREE( pGraph->pNodes ); - free( pGraph ); + ABC_FREE( pGraph->pNodes ); + ABC_FREE( pGraph ); } /**Function************************************************************* @@ -560,7 +560,7 @@ static inline Dec_Node_t * Dec_GraphAppendNode( Dec_Graph_t * pGraph ) Dec_Node_t * pNode; if ( pGraph->nSize == pGraph->nCap ) { - pGraph->pNodes = REALLOC( Dec_Node_t, pGraph->pNodes, 2 * pGraph->nCap ); + pGraph->pNodes = ABC_REALLOC( Dec_Node_t, pGraph->pNodes, 2 * pGraph->nCap ); pGraph->nCap = 2 * pGraph->nCap; } pNode = pGraph->pNodes + pGraph->nSize++; diff --git a/src/opt/dec/decFactor.c b/src/opt/dec/decFactor.c index 94205196..16e65b79 100644 --- a/src/opt/dec/decFactor.c +++ b/src/opt/dec/decFactor.c @@ -57,7 +57,7 @@ Dec_Graph_t * Dec_Factor( char * pSop ) // derive the cover from the SOP representation pCover = Dec_ConvertSopToMvc( pSop ); - // make sure the cover is CCS free (should be done before CST) + // make sure the cover is CCS ABC_FREE (should be done before CST) Mvc_CoverContain( pCover ); // check for trivial functions if ( Mvc_CoverIsEmpty(pCover) ) @@ -130,7 +130,7 @@ Dec_Edge_t Dec_Factor_rec( Dec_Graph_t * pFForm, Mvc_Cover_t * pCover ) return eNode; } - // make the quotient cube free + // make the quotient cube ABC_FREE Mvc_CoverMakeCubeFree( pQuo ); // divide the cover by the quotient diff --git a/src/opt/dec/decMan.c b/src/opt/dec/decMan.c index 3d65ffc5..63a96966 100644 --- a/src/opt/dec/decMan.c +++ b/src/opt/dec/decMan.c @@ -43,13 +43,13 @@ Dec_Man_t * Dec_ManStart() { Dec_Man_t * p; // int clk = clock(); - p = ALLOC( Dec_Man_t, 1 ); + p = ABC_ALLOC( Dec_Man_t, 1 ); p->pMvcMem = Mvc_ManagerStart(); p->vCubes = Vec_IntAlloc( 8 ); p->vLits = Vec_IntAlloc( 8 ); // canonical forms, phases, perms Extra_Truth4VarNPN( &p->puCanons, &p->pPhases, &p->pPerms, &p->pMap ); -//PRT( "NPN classes precomputation time", clock() - clk ); +//ABC_PRT( "NPN classes precomputation time", clock() - clk ); return p; } @@ -69,11 +69,11 @@ void Dec_ManStop( Dec_Man_t * p ) Mvc_ManagerFree( p->pMvcMem ); Vec_IntFree( p->vCubes ); Vec_IntFree( p->vLits ); - free( p->puCanons ); - free( p->pPhases ); - free( p->pPerms ); - free( p->pMap ); - free( p ); + ABC_FREE( p->puCanons ); + ABC_FREE( p->pPhases ); + ABC_FREE( p->pPerms ); + ABC_FREE( p->pMap ); + ABC_FREE( p ); } //////////////////////////////////////////////////////////////////////// diff --git a/src/opt/dec/decUtil.c b/src/opt/dec/decUtil.c index aeabeac4..b8ae4b8a 100644 --- a/src/opt/dec/decUtil.c +++ b/src/opt/dec/decUtil.c @@ -110,17 +110,17 @@ unsigned Dec_GraphDeriveTruth( Dec_Graph_t * pGraph ) // assign the elementary variables Dec_GraphForEachLeaf( pGraph, pNode, i ) - pNode->pFunc = (void *)(PORT_PTRUINT_T)uTruths[i]; + pNode->pFunc = (void *)(ABC_PTRUINT_T)uTruths[i]; // compute the function for each internal node Dec_GraphForEachNode( pGraph, pNode, i ) { - uTruth0 = (unsigned)(PORT_PTRUINT_T)Dec_GraphNode(pGraph, pNode->eEdge0.Node)->pFunc; - uTruth1 = (unsigned)(PORT_PTRUINT_T)Dec_GraphNode(pGraph, pNode->eEdge1.Node)->pFunc; + uTruth0 = (unsigned)(ABC_PTRUINT_T)Dec_GraphNode(pGraph, pNode->eEdge0.Node)->pFunc; + uTruth1 = (unsigned)(ABC_PTRUINT_T)Dec_GraphNode(pGraph, pNode->eEdge1.Node)->pFunc; uTruth0 = pNode->eEdge0.fCompl? ~uTruth0 : uTruth0; uTruth1 = pNode->eEdge1.fCompl? ~uTruth1 : uTruth1; uTruth = uTruth0 & uTruth1; - pNode->pFunc = (void *)(PORT_PTRUINT_T)uTruth; + pNode->pFunc = (void *)(ABC_PTRUINT_T)uTruth; } // complement the result if necessary |