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/opt/lpk | |
parent | f936cc0680c98ffe51b3a1716c996072d5dbf76c (diff) | |
download | abc-0871bffae307e0553e0c5186336189e8b55cf6a6.tar.gz abc-0871bffae307e0553e0c5186336189e8b55cf6a6.tar.bz2 abc-0871bffae307e0553e0c5186336189e8b55cf6a6.zip |
Version abc90215
Diffstat (limited to 'src/opt/lpk')
-rw-r--r-- | src/opt/lpk/lpk.h | 8 | ||||
-rw-r--r-- | src/opt/lpk/lpkAbcDsd.c | 4 | ||||
-rw-r--r-- | src/opt/lpk/lpkAbcUtil.c | 4 | ||||
-rw-r--r-- | src/opt/lpk/lpkCore.c | 32 | ||||
-rw-r--r-- | src/opt/lpk/lpkCut.c | 22 | ||||
-rw-r--r-- | src/opt/lpk/lpkInt.h | 8 | ||||
-rw-r--r-- | src/opt/lpk/lpkMan.c | 10 | ||||
-rw-r--r-- | src/opt/lpk/lpkMulti.c | 6 | ||||
-rw-r--r-- | src/opt/lpk/lpkSets.c | 2 |
9 files changed, 48 insertions, 48 deletions
diff --git a/src/opt/lpk/lpk.h b/src/opt/lpk/lpk.h index 2a642db2..d7e4af29 100644 --- a/src/opt/lpk/lpk.h +++ b/src/opt/lpk/lpk.h @@ -21,10 +21,6 @@ #ifndef __LPK_H__ #define __LPK_H__ -#ifdef __cplusplus -extern "C" { -#endif - //////////////////////////////////////////////////////////////////////// /// INCLUDES /// //////////////////////////////////////////////////////////////////////// @@ -33,6 +29,10 @@ extern "C" { /// PARAMETERS /// //////////////////////////////////////////////////////////////////////// +#ifdef __cplusplus +extern "C" { +#endif + //////////////////////////////////////////////////////////////////////// /// BASIC TYPES /// //////////////////////////////////////////////////////////////////////// diff --git a/src/opt/lpk/lpkAbcDsd.c b/src/opt/lpk/lpkAbcDsd.c index a1cd9def..c2a46d3e 100644 --- a/src/opt/lpk/lpkAbcDsd.c +++ b/src/opt/lpk/lpkAbcDsd.c @@ -420,7 +420,7 @@ Kit_DsdPrint( stdout, pNtks[i] ); pvBSets[i][k] = Lpk_MergeBoundSets( pvBSets[i+1][2*k+0], pvBSets[i+1][2*k+1], p->nLutK - nCofDepth ); // compare bound-sets Lpk_FunCompareBoundSets( p, pvBSets[0][0], nCofDepth, uNonDecSupp, uLateArrSupp, pRes ); - // free the bound sets + // ABC_FREE the bound sets for ( i = nCofDepth; i >= 0; i-- ) for ( k = 0; k < (1<<i); k++ ) Vec_IntFree( pvBSets[i][k] ); @@ -539,7 +539,7 @@ Lpk_Res_t * Lpk_DsdAnalize( Lpk_Man_t * pMan, Lpk_Fun_t * p, int nShared ) } finish: - // free the networks + // ABC_FREE the networks for ( i = 0; i < (1<<nShared); i++ ) if ( pNtks[i] ) Kit_DsdNtkFree( pNtks[i] ); diff --git a/src/opt/lpk/lpkAbcUtil.c b/src/opt/lpk/lpkAbcUtil.c index 3f917ce2..ae295624 100644 --- a/src/opt/lpk/lpkAbcUtil.c +++ b/src/opt/lpk/lpkAbcUtil.c @@ -42,7 +42,7 @@ Lpk_Fun_t * Lpk_FunAlloc( int nVars ) { Lpk_Fun_t * p; - p = (Lpk_Fun_t *)malloc( sizeof(Lpk_Fun_t) + sizeof(unsigned) * Kit_TruthWordNum(nVars) * 3 ); + p = (Lpk_Fun_t *)ABC_ALLOC( char, sizeof(Lpk_Fun_t) + sizeof(unsigned) * Kit_TruthWordNum(nVars) * 3 ); memset( p, 0, sizeof(Lpk_Fun_t) ); return p; } @@ -60,7 +60,7 @@ Lpk_Fun_t * Lpk_FunAlloc( int nVars ) ***********************************************************************/ void Lpk_FunFree( Lpk_Fun_t * p ) { - free( p ); + ABC_FREE( p ); } /**Function************************************************************* diff --git a/src/opt/lpk/lpkCore.c b/src/opt/lpk/lpkCore.c index d8dd15b7..7cc4b154 100644 --- a/src/opt/lpk/lpkCore.c +++ b/src/opt/lpk/lpkCore.c @@ -45,7 +45,7 @@ void Lpk_IfManStart( Lpk_Man_t * p ) If_Par_t * pPars; assert( p->pIfMan == NULL ); // set defaults - pPars = ALLOC( If_Par_t, 1 ); + pPars = ABC_ALLOC( If_Par_t, 1 ); memset( pPars, 0, sizeof(If_Par_t) ); // user-controlable paramters pPars->nLutSize = p->pPars->nLutSize; @@ -75,7 +75,7 @@ void Lpk_IfManStart( Lpk_Man_t * p ) // start the mapping manager and set its parameters p->pIfMan = If_ManStart( pPars ); If_ManSetupSetAll( p->pIfMan, 1000 ); - p->pIfMan->pPars->pTimesArr = ALLOC( float, 32 ); + p->pIfMan->pPars->pTimesArr = ABC_ALLOC( float, 32 ); } /**Function************************************************************* @@ -100,7 +100,7 @@ int Lpk_NodeHasChanged( Lpk_Man_t * p, int iNode ) Vec_PtrForEachEntry( vNodes, pTemp, i ) { // check if the node has changed - pTemp = Abc_NtkObj( p->pNtk, (int)(PORT_PTRUINT_T)pTemp ); + pTemp = Abc_NtkObj( p->pNtk, (int)(ABC_PTRUINT_T)pTemp ); if ( pTemp == NULL ) return 1; // check if the number of fanouts has changed @@ -563,7 +563,7 @@ int Lpk_Resynthesize( Abc_Ntk_t * pNtk, Lpk_Par_t * pPars ) /* // save the number of fanouts of all objects nObjMax = Abc_NtkObjNumMax( pNtk ); - pnFanouts = ALLOC( int, nObjMax ); + pnFanouts = ABC_ALLOC( int, nObjMax ); memset( pnFanouts, 0, sizeof(int) * nObjMax ); Abc_NtkForEachObj( pNtk, pObj, i ) pnFanouts[pObj->Id] = Abc_ObjFanoutNum(pObj); @@ -654,18 +654,18 @@ int Lpk_Resynthesize( Abc_Ntk_t * pNtk, Lpk_Par_t * pPars ) p->timeTotal = clock() - clk; p->timeEval = p->timeEval - p->timeMap; p->timeOther = p->timeTotal - p->timeCuts - p->timeTruth - p->timeEval - p->timeMap; - PRTP( "Cuts ", p->timeCuts, p->timeTotal ); - PRTP( "Truth ", p->timeTruth, p->timeTotal ); - PRTP( "CSupps", p->timeSupps, p->timeTotal ); - PRTP( "Eval ", p->timeEval, p->timeTotal ); - PRTP( " MuxAn", p->timeEvalMuxAn, p->timeEval ); - PRTP( " MuxSp", p->timeEvalMuxSp, p->timeEval ); - PRTP( " DsdAn", p->timeEvalDsdAn, p->timeEval ); - PRTP( " DsdSp", p->timeEvalDsdSp, p->timeEval ); - PRTP( " Other", p->timeEval-p->timeEvalMuxAn-p->timeEvalMuxSp-p->timeEvalDsdAn-p->timeEvalDsdSp, p->timeEval ); - PRTP( "Map ", p->timeMap, p->timeTotal ); - PRTP( "Other ", p->timeOther, p->timeTotal ); - PRTP( "TOTAL ", p->timeTotal, p->timeTotal ); + ABC_PRTP( "Cuts ", p->timeCuts, p->timeTotal ); + ABC_PRTP( "Truth ", p->timeTruth, p->timeTotal ); + ABC_PRTP( "CSupps", p->timeSupps, p->timeTotal ); + ABC_PRTP( "Eval ", p->timeEval, p->timeTotal ); + ABC_PRTP( " MuxAn", p->timeEvalMuxAn, p->timeEval ); + ABC_PRTP( " MuxSp", p->timeEvalMuxSp, p->timeEval ); + ABC_PRTP( " DsdAn", p->timeEvalDsdAn, p->timeEval ); + ABC_PRTP( " DsdSp", p->timeEvalDsdSp, p->timeEval ); + ABC_PRTP( " Other", p->timeEval-p->timeEvalMuxAn-p->timeEvalMuxSp-p->timeEvalDsdAn-p->timeEvalDsdSp, p->timeEval ); + ABC_PRTP( "Map ", p->timeMap, p->timeTotal ); + ABC_PRTP( "Other ", p->timeOther, p->timeTotal ); + ABC_PRTP( "TOTAL ", p->timeTotal, p->timeTotal ); } Lpk_ManStop( p ); diff --git a/src/opt/lpk/lpkCut.c b/src/opt/lpk/lpkCut.c index a2f46b09..6f0eed84 100644 --- a/src/opt/lpk/lpkCut.c +++ b/src/opt/lpk/lpkCut.c @@ -46,7 +46,7 @@ CloudNode * Lpk_CutTruthBdd_rec( CloudManager * dd, Hop_Man_t * pMan, Hop_Obj_t assert( !Hop_IsComplement(pObj) ); if ( pObj->pData ) { - assert( ((unsigned)(PORT_PTRUINT_T)pObj->pData) & 0xffff0000 ); + assert( ((unsigned)(ABC_PTRUINT_T)pObj->pData) & 0xffff0000 ); return pObj->pData; } // get the plan for a new truth table @@ -103,7 +103,7 @@ CloudNode * Lpk_CutTruthBdd( Lpk_Man_t * p, Lpk_Cut_t * pCut ) // set the initial truth tables at the fanins Abc_ObjForEachFanin( pObj, pFanin, k ) { - assert( ((unsigned)(PORT_PTRUINT_T)pFanin->pCopy) & 0xffff0000 ); + assert( ((unsigned)(ABC_PTRUINT_T)pFanin->pCopy) & 0xffff0000 ); Hop_ManPi( pManHop, k )->pData = pFanin->pCopy; } // compute the truth table of internal nodes @@ -138,7 +138,7 @@ unsigned * Lpk_CutTruth_rec( Hop_Man_t * pMan, Hop_Obj_t * pObj, int nVars, Vec_ assert( !Hop_IsComplement(pObj) ); if ( pObj->pData ) { - assert( ((unsigned)(PORT_PTRUINT_T)pObj->pData) & 0xffff0000 ); + assert( ((unsigned)(ABC_PTRUINT_T)pObj->pData) & 0xffff0000 ); return pObj->pData; } // get the plan for a new truth table @@ -194,7 +194,7 @@ unsigned * Lpk_CutTruth( Lpk_Man_t * p, Lpk_Cut_t * pCut, int fInv ) // set the initial truth tables at the fanins Abc_ObjForEachFanin( pObj, pFanin, k ) { - assert( ((unsigned)(PORT_PTRUINT_T)pFanin->pCopy) & 0xffff0000 ); + assert( ((unsigned)(ABC_PTRUINT_T)pFanin->pCopy) & 0xffff0000 ); Hop_ManPi( pManHop, k )->pData = pFanin->pCopy; } // compute the truth table of internal nodes @@ -209,7 +209,7 @@ unsigned * Lpk_CutTruth( Lpk_Man_t * p, Lpk_Cut_t * pCut, int fInv ) if ( fInv == 0 ) { pTruth = Vec_PtrEntry( p->vTtNodes, iCount++ ); - Kit_TruthCopy( pTruth, (unsigned *)(PORT_PTRUINT_T)pObj->pCopy, pCut->nLeaves ); + Kit_TruthCopy( pTruth, (unsigned *)(ABC_PTRUINT_T)pObj->pCopy, pCut->nLeaves ); } assert( iCount <= Vec_PtrSize(p->vTtNodes) ); return pTruth; @@ -244,14 +244,14 @@ void Lpk_NodeRecordImpact( Lpk_Man_t * p ) if ( pNode->fMarkC ) continue; pNode->fMarkC = 1; - Vec_PtrPush( vNodes, (void *)(PORT_PTRUINT_T)pNode->Id ); - Vec_PtrPush( vNodes, (void *)(PORT_PTRUINT_T)Abc_ObjFanoutNum(pNode) ); + Vec_PtrPush( vNodes, (void *)(ABC_PTRUINT_T)pNode->Id ); + Vec_PtrPush( vNodes, (void *)(ABC_PTRUINT_T)Abc_ObjFanoutNum(pNode) ); } } // clear the marks Vec_PtrForEachEntry( vNodes, pNode, i ) { - pNode = Abc_NtkObj( p->pNtk, (int)(PORT_PTRUINT_T)pNode ); + pNode = Abc_NtkObj( p->pNtk, (int)(ABC_PTRUINT_T)pNode ); pNode->fMarkC = 0; i++; } @@ -281,7 +281,7 @@ int Lpk_NodeCutsCheckDsd( Lpk_Man_t * p, Lpk_Cut_t * pCut ) { assert( pObj->fMarkA == 0 ); pObj->fMarkA = 1; - pObj->pCopy = (void *)(PORT_PTRUINT_T)i; + pObj->pCopy = (void *)(ABC_PTRUINT_T)i; } // ref leaves pointed from the internal nodes nCands = 0; @@ -290,7 +290,7 @@ int Lpk_NodeCutsCheckDsd( Lpk_Man_t * p, Lpk_Cut_t * pCut ) fLeavesOnly = 1; Abc_ObjForEachFanin( pObj, pFanin, k ) if ( pFanin->fMarkA ) - p->pRefs[(int)(PORT_PTRUINT_T)pFanin->pCopy]++; + p->pRefs[(int)(ABC_PTRUINT_T)pFanin->pCopy]++; else fLeavesOnly = 0; if ( fLeavesOnly ) @@ -304,7 +304,7 @@ int Lpk_NodeCutsCheckDsd( Lpk_Man_t * p, Lpk_Cut_t * pCut ) Abc_ObjForEachFanin( pObj, pFanin, k ) { assert( pFanin->fMarkA == 1 ); - if ( p->pRefs[(int)(PORT_PTRUINT_T)pFanin->pCopy] > 1 ) + if ( p->pRefs[(int)(ABC_PTRUINT_T)pFanin->pCopy] > 1 ) break; } if ( k == Abc_ObjFaninNum(pObj) ) diff --git a/src/opt/lpk/lpkInt.h b/src/opt/lpk/lpkInt.h index 960599e4..26bb846a 100644 --- a/src/opt/lpk/lpkInt.h +++ b/src/opt/lpk/lpkInt.h @@ -21,10 +21,6 @@ #ifndef __LPK_INT_H__ #define __LPK_INT_H__ -#ifdef __cplusplus -extern "C" { -#endif - //////////////////////////////////////////////////////////////////////// /// INCLUDES /// //////////////////////////////////////////////////////////////////////// @@ -38,6 +34,10 @@ extern "C" { /// PARAMETERS /// //////////////////////////////////////////////////////////////////////// +#ifdef __cplusplus +extern "C" { +#endif + //////////////////////////////////////////////////////////////////////// /// BASIC TYPES /// //////////////////////////////////////////////////////////////////////// diff --git a/src/opt/lpk/lpkMan.c b/src/opt/lpk/lpkMan.c index af6a5307..024f724a 100644 --- a/src/opt/lpk/lpkMan.c +++ b/src/opt/lpk/lpkMan.c @@ -45,7 +45,7 @@ Lpk_Man_t * Lpk_ManStart( Lpk_Par_t * pPars ) int i, nWords; assert( pPars->nLutsMax <= 16 ); assert( pPars->nVarsMax > 0 && pPars->nVarsMax <= 16 ); - p = ALLOC( Lpk_Man_t, 1 ); + p = ABC_ALLOC( Lpk_Man_t, 1 ); memset( p, 0, sizeof(Lpk_Man_t) ); p->pPars = pPars; p->nCutsMax = LPK_CUTS_MAX; @@ -61,7 +61,7 @@ Lpk_Man_t * Lpk_ManStart( Lpk_Par_t * pPars ) p->vBddInv = Vec_IntAlloc( 256 ); // allocate temporary storage for truth tables nWords = Kit_TruthWordNum(pPars->nVarsMax); - p->ppTruths[0][0] = ALLOC( unsigned, 32 * nWords ); + p->ppTruths[0][0] = ABC_ALLOC( unsigned, 32 * nWords ); p->ppTruths[1][0] = p->ppTruths[0][0] + 1 * nWords; for ( i = 1; i < 2; i++ ) p->ppTruths[1][i] = p->ppTruths[1][0] + i * nWords; @@ -91,7 +91,7 @@ Lpk_Man_t * Lpk_ManStart( Lpk_Par_t * pPars ) void Lpk_ManStop( Lpk_Man_t * p ) { int i; - free( p->ppTruths[0][0] ); + ABC_FREE( p->ppTruths[0][0] ); Vec_IntFree( p->vBddDir ); Vec_IntFree( p->vBddInv ); Vec_IntFree( p->vMemory ); @@ -102,7 +102,7 @@ void Lpk_ManStop( Lpk_Man_t * p ) { void * pPars = p->pIfMan->pPars; If_ManStop( p->pIfMan ); - free( pPars ); + ABC_FREE( pPars ); } if ( p->vLevels ) Vec_VecFree( p->vLevels ); @@ -112,7 +112,7 @@ void Lpk_ManStop( Lpk_Man_t * p ) Vec_IntFree( p->vCover ); Vec_PtrFree( p->vTtElems ); Vec_PtrFree( p->vTtNodes ); - free( p ); + ABC_FREE( p ); } //////////////////////////////////////////////////////////////////////// diff --git a/src/opt/lpk/lpkMulti.c b/src/opt/lpk/lpkMulti.c index 3d2093e7..b013570e 100644 --- a/src/opt/lpk/lpkMulti.c +++ b/src/opt/lpk/lpkMulti.c @@ -375,7 +375,7 @@ If_Obj_t * Lpk_MapTreeMulti( Lpk_Man_t * p, unsigned * pTruth, int nVars, If_Obj // allocate storage for cofactors nMemSize = Kit_TruthWordNum(nVars); - ppCofs[0][0] = ALLOC( unsigned, 32 * nMemSize ); + ppCofs[0][0] = ABC_ALLOC( unsigned, 32 * nMemSize ); nSize = 0; for ( i = 0; i < 4; i++ ) for ( k = 0; k < 8; k++ ) @@ -492,11 +492,11 @@ If_Obj_t * Lpk_MapTreeMulti( Lpk_Man_t * p, unsigned * pTruth, int nVars, If_Obj printf( "Verification failed.\n" ); - // free the networks + // ABC_FREE the networks for ( i = 0; i < 8; i++ ) if ( ppNtks[i] ) Kit_DsdNtkFree( ppNtks[i] ); - free( ppCofs[0][0] ); + ABC_FREE( ppCofs[0][0] ); return pResult; } diff --git a/src/opt/lpk/lpkSets.c b/src/opt/lpk/lpkSets.c index 90e46863..6cb3f12d 100644 --- a/src/opt/lpk/lpkSets.c +++ b/src/opt/lpk/lpkSets.c @@ -362,7 +362,7 @@ unsigned Lpk_MapSuppRedDecSelect( Lpk_Man_t * p, unsigned * pTruth, int nVars, i Lpk_PrintSets( vSets0 ); if ( fVerbose ) Lpk_PrintSets( vSets1 ); - // free the networks + // ABC_FREE the networks Kit_DsdNtkFree( ppNtks[0] ); Kit_DsdNtkFree( ppNtks[1] ); // evaluate the pair |