summaryrefslogtreecommitdiffstats
path: root/src/opt/cut
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2009-02-15 08:01:00 -0800
committerAlan Mishchenko <alanmi@berkeley.edu>2009-02-15 08:01:00 -0800
commit0871bffae307e0553e0c5186336189e8b55cf6a6 (patch)
tree4571d1563fe33a53a57fea1c35fb668b9d33265f /src/opt/cut
parentf936cc0680c98ffe51b3a1716c996072d5dbf76c (diff)
downloadabc-0871bffae307e0553e0c5186336189e8b55cf6a6.tar.gz
abc-0871bffae307e0553e0c5186336189e8b55cf6a6.tar.bz2
abc-0871bffae307e0553e0c5186336189e8b55cf6a6.zip
Version abc90215
Diffstat (limited to 'src/opt/cut')
-rw-r--r--src/opt/cut/cut.h8
-rw-r--r--src/opt/cut/cutMan.c18
-rw-r--r--src/opt/cut/cutOracle.c6
-rw-r--r--src/opt/cut/cutPre22.c20
4 files changed, 26 insertions, 26 deletions
diff --git a/src/opt/cut/cut.h b/src/opt/cut/cut.h
index faa249f2..394138db 100644
--- a/src/opt/cut/cut.h
+++ b/src/opt/cut/cut.h
@@ -21,10 +21,6 @@
#ifndef __CUT_H__
#define __CUT_H__
-#ifdef __cplusplus
-extern "C" {
-#endif
-
////////////////////////////////////////////////////////////////////////
/// INCLUDES ///
////////////////////////////////////////////////////////////////////////
@@ -33,6 +29,10 @@ extern "C" {
/// PARAMETERS ///
////////////////////////////////////////////////////////////////////////
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#define CUT_SIZE_MIN 3 // the min K of the K-feasible cut computation
#define CUT_SIZE_MAX 12 // the max K of the K-feasible cut computation
diff --git a/src/opt/cut/cutMan.c b/src/opt/cut/cutMan.c
index 882567fd..28264e33 100644
--- a/src/opt/cut/cutMan.c
+++ b/src/opt/cut/cutMan.c
@@ -47,7 +47,7 @@ Cut_Man_t * Cut_ManStart( Cut_Params_t * pParams )
// extern int nTruthDsd;
// nTruthDsd = 0;
assert( pParams->nVarsMax >= 3 && pParams->nVarsMax <= CUT_SIZE_MAX );
- p = ALLOC( Cut_Man_t, 1 );
+ p = ABC_ALLOC( Cut_Man_t, 1 );
memset( p, 0, sizeof(Cut_Man_t) );
// set and correct parameters
p->pParams = pParams;
@@ -82,7 +82,7 @@ Cut_Man_t * Cut_ManStart( Cut_Params_t * pParams )
p->nTruthWords = Cut_TruthWords( pParams->nVarsMax );
p->EntrySize += p->nTruthWords * sizeof(unsigned);
}
- p->puTemp[0] = ALLOC( unsigned, 4 * p->nTruthWords );
+ p->puTemp[0] = ABC_ALLOC( unsigned, 4 * p->nTruthWords );
p->puTemp[1] = p->puTemp[0] + p->nTruthWords;
p->puTemp[2] = p->puTemp[1] + p->nTruthWords;
p->puTemp[3] = p->puTemp[2] + p->nTruthWords;
@@ -132,10 +132,10 @@ void Cut_ManStop( Cut_Man_t * p )
if ( p->vNodeCuts ) Vec_IntFree( p->vNodeCuts );
if ( p->vNodeStarts ) Vec_IntFree( p->vNodeStarts );
if ( p->vCutPairs ) Vec_IntFree( p->vCutPairs );
- if ( p->puTemp[0] ) free( p->puTemp[0] );
+ if ( p->puTemp[0] ) ABC_FREE( p->puTemp[0] );
Extra_MmFixedStop( p->pMmCuts );
- free( p );
+ ABC_FREE( p );
}
/**Function*************************************************************
@@ -176,11 +176,11 @@ void Cut_ManPrintStats( Cut_Man_t * p )
if ( p->pParams->fMap && !p->pParams->fSeq )
printf( "Mapping delay = %8d.\n", p->nDelayMin );
- PRT( "Merge ", p->timeMerge );
- PRT( "Union ", p->timeUnion );
- PRT( "Filter", p->timeFilter );
- PRT( "Truth ", p->timeTruth );
- PRT( "Map ", p->timeMap );
+ ABC_PRT( "Merge ", p->timeMerge );
+ ABC_PRT( "Union ", p->timeUnion );
+ ABC_PRT( "Filter", p->timeFilter );
+ ABC_PRT( "Truth ", p->timeTruth );
+ ABC_PRT( "Map ", p->timeMap );
// printf( "Nodes = %d. Multi = %d. Cuts = %d. Multi = %d.\n",
// p->nNodes, p->nNodesMulti, p->nCutsCur-p->nCutsTriv, p->nCutsMulti );
// printf( "Count0 = %d. Count1 = %d. Count2 = %d.\n\n", p->Count0, p->Count1, p->Count2 );
diff --git a/src/opt/cut/cutOracle.c b/src/opt/cut/cutOracle.c
index 4ec6bc05..32798f4f 100644
--- a/src/opt/cut/cutOracle.c
+++ b/src/opt/cut/cutOracle.c
@@ -74,7 +74,7 @@ Cut_Oracle_t * Cut_OracleStart( Cut_Man_t * pMan )
assert( pMan->pParams->nVarsMax >= 3 && pMan->pParams->nVarsMax <= CUT_SIZE_MAX );
assert( pMan->pParams->fRecord );
- p = ALLOC( Cut_Oracle_t, 1 );
+ p = ABC_ALLOC( Cut_Oracle_t, 1 );
memset( p, 0, sizeof(Cut_Oracle_t) );
// set and correct parameters
@@ -130,7 +130,7 @@ void Cut_OracleStop( Cut_Oracle_t * p )
{
printf( "Cut computation statistics with oracle:\n" );
printf( "Current cuts = %8d. (Trivial = %d.)\n", p->nCuts-p->nCutsTriv, p->nCutsTriv );
- PRT( "Total time ", p->timeTotal );
+ ABC_PRT( "Total time ", p->timeTotal );
}
Vec_PtrForEachEntry( p->vCutsNew, pCut, i )
@@ -145,7 +145,7 @@ void Cut_OracleStop( Cut_Oracle_t * p )
if ( p->vCutPairs ) Vec_IntFree( p->vCutPairs );
Extra_MmFixedStop( p->pMmCuts );
- free( p );
+ ABC_FREE( p );
}
/**Function*************************************************************
diff --git a/src/opt/cut/cutPre22.c b/src/opt/cut/cutPre22.c
index 5ba860c9..bda612f7 100644
--- a/src/opt/cut/cutPre22.c
+++ b/src/opt/cut/cutPre22.c
@@ -398,7 +398,7 @@ void Cut_CellPrecompute()
}
printf( "BASIC: Total = %d. Good = %d. Entry = %d. ", (int)p->nTotal, (int)p->nGood, (int)sizeof(Cut_Cell_t) );
- PRT( "Time", clock() - clk );
+ ABC_PRT( "Time", clock() - clk );
printf( "Cells: " );
for ( i = 0; i <= 9; i++ )
printf( "%d=%d ", i, p->nVarCounts[i] );
@@ -482,7 +482,7 @@ void Cut_CellPrecompute()
}
printf( "VAR %d: Total = %d. Good = %d. Entry = %d. ", k, p->nTotal, p->nGood, (int)sizeof(Cut_Cell_t) );
- PRT( "Time", clock() - clk );
+ ABC_PRT( "Time", clock() - clk );
printf( "Cells: " );
for ( i = 0; i <= 9; i++ )
printf( "%d=%d ", i, p->nVarCounts[i] );
@@ -495,9 +495,9 @@ void Cut_CellPrecompute()
printf( "\n" );
}
// printf( "\n" );
- PRT( "Supp ", p->timeSupp );
- PRT( "Canon", p->timeCanon );
- PRT( "Table", p->timeTable );
+ ABC_PRT( "Supp ", p->timeSupp );
+ ABC_PRT( "Canon", p->timeCanon );
+ ABC_PRT( "Table", p->timeTable );
// Cut_CManStop( p );
}
@@ -517,7 +517,7 @@ int Cut_CellTableLookup( Cut_CMan_t * p, Cut_Cell_t * pCell )
Cut_Cell_t ** pSlot, * pTemp;
unsigned Hash;
Hash = Extra_TruthHash( pCell->uTruth, Extra_TruthWordNum( pCell->nVars ) );
- if ( !st_find_or_add( p->tTable, (char *)(PORT_PTRUINT_T)Hash, (char ***)&pSlot ) )
+ if ( !st_find_or_add( p->tTable, (char *)(ABC_PTRUINT_T)Hash, (char ***)&pSlot ) )
*pSlot = NULL;
for ( pTemp = *pSlot; pTemp; pTemp = pTemp->pNext )
{
@@ -770,7 +770,7 @@ Cut_CMan_t * Cut_CManStart()
int i, k;
// start the manager
assert( sizeof(unsigned) == 4 );
- p = ALLOC( Cut_CMan_t, 1 );
+ p = ABC_ALLOC( Cut_CMan_t, 1 );
memset( p, 0, sizeof(Cut_CMan_t) );
// start the table and the memory manager
p->tTable = st_init_table(st_ptrcmp,st_ptrhash);
@@ -799,7 +799,7 @@ void Cut_CManStop( Cut_CMan_t * p )
{
st_free_table( p->tTable );
Extra_MmFixedStop( p->pMem );
- free( p );
+ ABC_FREE( p );
}
/**Function*************************************************************
@@ -916,7 +916,7 @@ void Cut_CellDumpToFile()
printf( "Library composed of %d functions is written into file \"%s\". ", Counter, pFileName );
- PRT( "Time", clock() - clk );
+ ABC_PRT( "Time", clock() - clk );
}
@@ -962,7 +962,7 @@ int Cut_CellTruthLookup( unsigned * pTruth, int nVars )
// check if the cell exists
Hash = Extra_TruthHash( pCell->uTruth, Extra_TruthWordNum(pCell->nVars) );
- if ( st_lookup( p->tTable, (char *)(PORT_PTRUINT_T)Hash, (char **)&pTemp ) )
+ if ( st_lookup( p->tTable, (char *)(ABC_PTRUINT_T)Hash, (char **)&pTemp ) )
{
for ( ; pTemp; pTemp = pTemp->pNext )
{