diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2010-11-01 01:35:04 -0700 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2010-11-01 01:35:04 -0700 |
commit | 6130e39b18b5f53902e4eab14f6d5cdde5219563 (patch) | |
tree | 0db0628479a1b750e9af1f66cb8379ebd0913d31 /src/map/super | |
parent | f0e77f6797c0504b0da25a56152b707d3357f386 (diff) | |
download | abc-6130e39b18b5f53902e4eab14f6d5cdde5219563.tar.gz abc-6130e39b18b5f53902e4eab14f6d5cdde5219563.tar.bz2 abc-6130e39b18b5f53902e4eab14f6d5cdde5219563.zip |
initial commit of public abc
Diffstat (limited to 'src/map/super')
-rw-r--r-- | src/map/super/super.c | 11 | ||||
-rw-r--r-- | src/map/super/super.h | 16 | ||||
-rw-r--r-- | src/map/super/superAnd.c | 5 | ||||
-rw-r--r-- | src/map/super/superGENERIC.c | 5 | ||||
-rw-r--r-- | src/map/super/superGate.c | 18 | ||||
-rw-r--r-- | src/map/super/superInt.h | 10 | ||||
-rw-r--r-- | src/map/super/superWrite.c | 5 |
7 files changed, 54 insertions, 16 deletions
diff --git a/src/map/super/super.c b/src/map/super/super.c index 97420c5c..6483547e 100644 --- a/src/map/super/super.c +++ b/src/map/super/super.c @@ -20,6 +20,9 @@ #include "mainInt.h" #include "mio.h" +ABC_NAMESPACE_IMPL_START + + //////////////////////////////////////////////////////////////////////// /// DECLARATIONS /// //////////////////////////////////////////////////////////////////////// @@ -59,7 +62,7 @@ void Super_Init( Abc_Frame_t * pAbc ) SeeAlso [] ***********************************************************************/ -void Super_End() +void Super_End( Abc_Frame_t * pAbc ) { } @@ -152,8 +155,8 @@ int Super_CommandSupergates( Abc_Frame_t * pAbc, int argc, char **argv ) char * FileName, * ExcludeFile; float DelayLimit; float AreaLimit; - bool fSkipInvs; - bool fWriteOldFormat; + int fSkipInvs; + int fWriteOldFormat; int nVarsMax, nLevels, TimeLimit; int fVerbose; int c; @@ -317,3 +320,5 @@ usage: //////////////////////////////////////////////////////////////////////// +ABC_NAMESPACE_IMPL_END + diff --git a/src/map/super/super.h b/src/map/super/super.h index 9f5e83ae..246ea092 100644 --- a/src/map/super/super.h +++ b/src/map/super/super.h @@ -19,6 +19,7 @@ #ifndef __SUPER_H__ #define __SUPER_H__ + //////////////////////////////////////////////////////////////////////// /// INCLUDES /// //////////////////////////////////////////////////////////////////////// @@ -27,9 +28,10 @@ /// PARAMETERS /// //////////////////////////////////////////////////////////////////////// -#ifdef __cplusplus -extern "C" { -#endif + + +ABC_NAMESPACE_HEADER_START + //////////////////////////////////////////////////////////////////////// /// STRUCTURE DEFINITIONS /// @@ -49,9 +51,11 @@ extern "C" { /*=== superCore.c =============================================================*/ -#ifdef __cplusplus -} -#endif + + +ABC_NAMESPACE_HEADER_END + + #endif diff --git a/src/map/super/superAnd.c b/src/map/super/superAnd.c index 3014d505..17ba9771 100644 --- a/src/map/super/superAnd.c +++ b/src/map/super/superAnd.c @@ -18,6 +18,9 @@ #include "superInt.h" +ABC_NAMESPACE_IMPL_START + + //////////////////////////////////////////////////////////////////////// /// DECLARATIONS /// //////////////////////////////////////////////////////////////////////// @@ -694,3 +697,5 @@ int Super2_LibWriteCompare( char * pStr1, char * pStr2 ) //////////////////////////////////////////////////////////////////////// +ABC_NAMESPACE_IMPL_END + diff --git a/src/map/super/superGENERIC.c b/src/map/super/superGENERIC.c index 1f2b7651..9d1f4cf0 100644 --- a/src/map/super/superGENERIC.c +++ b/src/map/super/superGENERIC.c @@ -18,6 +18,9 @@ #include "superInt.h" +ABC_NAMESPACE_IMPL_START + + //////////////////////////////////////////////////////////////////////// /// DECLARATIONS /// //////////////////////////////////////////////////////////////////////// @@ -44,3 +47,5 @@ //////////////////////////////////////////////////////////////////////// +ABC_NAMESPACE_IMPL_END + diff --git a/src/map/super/superGate.c b/src/map/super/superGate.c index 6ffab984..a1962b09 100644 --- a/src/map/super/superGate.c +++ b/src/map/super/superGate.c @@ -16,8 +16,12 @@ ***********************************************************************/ +#include <math.h> #include "superInt.h" +ABC_NAMESPACE_IMPL_START + + //////////////////////////////////////////////////////////////////////// /// DECLARATIONS /// //////////////////////////////////////////////////////////////////////// @@ -99,9 +103,9 @@ static void Super_ManStop( Super_Man_t * pMan ); static void Super_AddGateToTable( Super_Man_t * pMan, Super_Gate_t * pGate ); static void Super_First( Super_Man_t * pMan, int nVarsMax ); -static Super_Man_t * Super_Compute( Super_Man_t * pMan, Mio_Gate_t ** ppGates, int nGates, bool fSkipInv ); +static Super_Man_t * Super_Compute( Super_Man_t * pMan, Mio_Gate_t ** ppGates, int nGates, int fSkipInv ); static Super_Gate_t * Super_CreateGateNew( Super_Man_t * pMan, Mio_Gate_t * pRoot, Super_Gate_t ** pSupers, int nSupers, unsigned uTruth[], float Area, float tPinDelaysRes[], float tDelayMax, int nPins ); -static bool Super_CompareGates( Super_Man_t * pMan, unsigned uTruth[], float Area, float tPinDelaysRes[], int nPins ); +static int Super_CompareGates( Super_Man_t * pMan, unsigned uTruth[], float Area, float tPinDelaysRes[], int nPins ); static int Super_DelayCompare( Super_Gate_t ** ppG1, Super_Gate_t ** ppG2 ); static int Super_AreaCompare( Super_Gate_t ** ppG1, Super_Gate_t ** ppG2 ); static void Super_TranferGatesToArray( Super_Man_t * pMan ); @@ -134,7 +138,7 @@ static void Super_WriteLibraryTree_rec( FILE * pFile, Super_Man_t * pM SeeAlso [] ***********************************************************************/ -void Super_Precompute( Mio_Library_t * pLibGen, int nVarsMax, int nLevels, float tDelayMax, float tAreaMax, int TimeLimit, bool fSkipInv, bool fWriteOldFormat, int fVerbose ) +void Super_Precompute( Mio_Library_t * pLibGen, int nVarsMax, int nLevels, float tDelayMax, float tAreaMax, int TimeLimit, int fSkipInv, int fWriteOldFormat, int fVerbose ) { Super_Man_t * pMan; Mio_Gate_t ** ppGates; @@ -291,7 +295,7 @@ void Super_First( Super_Man_t * pMan, int nVarsMax ) SeeAlso [] ***********************************************************************/ -Super_Man_t * Super_Compute( Super_Man_t * pMan, Mio_Gate_t ** ppGates, int nGates, bool fSkipInv ) +Super_Man_t * Super_Compute( Super_Man_t * pMan, Mio_Gate_t ** ppGates, int nGates, int fSkipInv ) { Super_Gate_t * pSupers[6], * pGate0, * pGate1, * pGate2, * pGate3, * pGate4, * pGate5, * pGateNew; float tPinDelaysRes[6], * ptPinDelays[6], tPinDelayMax, tDelayMio; @@ -757,7 +761,7 @@ void Super_AddGateToTable( Super_Man_t * pMan, Super_Gate_t * pGate ) SeeAlso [] ***********************************************************************/ -bool Super_CompareGates( Super_Man_t * pMan, unsigned uTruth[], float Area, float tPinDelaysRes[], int nPins ) +int Super_CompareGates( Super_Man_t * pMan, unsigned uTruth[], float Area, float tPinDelaysRes[], int nPins ) { Super_Gate_t ** ppList, * pPrev, * pGate, * pGate2; int i, fNewIsBetter, fGateIsBetter; @@ -1012,7 +1016,7 @@ void Super_WriteFileHeader( Super_Man_t * pMan, FILE * pFile ) fprintf( pFile, "# The number of attempts = %10d.\n", pMan->nTried ); fprintf( pFile, "# The number of supergates = %10d.\n", pMan->nGates ); fprintf( pFile, "# The number of functions = %10d.\n", pMan->nUnique ); - fprintf( pFile, "# The total functions = %.0f (2^%d).\n", pow(2,pMan->nMints), pMan->nMints ); + fprintf( pFile, "# The total functions = %.0f (2^%d).\n", pow((double)2,pMan->nMints), pMan->nMints ); fprintf( pFile, "#\n" ); fprintf( pFile, "# Generation time (sec) = %10.2f.\n", (float)(pMan->Time)/(float)(CLOCKS_PER_SEC) ); fprintf( pFile, "#\n" ); @@ -1336,3 +1340,5 @@ void Super_WriteLibraryTree_rec( FILE * pFile, Super_Man_t * pMan, Super_Gate_t /// END OF FILE /// //////////////////////////////////////////////////////////////////////// +ABC_NAMESPACE_IMPL_END + diff --git a/src/map/super/superInt.h b/src/map/super/superInt.h index ec6d0a38..0d4215ff 100644 --- a/src/map/super/superInt.h +++ b/src/map/super/superInt.h @@ -19,6 +19,7 @@ #ifndef __super_INT_H__ #define __super_INT_H__ + //////////////////////////////////////////////////////////////////////// /// INCLUDES /// //////////////////////////////////////////////////////////////////////// @@ -30,6 +31,9 @@ #include "stmm.h" #include "super.h" +ABC_NAMESPACE_HEADER_START + + //////////////////////////////////////////////////////////////////////// /// PARAMETERS /// //////////////////////////////////////////////////////////////////////// @@ -53,7 +57,11 @@ /*=== superAnd.c =============================================================*/ extern void Super2_Precompute( int nInputs, int nLevels, int fVerbose ); /*=== superGate.c =============================================================*/ -extern void Super_Precompute( Mio_Library_t * pLibGen, int nInputs, int nLevels, float tDelayMax, float tAreaMax, int TimeLimit, bool fSkipInv, bool fWriteOldFormat, int fVerbose ); +extern void Super_Precompute( Mio_Library_t * pLibGen, int nInputs, int nLevels, float tDelayMax, float tAreaMax, int TimeLimit, int fSkipInv, int fWriteOldFormat, int fVerbose ); + + + +ABC_NAMESPACE_HEADER_END #endif diff --git a/src/map/super/superWrite.c b/src/map/super/superWrite.c index 395ef145..b8d14837 100644 --- a/src/map/super/superWrite.c +++ b/src/map/super/superWrite.c @@ -18,6 +18,9 @@ #include "superInt.h" +ABC_NAMESPACE_IMPL_START + + /* One record in the supergate library file consists of: @@ -74,3 +77,5 @@ //////////////////////////////////////////////////////////////////////// +ABC_NAMESPACE_IMPL_END + |