diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2009-02-15 08:01:00 -0800 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2009-02-15 08:01:00 -0800 |
commit | 0871bffae307e0553e0c5186336189e8b55cf6a6 (patch) | |
tree | 4571d1563fe33a53a57fea1c35fb668b9d33265f /src/aig/cnf | |
parent | f936cc0680c98ffe51b3a1716c996072d5dbf76c (diff) | |
download | abc-0871bffae307e0553e0c5186336189e8b55cf6a6.tar.gz abc-0871bffae307e0553e0c5186336189e8b55cf6a6.tar.bz2 abc-0871bffae307e0553e0c5186336189e8b55cf6a6.zip |
Version abc90215
Diffstat (limited to 'src/aig/cnf')
-rw-r--r-- | src/aig/cnf/cnf.h | 8 | ||||
-rw-r--r-- | src/aig/cnf/cnfCore.c | 10 | ||||
-rw-r--r-- | src/aig/cnf/cnfData.c | 6 | ||||
-rw-r--r-- | src/aig/cnf/cnfMan.c | 40 | ||||
-rw-r--r-- | src/aig/cnf/cnfMap.c | 4 | ||||
-rw-r--r-- | src/aig/cnf/cnfWrite.c | 24 |
6 files changed, 46 insertions, 46 deletions
diff --git a/src/aig/cnf/cnf.h b/src/aig/cnf/cnf.h index c9c5bce3..4343bf9a 100644 --- a/src/aig/cnf/cnf.h +++ b/src/aig/cnf/cnf.h @@ -21,10 +21,6 @@ #ifndef __CNF_H__ #define __CNF_H__ -#ifdef __cplusplus -extern "C" { -#endif - //////////////////////////////////////////////////////////////////////// /// INCLUDES /// //////////////////////////////////////////////////////////////////////// @@ -43,6 +39,10 @@ extern "C" { /// PARAMETERS /// //////////////////////////////////////////////////////////////////////// +#ifdef __cplusplus +extern "C" { +#endif + //////////////////////////////////////////////////////////////////////// /// BASIC TYPES /// //////////////////////////////////////////////////////////////////////// diff --git a/src/aig/cnf/cnfCore.c b/src/aig/cnf/cnfCore.c index e1d62de0..11a7af43 100644 --- a/src/aig/cnf/cnfCore.c +++ b/src/aig/cnf/cnfCore.c @@ -77,9 +77,9 @@ p->timeSave = clock() - clk; // reset reference counters Aig_ManResetRefs( pAig ); -//PRT( "Cuts ", p->timeCuts ); -//PRT( "Map ", p->timeMap ); -//PRT( "Saving ", p->timeSave ); +//ABC_PRT( "Cuts ", p->timeCuts ); +//ABC_PRT( "Map ", p->timeMap ); +//ABC_PRT( "Saving ", p->timeSave ); return pCnf; } @@ -141,7 +141,7 @@ Cnf_Dat_t * Cnf_Derive_old( Aig_Man_t * pAig ) clk = clock(); Cnf_ManScanMapping( p, 0 ); Cnf_ManMapForCnf( p ); -PRT( "iter ", clock() - clk ); +ABC_PRT( "iter ", clock() - clk ); } */ // write the file @@ -159,7 +159,7 @@ clk = clock(); Cnf_ManPostprocess( p ); Cnf_ManScanMapping( p, 0 ); */ -PRT( "Ext ", clock() - clk ); +ABC_PRT( "Ext ", clock() - clk ); /* vMapped = Cnf_ManScanMapping( p, 1 ); diff --git a/src/aig/cnf/cnfData.c b/src/aig/cnf/cnfData.c index 01f6ff8a..8df93fdb 100644 --- a/src/aig/cnf/cnfData.c +++ b/src/aig/cnf/cnfData.c @@ -4554,7 +4554,7 @@ void Cnf_ReadMsops( char ** ppSopSizes, char *** ppSops ) assert( Size < 100000 ); // allocate memory - pMemory = ALLOC( char, Size * 75 ); + pMemory = ABC_ALLOC( char, Size * 75 ); // copy the array into memory for ( i = 0; i < Size; i++ ) for ( k = 0; k < 75; k++ ) @@ -4564,8 +4564,8 @@ void Cnf_ReadMsops( char ** ppSopSizes, char *** ppSops ) pMemory[i*75+k] = Map[(int)s_Data4[i][k]]; // set pointers and compute SOP sizes - pSopSizes = ALLOC( char, 65536 ); - pSops = ALLOC( char *, 65536 ); + pSopSizes = ABC_ALLOC( char, 65536 ); + pSops = ABC_ALLOC( char *, 65536 ); pSopSizes[0] = 0; pSops[0] = NULL; pPrev = pMemory; diff --git a/src/aig/cnf/cnfMan.c b/src/aig/cnf/cnfMan.c index 7c24606c..f8e88b8f 100644 --- a/src/aig/cnf/cnfMan.c +++ b/src/aig/cnf/cnfMan.c @@ -49,7 +49,7 @@ Cnf_Man_t * Cnf_ManStart() Cnf_Man_t * p; int i; // allocate the manager - p = ALLOC( Cnf_Man_t, 1 ); + p = ABC_ALLOC( Cnf_Man_t, 1 ); memset( p, 0, sizeof(Cnf_Man_t) ); // derive internal data structures Cnf_ReadMsops( &p->pSopSizes, &p->pSops ); @@ -57,7 +57,7 @@ Cnf_Man_t * Cnf_ManStart() p->pMemCuts = Aig_MmFlexStart(); p->nMergeLimit = 10; // allocate temporary truth tables - p->pTruths[0] = ALLOC( unsigned, 4 * Aig_TruthWordNum(p->nMergeLimit) ); + p->pTruths[0] = ABC_ALLOC( unsigned, 4 * Aig_TruthWordNum(p->nMergeLimit) ); for ( i = 1; i < 4; i++ ) p->pTruths[i] = p->pTruths[i-1] + Aig_TruthWordNum(p->nMergeLimit); p->vMemory = Vec_IntAlloc( 1 << 18 ); @@ -78,12 +78,12 @@ Cnf_Man_t * Cnf_ManStart() void Cnf_ManStop( Cnf_Man_t * p ) { Vec_IntFree( p->vMemory ); - free( p->pTruths[0] ); + ABC_FREE( p->pTruths[0] ); Aig_MmFlexStop( p->pMemCuts, 0 ); - free( p->pSopSizes ); - free( p->pSops[1] ); - free( p->pSops ); - free( p ); + ABC_FREE( p->pSopSizes ); + ABC_FREE( p->pSops[1] ); + ABC_FREE( p->pSops ); + ABC_FREE( p ); } /**Function************************************************************* @@ -123,16 +123,16 @@ Cnf_Dat_t * Cnf_DataAlloc( Aig_Man_t * pAig, int nVars, int nClauses, int nLiter { Cnf_Dat_t * pCnf; int i; - pCnf = ALLOC( Cnf_Dat_t, 1 ); + pCnf = ABC_ALLOC( Cnf_Dat_t, 1 ); memset( pCnf, 0, sizeof(Cnf_Dat_t) ); pCnf->pMan = pAig; pCnf->nVars = nVars; pCnf->nClauses = nClauses; pCnf->nLiterals = nLiterals; - pCnf->pClauses = ALLOC( int *, nClauses + 1 ); - pCnf->pClauses[0] = ALLOC( int, nLiterals ); + pCnf->pClauses = ABC_ALLOC( int *, nClauses + 1 ); + pCnf->pClauses[0] = ABC_ALLOC( int, nLiterals ); pCnf->pClauses[nClauses] = pCnf->pClauses[0] + nLiterals; - pCnf->pVarNums = ALLOC( int, Aig_ManObjNumMax(pAig) ); + pCnf->pVarNums = ABC_ALLOC( int, Aig_ManObjNumMax(pAig) ); // memset( pCnf->pVarNums, 0xff, sizeof(int) * Aig_ManObjNumMax(pAig) ); for ( i = 0; i < Aig_ManObjNumMax(pAig); i++ ) pCnf->pVarNums[i] = -1; @@ -177,10 +177,10 @@ void Cnf_DataFree( Cnf_Dat_t * p ) { if ( p == NULL ) return; - free( p->pClauses[0] ); - free( p->pClauses ); - free( p->pVarNums ); - free( p ); + ABC_FREE( p->pClauses[0] ); + ABC_FREE( p->pClauses ); + ABC_FREE( p->pVarNums ); + ABC_FREE( p ); } /**Function************************************************************* @@ -425,15 +425,15 @@ int Cnf_DataWriteOrClause( void * p, Cnf_Dat_t * pCnf ) sat_solver * pSat = p; Aig_Obj_t * pObj; int i, * pLits; - pLits = ALLOC( int, Aig_ManPoNum(pCnf->pMan) ); + pLits = ABC_ALLOC( int, Aig_ManPoNum(pCnf->pMan) ); Aig_ManForEachPo( pCnf->pMan, pObj, i ) pLits[i] = toLitCond( pCnf->pVarNums[pObj->Id], 0 ); if ( !sat_solver_addclause( pSat, pLits, pLits + Aig_ManPoNum(pCnf->pMan) ) ) { - free( pLits ); + ABC_FREE( pLits ); return 0; } - free( pLits ); + ABC_FREE( pLits ); return 1; } @@ -479,7 +479,7 @@ void Cnf_DataTranformPolarity( Cnf_Dat_t * pCnf, int fTransformPos ) int * pVarToPol; int i, iVar; // create map from the variable number to its polarity - pVarToPol = CALLOC( int, pCnf->nVars ); + pVarToPol = ABC_CALLOC( int, pCnf->nVars ); Aig_ManForEachObj( pCnf->pMan, pObj, i ) { if ( !fTransformPos && Aig_ObjIsPo(pObj) ) @@ -495,7 +495,7 @@ void Cnf_DataTranformPolarity( Cnf_Dat_t * pCnf, int fTransformPos ) if ( pVarToPol[iVar] ) pCnf->pClauses[0][i] = lit_neg( pCnf->pClauses[0][i] ); } - free( pVarToPol ); + ABC_FREE( pVarToPol ); } //////////////////////////////////////////////////////////////////////// diff --git a/src/aig/cnf/cnfMap.c b/src/aig/cnf/cnfMap.c index 8453e3cc..63625e6f 100644 --- a/src/aig/cnf/cnfMap.c +++ b/src/aig/cnf/cnfMap.c @@ -101,7 +101,7 @@ void Cnf_DeriveMapping( Cnf_Man_t * p ) Dar_Cut_t * pCut, * pCutBest; int i, k, AreaFlow, * pAreaFlows; // allocate area flows - pAreaFlows = ALLOC( int, Aig_ManObjNumMax(p->pManAig) ); + pAreaFlows = ABC_ALLOC( int, Aig_ManObjNumMax(p->pManAig) ); memset( pAreaFlows, 0, sizeof(int) * Aig_ManObjNumMax(p->pManAig) ); // visit the nodes in the topological order and update their best cuts vSuper = Vec_PtrAlloc( 100 ); @@ -136,7 +136,7 @@ void Cnf_DeriveMapping( Cnf_Man_t * p ) } } Vec_PtrFree( vSuper ); - free( pAreaFlows ); + ABC_FREE( pAreaFlows ); /* // compute the area of mapping diff --git a/src/aig/cnf/cnfWrite.c b/src/aig/cnf/cnfWrite.c index 8a6a9160..638e67da 100644 --- a/src/aig/cnf/cnfWrite.c +++ b/src/aig/cnf/cnfWrite.c @@ -205,17 +205,17 @@ Cnf_Dat_t * Cnf_ManWriteCnf( Cnf_Man_t * p, Vec_Ptr_t * vMapped, int nOutputs ) //printf( "\n" ); // allocate CNF - pCnf = ALLOC( Cnf_Dat_t, 1 ); + pCnf = ABC_ALLOC( Cnf_Dat_t, 1 ); memset( pCnf, 0, sizeof(Cnf_Dat_t) ); pCnf->pMan = p->pManAig; pCnf->nLiterals = nLiterals; pCnf->nClauses = nClauses; - pCnf->pClauses = ALLOC( int *, nClauses + 1 ); - pCnf->pClauses[0] = ALLOC( int, nLiterals ); + pCnf->pClauses = ABC_ALLOC( int *, nClauses + 1 ); + pCnf->pClauses[0] = ABC_ALLOC( int, nLiterals ); pCnf->pClauses[nClauses] = pCnf->pClauses[0] + nLiterals; // create room for variable numbers - pCnf->pVarNums = ALLOC( int, Aig_ManObjNumMax(p->pManAig) ); + pCnf->pVarNums = ABC_ALLOC( int, Aig_ManObjNumMax(p->pManAig) ); // memset( pCnf->pVarNums, 0xff, sizeof(int) * Aig_ManObjNumMax(p->pManAig) ); for ( i = 0; i < Aig_ManObjNumMax(p->pManAig); i++ ) pCnf->pVarNums[i] = -1; @@ -356,17 +356,17 @@ Cnf_Dat_t * Cnf_DeriveSimple( Aig_Man_t * p, int nOutputs ) nClauses = 1 + 3 * Aig_ManNodeNum(p) + Aig_ManPoNum( p ) + nOutputs; // allocate CNF - pCnf = ALLOC( Cnf_Dat_t, 1 ); + pCnf = ABC_ALLOC( Cnf_Dat_t, 1 ); memset( pCnf, 0, sizeof(Cnf_Dat_t) ); pCnf->pMan = p; pCnf->nLiterals = nLiterals; pCnf->nClauses = nClauses; - pCnf->pClauses = ALLOC( int *, nClauses + 1 ); - pCnf->pClauses[0] = ALLOC( int, nLiterals ); + pCnf->pClauses = ABC_ALLOC( int *, nClauses + 1 ); + pCnf->pClauses[0] = ABC_ALLOC( int, nLiterals ); pCnf->pClauses[nClauses] = pCnf->pClauses[0] + nLiterals; // create room for variable numbers - pCnf->pVarNums = ALLOC( int, Aig_ManObjNumMax(p) ); + pCnf->pVarNums = ABC_ALLOC( int, Aig_ManObjNumMax(p) ); // memset( pCnf->pVarNums, 0xff, sizeof(int) * Aig_ManObjNumMax(p) ); for ( i = 0; i < Aig_ManObjNumMax(p); i++ ) pCnf->pVarNums[i] = -1; @@ -478,17 +478,17 @@ Cnf_Dat_t * Cnf_DeriveSimpleForRetiming( Aig_Man_t * p ) nClauses = 1 + 3 * Aig_ManNodeNum(p) + 3 * Aig_ManPoNum(p); // allocate CNF - pCnf = ALLOC( Cnf_Dat_t, 1 ); + pCnf = ABC_ALLOC( Cnf_Dat_t, 1 ); memset( pCnf, 0, sizeof(Cnf_Dat_t) ); pCnf->pMan = p; pCnf->nLiterals = nLiterals; pCnf->nClauses = nClauses; - pCnf->pClauses = ALLOC( int *, nClauses + 1 ); - pCnf->pClauses[0] = ALLOC( int, nLiterals ); + pCnf->pClauses = ABC_ALLOC( int *, nClauses + 1 ); + pCnf->pClauses[0] = ABC_ALLOC( int, nLiterals ); pCnf->pClauses[nClauses] = pCnf->pClauses[0] + nLiterals; // create room for variable numbers - pCnf->pVarNums = ALLOC( int, Aig_ManObjNumMax(p) ); + pCnf->pVarNums = ABC_ALLOC( int, Aig_ManObjNumMax(p) ); // memset( pCnf->pVarNums, 0xff, sizeof(int) * Aig_ManObjNumMax(p) ); for ( i = 0; i < Aig_ManObjNumMax(p); i++ ) pCnf->pVarNums[i] = -1; |