diff options
Diffstat (limited to 'src/opt/sim')
-rw-r--r-- | src/opt/sim/sim.h | 8 | ||||
-rw-r--r-- | src/opt/sim/simMan.c | 46 | ||||
-rw-r--r-- | src/opt/sim/simSupp.c | 8 | ||||
-rw-r--r-- | src/opt/sim/simSymStr.c | 4 | ||||
-rw-r--r-- | src/opt/sim/simUtils.c | 4 |
5 files changed, 35 insertions, 35 deletions
diff --git a/src/opt/sim/sim.h b/src/opt/sim/sim.h index 7fcf5ae6..89eaafac 100644 --- a/src/opt/sim/sim.h +++ b/src/opt/sim/sim.h @@ -21,10 +21,6 @@ #ifndef __SIM_H__ #define __SIM_H__ -#ifdef __cplusplus -extern "C" { -#endif - /* The ideas realized in this package are described in the paper: "Detecting Symmetries in Boolean Functions using Circuit Representation, @@ -39,6 +35,10 @@ extern "C" { /// PARAMETERS /// //////////////////////////////////////////////////////////////////////// +#ifdef __cplusplus +extern "C" { +#endif + //////////////////////////////////////////////////////////////////////// /// BASIC TYPES /// //////////////////////////////////////////////////////////////////////// diff --git a/src/opt/sim/simMan.c b/src/opt/sim/simMan.c index 139a1a05..6a86e25f 100644 --- a/src/opt/sim/simMan.c +++ b/src/opt/sim/simMan.c @@ -45,7 +45,7 @@ Sym_Man_t * Sym_ManStart( Abc_Ntk_t * pNtk, int fVerbose ) Sym_Man_t * p; int i, v; // start the manager - p = ALLOC( Sym_Man_t, 1 ); + p = ABC_ALLOC( Sym_Man_t, 1 ); memset( p, 0, sizeof(Sym_Man_t) ); p->pNtk = pNtk; p->vNodes = Abc_NtkDfs( pNtk, 0 ); @@ -66,9 +66,9 @@ Sym_Man_t * Sym_ManStart( Abc_Ntk_t * pNtk, int fVerbose ) p->vMatrNonSymms->pArray[i] = Extra_BitMatrixStart( p->nInputs ); } // temporary patterns - p->uPatRand = ALLOC( unsigned, p->nSimWords ); - p->uPatCol = ALLOC( unsigned, p->nSimWords ); - p->uPatRow = ALLOC( unsigned, p->nSimWords ); + p->uPatRand = ABC_ALLOC( unsigned, p->nSimWords ); + p->uPatCol = ABC_ALLOC( unsigned, p->nSimWords ); + p->uPatRow = ABC_ALLOC( unsigned, p->nSimWords ); p->vVarsU = Vec_IntStart( 100 ); p->vVarsV = Vec_IntStart( 100 ); // compute supports @@ -77,7 +77,7 @@ Sym_Man_t * Sym_ManStart( Abc_Ntk_t * pNtk, int fVerbose ) for ( i = 0; i < p->nOutputs; i++ ) for ( v = 0; v < p->nInputs; v++ ) if ( Sim_SuppFunHasVar( p->vSuppFun, i, v ) ) - Vec_VecPush( p->vSupports, i, (void *)(PORT_PTRUINT_T)v ); + Vec_VecPush( p->vSupports, i, (void *)(ABC_PTRUINT_T)v ); return p; } @@ -112,10 +112,10 @@ void Sym_ManStop( Sym_Man_t * p ) Vec_IntFree( p->vPairsTotal ); Vec_IntFree( p->vPairsSym ); Vec_IntFree( p->vPairsNonSym ); - FREE( p->uPatRand ); - FREE( p->uPatCol ); - FREE( p->uPatRow ); - free( p ); + ABC_FREE( p->uPatRand ); + ABC_FREE( p->uPatCol ); + ABC_FREE( p->uPatRow ); + ABC_FREE( p ); } /**Function************************************************************* @@ -139,13 +139,13 @@ void Sym_ManPrintStats( Sym_Man_t * p ) printf( "Total var pairs = %8d.\n", p->nPairsTotal ); printf( "Sat runs SAT = %8d.\n", p->nSatRunsSat ); printf( "Sat runs UNSAT = %8d.\n", p->nSatRunsUnsat ); - PRT( "Structural ", p->timeStruct ); - PRT( "Simulation ", p->timeSim ); - PRT( "Matrix ", p->timeMatr ); - PRT( "Counting ", p->timeCount ); - PRT( "Fraiging ", p->timeFraig ); - PRT( "SAT ", p->timeSat ); - PRT( "TOTAL ", p->timeTotal ); + ABC_PRT( "Structural ", p->timeStruct ); + ABC_PRT( "Simulation ", p->timeSim ); + ABC_PRT( "Matrix ", p->timeMatr ); + ABC_PRT( "Counting ", p->timeCount ); + ABC_PRT( "Fraiging ", p->timeFraig ); + ABC_PRT( "SAT ", p->timeSat ); + ABC_PRT( "TOTAL ", p->timeTotal ); } @@ -164,7 +164,7 @@ Sim_Man_t * Sim_ManStart( Abc_Ntk_t * pNtk, int fLightweight ) { Sim_Man_t * p; // start the manager - p = ALLOC( Sim_Man_t, 1 ); + p = ABC_ALLOC( Sim_Man_t, 1 ); memset( p, 0, sizeof(Sim_Man_t) ); p->pNtk = pNtk; p->nInputs = Abc_NtkCiNum(p->pNtk); @@ -213,7 +213,7 @@ void Sim_ManStop( Sim_Man_t * p ) if ( p->pMmPat ) Extra_MmFixedStop( p->pMmPat ); if ( p->vFifo ) Vec_PtrFree( p->vFifo ); if ( p->vDiffs ) Vec_IntFree( p->vDiffs ); - free( p ); + ABC_FREE( p ); } /**Function************************************************************* @@ -235,11 +235,11 @@ void Sim_ManPrintStats( Sim_Man_t * p ) printf( "Total struct supps = %8d.\n", Sim_UtilCountSuppSizes(p, 1) ); printf( "Sat runs SAT = %8d.\n", p->nSatRunsSat ); printf( "Sat runs UNSAT = %8d.\n", p->nSatRunsUnsat ); - PRT( "Simulation ", p->timeSim ); - PRT( "Traversal ", p->timeTrav ); - PRT( "Fraiging ", p->timeFraig ); - PRT( "SAT ", p->timeSat ); - PRT( "TOTAL ", p->timeTotal ); + ABC_PRT( "Simulation ", p->timeSim ); + ABC_PRT( "Traversal ", p->timeTrav ); + ABC_PRT( "Fraiging ", p->timeFraig ); + ABC_PRT( "SAT ", p->timeSat ); + ABC_PRT( "TOTAL ", p->timeTotal ); } diff --git a/src/opt/sim/simSupp.c b/src/opt/sim/simSupp.c index e6ba853c..f84fedc4 100644 --- a/src/opt/sim/simSupp.c +++ b/src/opt/sim/simSupp.c @@ -319,7 +319,7 @@ void Sim_ComputeSuppSetTargets( Sim_Man_t * p ) // find vars in the structural support that are not in the functional support Sim_UtilInfoDetectNews( pSuppFun, pSuppStr, p->nSuppWords, p->vDiffs ); Vec_IntForEachEntry( p->vDiffs, Num, k ) - Vec_VecPush( p->vSuppTargs, Num, (void *)(PORT_PTRUINT_T)i ); + Vec_VecPush( p->vSuppTargs, Num, (void *)(ABC_PTRUINT_T)i ); } } @@ -460,7 +460,7 @@ void Sim_SolveTargetsUsingSat( Sim_Man_t * p, int Limit ) Vec_VecForEachEntryReverse( p->vSuppTargs, pEntry, Input, k ) { p->nSatRuns++; - Output = (int)(PORT_PTRUINT_T)pEntry; + Output = (int)(ABC_PTRUINT_T)pEntry; // set up the miter for the two cofactors of this output w.r.t. this input pMiter = Abc_NtkMiterForCofactors( p->pNtk, Output, Input, -1 ); @@ -545,7 +545,7 @@ int Sim_NtkSimTwoPats_rec( Abc_Obj_t * pNode ) { int Value0, Value1; if ( Abc_NodeIsTravIdCurrent( pNode ) ) - return (int)(PORT_PTRUINT_T)pNode->pCopy; + return (int)(ABC_PTRUINT_T)pNode->pCopy; Abc_NodeSetTravIdCurrent( pNode ); Value0 = Sim_NtkSimTwoPats_rec( Abc_ObjFanin0(pNode) ); Value1 = Sim_NtkSimTwoPats_rec( Abc_ObjFanin1(pNode) ); @@ -553,7 +553,7 @@ int Sim_NtkSimTwoPats_rec( Abc_Obj_t * pNode ) Value0 = ~Value0; if ( Abc_ObjFaninC1(pNode) ) Value1 = ~Value1; - pNode->pCopy = (Abc_Obj_t *)(PORT_PTRUINT_T)(Value0 & Value1); + pNode->pCopy = (Abc_Obj_t *)(ABC_PTRUINT_T)(Value0 & Value1); return Value0 & Value1; } diff --git a/src/opt/sim/simSymStr.c b/src/opt/sim/simSymStr.c index d52c4328..9ff2f590 100644 --- a/src/opt/sim/simSymStr.c +++ b/src/opt/sim/simSymStr.c @@ -96,7 +96,7 @@ void Sim_SymmsStructCompute( Abc_Ntk_t * pNtk, Vec_Ptr_t * vMatrs, Vec_Ptr_t * v // if ( !Abc_NodeIsConst(pTemp) ) Vec_IntFree( SIM_READ_SYMMS(pTemp) ); Vec_PtrFree( vNodes ); - free( pMap ); + ABC_FREE( pMap ); } /**Function************************************************************* @@ -471,7 +471,7 @@ int * Sim_SymmsCreateMap( Abc_Ntk_t * pNtk ) int * pMap; Abc_Obj_t * pNode; int i; - pMap = ALLOC( int, Abc_NtkObjNumMax(pNtk) ); + pMap = ABC_ALLOC( int, Abc_NtkObjNumMax(pNtk) ); for ( i = 0; i < Abc_NtkObjNumMax(pNtk); i++ ) pMap[i] = -1; Abc_NtkForEachCi( pNtk, pNode, i ) diff --git a/src/opt/sim/simUtils.c b/src/opt/sim/simUtils.c index b74f3abe..dba487d8 100644 --- a/src/opt/sim/simUtils.c +++ b/src/opt/sim/simUtils.c @@ -57,7 +57,7 @@ Vec_Ptr_t * Sim_UtilInfoAlloc( int nSize, int nWords, bool fClean ) int i; assert( nSize > 0 && nWords > 0 ); vInfo = Vec_PtrAlloc( nSize ); - vInfo->pArray[0] = ALLOC( unsigned, nSize * nWords ); + vInfo->pArray[0] = ABC_ALLOC( unsigned, nSize * nWords ); if ( fClean ) memset( vInfo->pArray[0], 0, sizeof(unsigned) * nSize * nWords ); for ( i = 1; i < nSize; i++ ) @@ -79,7 +79,7 @@ Vec_Ptr_t * Sim_UtilInfoAlloc( int nSize, int nWords, bool fClean ) ***********************************************************************/ void Sim_UtilInfoFree( Vec_Ptr_t * p ) { - free( p->pArray[0] ); + ABC_FREE( p->pArray[0] ); Vec_PtrFree( p ); } |