summaryrefslogtreecommitdiffstats
path: root/src/aig/dar
diff options
context:
space:
mode:
Diffstat (limited to 'src/aig/dar')
-rw-r--r--src/aig/dar/dar.h9
-rw-r--r--src/aig/dar/darCore.c23
-rw-r--r--src/aig/dar/darCut.c17
-rw-r--r--src/aig/dar/darData.c4
-rw-r--r--src/aig/dar/darInt.h12
-rw-r--r--src/aig/dar/darLib.c58
-rw-r--r--src/aig/dar/darMan.c21
-rw-r--r--src/aig/dar/darPrec.c32
-rw-r--r--src/aig/dar/darRefact.c12
-rw-r--r--src/aig/dar/darScript.c8
10 files changed, 109 insertions, 87 deletions
diff --git a/src/aig/dar/dar.h b/src/aig/dar/dar.h
index c2d53c89..86f43a9e 100644
--- a/src/aig/dar/dar.h
+++ b/src/aig/dar/dar.h
@@ -21,10 +21,6 @@
#ifndef __DAR_H__
#define __DAR_H__
-#ifdef __cplusplus
-extern "C" {
-#endif
-
////////////////////////////////////////////////////////////////////////
/// INCLUDES ///
////////////////////////////////////////////////////////////////////////
@@ -33,6 +29,10 @@ extern "C" {
/// PARAMETERS ///
////////////////////////////////////////////////////////////////////////
+#ifdef __cplusplus
+extern "C" {
+#endif
+
////////////////////////////////////////////////////////////////////////
/// BASIC TYPES ///
////////////////////////////////////////////////////////////////////////
@@ -48,6 +48,7 @@ struct Dar_RwrPar_t_
int fUpdateLevel; // update level
int fUseZeros; // performs zero-cost replacement
int fPower; // enables power-aware rewriting
+ int fRecycle; // enables cut recycling
int fVerbose; // enables verbose output
int fVeryVerbose; // enables very verbose output
};
diff --git a/src/aig/dar/darCore.c b/src/aig/dar/darCore.c
index 957b4cc9..3c8423cf 100644
--- a/src/aig/dar/darCore.c
+++ b/src/aig/dar/darCore.c
@@ -48,6 +48,7 @@ void Dar_ManDefaultRwrParams( Dar_RwrPar_t * pPars )
pPars->fUpdateLevel = 0;
pPars->fUseZeros = 0;
pPars->fPower = 0;
+ pPars->fRecycle = 1;
pPars->fVerbose = 0;
pPars->fVeryVerbose = 0;
}
@@ -71,7 +72,7 @@ int Dar_ManRewrite( Aig_Man_t * pAig, Dar_RwrPar_t * pPars )
Dar_Cut_t * pCut;
Aig_Obj_t * pObj, * pObjNew;
int i, k, nNodesOld, nNodeBefore, nNodeAfter, Required;
- int clk = 0, clkStart;
+ int clk = 0, clkStart, Counter = 0;
// prepare the library
Dar_LibPrepare( pPars->nSubgMax );
// create rewriting manager
@@ -86,7 +87,7 @@ int Dar_ManRewrite( Aig_Man_t * pAig, Dar_RwrPar_t * pPars )
if ( p->pPars->fUpdateLevel )
Aig_ManStartReverseLevels( pAig, 0 );
// set elementary cuts for the PIs
- Dar_ManCutsStart( p );
+// Dar_ManCutsStart( p );
// resynthesize each node once
clkStart = clock();
p->nNodesInit = Aig_ManNodeNum(pAig);
@@ -105,6 +106,13 @@ int Dar_ManRewrite( Aig_Man_t * pAig, Dar_RwrPar_t * pPars )
if ( i > nNodesOld )
// if ( p->pPars->fUseZeros && i > nNodesOld )
break;
+ if ( pPars->fRecycle && ++Counter % 50000 == 0 && Aig_DagSize(pObj) < Vec_PtrSize(p->vCutNodes)/100 )
+ {
+// printf( "Counter = %7d. Node = %7d. Dag = %5d. Vec = %5d.\n",
+// Counter, i, Aig_DagSize(pObj), Vec_PtrSize(p->vCutNodes) );
+// fflush( stdout );
+ Dar_ManCutsRestart( p, pObj );
+ }
// consider freeing the cuts
// if ( (i & 0xFFF) == 0 && Aig_MmFixedReadMemUsage(p->pMemCuts)/(1<<20) > 100 )
@@ -173,7 +181,6 @@ p->timeTotal = clock() - clkStart;
p->timeOther = p->timeTotal - p->timeCuts - p->timeEval;
// Bar_ProgressStop( pProgress );
- p->nCutMemUsed = Aig_MmFixedReadMemUsage(p->pMemCuts)/(1<<20);
Dar_ManCutsFree( p );
// put the nodes into the DFS order and reassign their IDs
// Aig_NtkReassignIds( p );
@@ -260,7 +267,11 @@ Aig_MmFixed_t * Dar_ManComputeCuts( Aig_Man_t * pAig, int nCutsMax, int fVerbose
// create rewriting manager
p = Dar_ManStart( pAig, pPars );
// set elementary cuts for the PIs
- Dar_ManCutsStart( p );
+// Dar_ManCutsStart( p );
+ Aig_MmFixedRestart( p->pMemCuts );
+ Dar_ObjPrepareCuts( p, Aig_ManConst1(p->pAig) );
+ Aig_ManForEachPi( pAig, pObj, i )
+ Dar_ObjPrepareCuts( p, pObj );
// compute cuts for each nodes in the topological order
Aig_ManForEachNode( pAig, pObj, i )
Dar_ObjComputeCuts( p, pObj );
@@ -274,14 +285,14 @@ Aig_MmFixed_t * Dar_ManComputeCuts( Aig_Man_t * pAig, int nCutsMax, int fVerbose
Aig_ManObjNum(pAig), nCuts, nCutsK );
printf( "Cut size = %2d. Truth size = %2d. Total mem = %5.2f Mb ",
(int)sizeof(Dar_Cut_t), (int)4, 1.0*Aig_MmFixedReadMemUsage(p->pMemCuts)/(1<<20) );
- PRT( "Runtime", clock() - clk );
+ ABC_PRT( "Runtime", clock() - clk );
/*
Aig_ManForEachNode( pAig, pObj, i )
if ( i % 300 == 0 )
Dar_ObjCutPrint( pAig, pObj );
*/
}
- // free the cuts
+ // ABC_FREE the cuts
pMemCuts = p->pMemCuts;
p->pMemCuts = NULL;
// Dar_ManCutsFree( p );
diff --git a/src/aig/dar/darCut.c b/src/aig/dar/darCut.c
index 6ebfec9d..1e1e4edb 100644
--- a/src/aig/dar/darCut.c
+++ b/src/aig/dar/darCut.c
@@ -127,7 +127,7 @@ static inline int Dar_CutFindValue( Dar_Man_t * p, Dar_Cut_t * pCut )
/**Function*************************************************************
- Synopsis [Returns the next free cut to use.]
+ Synopsis [Returns the next ABC_FREE cut to use.]
Description [Uses the cut with the smallest value.]
@@ -585,9 +585,11 @@ Dar_Cut_t * Dar_ObjPrepareCuts( Dar_Man_t * p, Aig_Obj_t * pObj )
pObj->nCuts = p->pPars->nCutsMax;
// create the cutset of the node
pCutSet = (Dar_Cut_t *)Aig_MmFixedEntryFetch( p->pMemCuts );
+ memset( pCutSet, 0, p->pPars->nCutsMax * sizeof(Dar_Cut_t) );
Dar_ObjSetCuts( pObj, pCutSet );
Dar_ObjForEachCutAll( pObj, pCut, i )
pCut->fUsed = 0;
+ Vec_PtrPush( p->vCutNodes, pObj );
// add unit cut if needed
pCut = pCutSet;
pCut->fUsed = 1;
@@ -605,6 +607,8 @@ Dar_Cut_t * Dar_ObjPrepareCuts( Dar_Man_t * p, Aig_Obj_t * pObj )
pCut->uTruth = 0xAAAA;
}
pCut->Value = Dar_CutFindValue( p, pCut );
+ if ( p->nCutMemUsed < Aig_MmFixedReadMemUsage(p->pMemCuts)/(1<<20) )
+ p->nCutMemUsed = Aig_MmFixedReadMemUsage(p->pMemCuts)/(1<<20);
return pCutSet;
}
@@ -619,15 +623,16 @@ Dar_Cut_t * Dar_ObjPrepareCuts( Dar_Man_t * p, Aig_Obj_t * pObj )
SeeAlso []
***********************************************************************/
-void Dar_ManCutsStart( Dar_Man_t * p )
+void Dar_ManCutsRestart( Dar_Man_t * p, Aig_Obj_t * pRoot )
{
Aig_Obj_t * pObj;
int i;
- Aig_ManCleanData( p->pAig );
+ Vec_PtrForEachEntry( p->vCutNodes, pObj, i )
+ if ( !Aig_ObjIsNone(pObj) )
+ Dar_ObjSetCuts( pObj, NULL );
+ Vec_PtrClear( p->vCutNodes );
Aig_MmFixedRestart( p->pMemCuts );
Dar_ObjPrepareCuts( p, Aig_ManConst1(p->pAig) );
- Aig_ManForEachPi( p->pAig, pObj, i )
- Dar_ObjPrepareCuts( p, pObj );
}
/**Function*************************************************************
@@ -725,6 +730,8 @@ Dar_Cut_t * Dar_ObjComputeCuts_rec( Dar_Man_t * p, Aig_Obj_t * pObj )
{
if ( Dar_ObjCuts(pObj) )
return Dar_ObjCuts(pObj);
+ if ( Aig_ObjIsPi(pObj) )
+ return Dar_ObjPrepareCuts( p, pObj );
if ( Aig_ObjIsBuf(pObj) )
return Dar_ObjComputeCuts_rec( p, Aig_ObjFanin0(pObj) );
Dar_ObjComputeCuts_rec( p, Aig_ObjFanin0(pObj) );
diff --git a/src/aig/dar/darData.c b/src/aig/dar/darData.c
index cb403b8a..e644c92b 100644
--- a/src/aig/dar/darData.c
+++ b/src/aig/dar/darData.c
@@ -11174,7 +11174,7 @@ void Aig_NtkGenerateArrays( Abc_Ntk_t * pNtk )
pObj->pCopy = (void *)Count++;
Pos = 0;
- pBuffer = ALLOC( char, 200000 );
+ pBuffer = ABC_ALLOC( char, 200000 );
Abc_AigForEachAnd( pNtk, pObj, i )
{
pObj->pCopy = (void *)Count++;
@@ -11250,7 +11250,7 @@ void Aig_NtkGenerateArrays( Abc_Ntk_t * pNtk )
Vec_IntSort( vOuts, 0 );
Pos = 0;
- pBuffer = ALLOC( char, 50000 );
+ pBuffer = ABC_ALLOC( char, 50000 );
Prev = 0;
Vec_IntForEachEntry( vOuts, Out, i )
{
diff --git a/src/aig/dar/darInt.h b/src/aig/dar/darInt.h
index afa3bd07..0f2e8894 100644
--- a/src/aig/dar/darInt.h
+++ b/src/aig/dar/darInt.h
@@ -21,10 +21,6 @@
#ifndef __DAR_INT_H__
#define __DAR_INT_H__
-#ifdef __cplusplus
-extern "C" {
-#endif
-
////////////////////////////////////////////////////////////////////////
/// INCLUDES ///
////////////////////////////////////////////////////////////////////////
@@ -44,6 +40,10 @@ extern "C" {
/// PARAMETERS ///
////////////////////////////////////////////////////////////////////////
+#ifdef __cplusplus
+extern "C" {
+#endif
+
////////////////////////////////////////////////////////////////////////
/// BASIC TYPES ///
////////////////////////////////////////////////////////////////////////
@@ -72,6 +72,7 @@ struct Dar_Man_t_
// various data members
Aig_MmFixed_t * pMemCuts; // memory manager for cuts
void * pManCnf; // CNF managers
+ Vec_Ptr_t * vCutNodes; // the nodes with cuts allocated
// current rewriting step
Vec_Ptr_t * vLeavesBest; // the best set of leaves
int OutBest; // the best output (in the library)
@@ -130,8 +131,9 @@ static inline void Dar_ObjSetCuts( Aig_Obj_t * pObj, Dar_Cut_t * pCuts )
/*=== darBalance.c ========================================================*/
/*=== darCore.c ===========================================================*/
/*=== darCut.c ============================================================*/
-extern void Dar_ManCutsStart( Dar_Man_t * p );
+extern void Dar_ManCutsRestart( Dar_Man_t * p, Aig_Obj_t * pRoot );
extern void Dar_ManCutsFree( Dar_Man_t * p );
+extern Dar_Cut_t * Dar_ObjPrepareCuts( Dar_Man_t * p, Aig_Obj_t * pObj );
extern Dar_Cut_t * Dar_ObjComputeCuts_rec( Dar_Man_t * p, Aig_Obj_t * pObj );
extern Dar_Cut_t * Dar_ObjComputeCuts( Dar_Man_t * p, Aig_Obj_t * pObj );
extern void Dar_ObjCutPrint( Aig_Man_t * p, Aig_Obj_t * pObj );
diff --git a/src/aig/dar/darLib.c b/src/aig/dar/darLib.c
index 24693df2..c5fd4696 100644
--- a/src/aig/dar/darLib.c
+++ b/src/aig/dar/darLib.c
@@ -123,11 +123,11 @@ Dar_Lib_t * Dar_LibAlloc( int nObjs )
unsigned uTruths[4] = { 0xAAAA, 0xCCCC, 0xF0F0, 0xFF00 };
Dar_Lib_t * p;
int i;//, clk = clock();
- p = ALLOC( Dar_Lib_t, 1 );
+ p = ABC_ALLOC( Dar_Lib_t, 1 );
memset( p, 0, sizeof(Dar_Lib_t) );
// allocate objects
p->nObjs = nObjs;
- p->pObjs = ALLOC( Dar_LibObj_t, nObjs );
+ p->pObjs = ABC_ALLOC( Dar_LibObj_t, nObjs );
memset( p->pObjs, 0, sizeof(Dar_LibObj_t) * nObjs );
// allocate canonical data
p->pPerms4 = Dar_Permutations( 4 );
@@ -139,7 +139,7 @@ Dar_Lib_t * Dar_LibAlloc( int nObjs )
p->pObjs[i].fTerm = 1;
p->pObjs[i].Num = uTruths[i];
}
-// PRT( "Library start", clock() - clk );
+// ABC_PRT( "Library start", clock() - clk );
return p;
}
@@ -156,21 +156,21 @@ Dar_Lib_t * Dar_LibAlloc( int nObjs )
***********************************************************************/
void Dar_LibFree( Dar_Lib_t * p )
{
- free( p->pObjs );
- free( p->pDatas );
- free( p->pNodesMem );
- free( p->pNodes0Mem );
- free( p->pSubgrMem );
- free( p->pSubgr0Mem );
- free( p->pPriosMem );
- FREE( p->pPlaceMem );
- FREE( p->pScoreMem );
- free( p->pPerms4 );
- free( p->puCanons );
- free( p->pPhases );
- free( p->pPerms );
- free( p->pMap );
- free( p );
+ ABC_FREE( p->pObjs );
+ ABC_FREE( p->pDatas );
+ ABC_FREE( p->pNodesMem );
+ ABC_FREE( p->pNodes0Mem );
+ ABC_FREE( p->pSubgrMem );
+ ABC_FREE( p->pSubgr0Mem );
+ ABC_FREE( p->pPriosMem );
+ ABC_FREE( p->pPlaceMem );
+ ABC_FREE( p->pScoreMem );
+ ABC_FREE( p->pPerms4 );
+ ABC_FREE( p->puCanons );
+ ABC_FREE( p->pPhases );
+ ABC_FREE( p->pPerms );
+ ABC_FREE( p->pMap );
+ ABC_FREE( p );
}
/**Function*************************************************************
@@ -275,8 +275,8 @@ void Dar_LibSetup( Dar_Lib_t * p, Vec_Int_t * vOuts, Vec_Int_t * vPrios )
p->nSubgr[Class]++;
}
// allocate memory for the roots of each class
- p->pSubgrMem = ALLOC( int, Vec_IntSize(vOuts) );
- p->pSubgr0Mem = ALLOC( int, Vec_IntSize(vOuts) );
+ p->pSubgrMem = ABC_ALLOC( int, Vec_IntSize(vOuts) );
+ p->pSubgr0Mem = ABC_ALLOC( int, Vec_IntSize(vOuts) );
p->nSubgrTotal = 0;
for ( i = 0; i < 222; i++ )
{
@@ -298,7 +298,7 @@ void Dar_LibSetup( Dar_Lib_t * p, Vec_Int_t * vOuts, Vec_Int_t * vPrios )
if ( fTraining )
{
// allocate memory for the priority of roots of each class
- p->pPriosMem = ALLOC( int, Vec_IntSize(vOuts) );
+ p->pPriosMem = ABC_ALLOC( int, Vec_IntSize(vOuts) );
p->nSubgrTotal = 0;
for ( i = 0; i < 222; i++ )
{
@@ -311,7 +311,7 @@ void Dar_LibSetup( Dar_Lib_t * p, Vec_Int_t * vOuts, Vec_Int_t * vPrios )
assert( p->nSubgrTotal == Vec_IntSize(vOuts) );
// allocate memory for the priority of roots of each class
- p->pPlaceMem = ALLOC( int, Vec_IntSize(vOuts) );
+ p->pPlaceMem = ABC_ALLOC( int, Vec_IntSize(vOuts) );
p->nSubgrTotal = 0;
for ( i = 0; i < 222; i++ )
{
@@ -324,7 +324,7 @@ void Dar_LibSetup( Dar_Lib_t * p, Vec_Int_t * vOuts, Vec_Int_t * vPrios )
assert( p->nSubgrTotal == Vec_IntSize(vOuts) );
// allocate memory for the priority of roots of each class
- p->pScoreMem = ALLOC( int, Vec_IntSize(vOuts) );
+ p->pScoreMem = ABC_ALLOC( int, Vec_IntSize(vOuts) );
p->nSubgrTotal = 0;
for ( i = 0; i < 222; i++ )
{
@@ -340,7 +340,7 @@ void Dar_LibSetup( Dar_Lib_t * p, Vec_Int_t * vOuts, Vec_Int_t * vPrios )
{
int Counter = 0;
// allocate memory for the priority of roots of each class
- p->pPriosMem = ALLOC( int, Vec_IntSize(vOuts) );
+ p->pPriosMem = ABC_ALLOC( int, Vec_IntSize(vOuts) );
p->nSubgrTotal = 0;
for ( i = 0; i < 222; i++ )
{
@@ -366,8 +366,8 @@ void Dar_LibSetup( Dar_Lib_t * p, Vec_Int_t * vOuts, Vec_Int_t * vPrios )
for ( i = 0; i < 222; i++ )
p->nNodesTotal += p->nNodes[i];
// allocate memory for the nodes of each class
- p->pNodesMem = ALLOC( int, p->nNodesTotal );
- p->pNodes0Mem = ALLOC( int, p->nNodesTotal );
+ p->pNodesMem = ABC_ALLOC( int, p->nNodesTotal );
+ p->pNodes0Mem = ABC_ALLOC( int, p->nNodesTotal );
p->nNodesTotal = 0;
for ( i = 0; i < 222; i++ )
{
@@ -409,10 +409,10 @@ void Dar_LibCreateData( Dar_Lib_t * p, int nDatas )
{
if ( p->nDatas == nDatas )
return;
- FREE( p->pDatas );
+ ABC_FREE( p->pDatas );
// allocate datas
p->nDatas = nDatas;
- p->pDatas = ALLOC( Dar_LibDat_t, nDatas );
+ p->pDatas = ABC_ALLOC( Dar_LibDat_t, nDatas );
memset( p->pDatas, 0, sizeof(Dar_LibDat_t) * nDatas );
}
@@ -572,7 +572,7 @@ void Dar_LibStart()
assert( s_DarLib == NULL );
s_DarLib = Dar_LibRead();
// printf( "The 4-input library started with %d nodes and %d subgraphs. ", s_DarLib->nObjs - 4, s_DarLib->nSubgrTotal );
-// PRT( "Time", clock() - clk );
+// ABC_PRT( "Time", clock() - clk );
}
/**Function*************************************************************
diff --git a/src/aig/dar/darMan.c b/src/aig/dar/darMan.c
index 9ab504c0..b11d3175 100644
--- a/src/aig/dar/darMan.c
+++ b/src/aig/dar/darMan.c
@@ -42,14 +42,13 @@
Dar_Man_t * Dar_ManStart( Aig_Man_t * pAig, Dar_RwrPar_t * pPars )
{
Dar_Man_t * p;
- // start the manager
- p = ALLOC( Dar_Man_t, 1 );
+ Aig_ManCleanData( pAig );
+ p = ABC_ALLOC( Dar_Man_t, 1 );
memset( p, 0, sizeof(Dar_Man_t) );
p->pPars = pPars;
p->pAig = pAig;
- // prepare the internal memory manager
+ p->vCutNodes = Vec_PtrAlloc( 1000 );
p->pMemCuts = Aig_MmFixedStart( p->pPars->nCutsMax * sizeof(Dar_Cut_t), 1024 );
- // other data
p->vLeavesBest = Vec_PtrAlloc( 4 );
return p;
}
@@ -69,11 +68,13 @@ void Dar_ManStop( Dar_Man_t * p )
{
if ( p->pPars->fVerbose )
Dar_ManPrintStats( p );
+ if ( p->vCutNodes )
+ Vec_PtrFree( p->vCutNodes );
if ( p->pMemCuts )
Aig_MmFixedStop( p->pMemCuts, 0 );
if ( p->vLeavesBest )
Vec_PtrFree( p->vLeavesBest );
- free( p );
+ ABC_FREE( p );
}
/**Function*************************************************************
@@ -102,10 +103,10 @@ void Dar_ManPrintStats( Dar_Man_t * p )
printf( "Bufs = %5d. BufMax = %5d. BufReplace = %6d. BufFix = %6d. Levels = %4d.\n",
Aig_ManBufNum(p->pAig), p->pAig->nBufMax, p->pAig->nBufReplaces, p->pAig->nBufFixes, Aig_ManLevels(p->pAig) );
- PRT( "Cuts ", p->timeCuts );
- PRT( "Eval ", p->timeEval );
- PRT( "Other ", p->timeOther );
- PRT( "TOTAL ", p->timeTotal );
+ ABC_PRT( "Cuts ", p->timeCuts );
+ ABC_PRT( "Eval ", p->timeEval );
+ ABC_PRT( "Other ", p->timeOther );
+ ABC_PRT( "TOTAL ", p->timeTotal );
if ( !p->pPars->fVeryVerbose )
return;
@@ -119,7 +120,7 @@ void Dar_ManPrintStats( Dar_Man_t * p )
printf( "S = %8d (%5.2f %%) ", p->ClassSubgs[i], p->nTotalSubgs? 100.0*p->ClassSubgs[i]/p->nTotalSubgs : 0.0 );
printf( "R = %7d ", p->ClassGains[i]? p->ClassSubgs[i]/p->ClassGains[i] : 9999999 );
// Kit_DsdPrintFromTruth( pCanons + i, 4 );
-// PRTP( "T", p->ClassTimes[i], p->timeEval );
+// ABC_PRTP( "T", p->ClassTimes[i], p->timeEval );
printf( "\n" );
}
fflush( stdout );
diff --git a/src/aig/dar/darPrec.c b/src/aig/dar/darPrec.c
index 8c3a4ce3..85a31dfc 100644
--- a/src/aig/dar/darPrec.c
+++ b/src/aig/dar/darPrec.c
@@ -45,7 +45,7 @@ char ** Dar_ArrayAlloc( int nCols, int nRows, int Size )
char * pBuffer;
int i;
assert( nCols > 0 && nRows > 0 && Size > 0 );
- pBuffer = ALLOC( char, nCols * (sizeof(void *) + nRows * Size) );
+ pBuffer = ABC_ALLOC( char, nCols * (sizeof(void *) + nRows * Size) );
pRes = (char **)pBuffer;
pRes[0] = pBuffer + nCols * sizeof(void *);
for ( i = 1; i < nCols; i++ )
@@ -130,8 +130,8 @@ void Dar_Permutations_rec( char ** pRes, int nFact, int n, char Array[] )
Description [The number of permutations in the array is n!. The number of
entries in each permutation is n. Therefore, the resulting array is a
- two-dimentional array of the size: n! x n. To free the resulting array,
- call free() on the pointer returned by this procedure.]
+ two-dimentional array of the size: n! x n. To ABC_FREE the resulting array,
+ call ABC_FREE() on the pointer returned by this procedure.]
SideEffects []
@@ -210,8 +210,8 @@ unsigned Dar_TruthPermute( unsigned Truth, char * pPerms, int nVars, int fRevers
assert( nVars < 6 );
nMints = (1 << nVars);
- pMints = ALLOC( int, nMints );
- pMintsP = ALLOC( int, nMints );
+ pMints = ABC_ALLOC( int, nMints );
+ pMintsP = ABC_ALLOC( int, nMints );
for ( i = 0; i < nMints; i++ )
pMints[i] = i;
@@ -231,8 +231,8 @@ unsigned Dar_TruthPermute( unsigned Truth, char * pPerms, int nVars, int fRevers
Result |= (1 << pMintsP[m]);
}
- free( pMints );
- free( pMintsP );
+ ABC_FREE( pMints );
+ ABC_FREE( pMintsP );
return Result;
}
@@ -297,10 +297,10 @@ void Dar_Truth4VarNPN( unsigned short ** puCanons, char ** puPhases, char ** puP
int i, k;
nFuncs = (1 << 16);
- uCanons = ALLOC( unsigned short, nFuncs );
- uPhases = ALLOC( char, nFuncs );
- uPerms = ALLOC( char, nFuncs );
- uMap = ALLOC( unsigned char, nFuncs );
+ uCanons = ABC_ALLOC( unsigned short, nFuncs );
+ uPhases = ABC_ALLOC( char, nFuncs );
+ uPerms = ABC_ALLOC( char, nFuncs );
+ uMap = ABC_ALLOC( unsigned char, nFuncs );
memset( uCanons, 0, sizeof(unsigned short) * nFuncs );
memset( uPhases, 0, sizeof(char) * nFuncs );
memset( uPerms, 0, sizeof(char) * nFuncs );
@@ -361,23 +361,23 @@ void Dar_Truth4VarNPN( unsigned short ** puCanons, char ** puPhases, char ** puP
}
uPhases[(1<<16)-1] = 16;
assert( nClasses == 222 );
- free( pPerms4 );
+ ABC_FREE( pPerms4 );
if ( puCanons )
*puCanons = uCanons;
else
- free( uCanons );
+ ABC_FREE( uCanons );
if ( puPhases )
*puPhases = uPhases;
else
- free( uPhases );
+ ABC_FREE( uPhases );
if ( puPerms )
*puPerms = uPerms;
else
- free( uPerms );
+ ABC_FREE( uPerms );
if ( puMap )
*puMap = uMap;
else
- free( uMap );
+ ABC_FREE( uMap );
}
////////////////////////////////////////////////////////////////////////
diff --git a/src/aig/dar/darRefact.c b/src/aig/dar/darRefact.c
index ecf032be..f0173a3c 100644
--- a/src/aig/dar/darRefact.c
+++ b/src/aig/dar/darRefact.c
@@ -106,7 +106,7 @@ Ref_Man_t * Dar_ManRefStart( Aig_Man_t * pAig, Dar_RefPar_t * pPars )
{
Ref_Man_t * p;
// start the manager
- p = ALLOC( Ref_Man_t, 1 );
+ p = ABC_ALLOC( Ref_Man_t, 1 );
memset( p, 0, sizeof(Ref_Man_t) );
p->pAig = pAig;
p->pPars = pPars;
@@ -143,10 +143,10 @@ void Dar_ManRefPrintStats( Ref_Man_t * p )
p->nNodesInit, Aig_ManNodeNum(p->pAig), Gain, 100.0*Gain/p->nNodesInit );
printf( "Tried = %6d. Below = %5d. Extended = %5d. Used = %5d. Levels = %4d.\n",
p->nNodesTried, p->nNodesBelow, p->nNodesExten, p->nCutsUsed, Aig_ManLevels(p->pAig) );
- PRT( "Cuts ", p->timeCuts );
- PRT( "Eval ", p->timeEval );
- PRT( "Other ", p->timeOther );
- PRT( "TOTAL ", p->timeTotal );
+ ABC_PRT( "Cuts ", p->timeCuts );
+ ABC_PRT( "Eval ", p->timeEval );
+ ABC_PRT( "Other ", p->timeOther );
+ ABC_PRT( "TOTAL ", p->timeTotal );
}
/**Function*************************************************************
@@ -172,7 +172,7 @@ void Dar_ManRefStop( Ref_Man_t * p )
Vec_PtrFree( p->vLeavesBest );
Vec_IntFree( p->vMemory );
Vec_PtrFree( p->vCutNodes );
- free( p );
+ ABC_FREE( p );
}
/**Function*************************************************************
diff --git a/src/aig/dar/darScript.c b/src/aig/dar/darScript.c
index 6df776e6..383b5b6b 100644
--- a/src/aig/dar/darScript.c
+++ b/src/aig/dar/darScript.c
@@ -401,7 +401,7 @@ clk = clock();
if ( fVerbose )
{
-PRT( "Synthesis time", clock() - clk );
+ABC_PRT( "Synthesis time", clock() - clk );
}
clk = clock();
if ( fConstruct )
@@ -413,7 +413,7 @@ clk = clock();
Vec_PtrFree( vAigs );
if ( fVerbose )
{
-PRT( "Choicing time ", clock() - clk );
+ABC_PRT( "Choicing time ", clock() - clk );
}
return pMan;
// return NULL;
@@ -458,7 +458,7 @@ clk = clock();
if ( fVerbose )
{
-PRT( "Synthesis time", clock() - clk );
+ABC_PRT( "Synthesis time", clock() - clk );
}
// pPars->timeSynth = clock() - clk;
@@ -493,7 +493,7 @@ clk = clock();
if ( fVerbose )
{
-//PRT( "Choicing time ", clock() - clk );
+//ABC_PRT( "Choicing time ", clock() - clk );
}
return pMan;
// return NULL;