diff options
Diffstat (limited to 'src/map/super')
-rw-r--r-- | src/map/super/super.c | 50 | ||||
-rw-r--r-- | src/map/super/super.h | 15 | ||||
-rw-r--r-- | src/map/super/superAnd.c | 12 | ||||
-rw-r--r-- | src/map/super/superGENERIC.c | 2 | ||||
-rw-r--r-- | src/map/super/superGate.c | 4 | ||||
-rw-r--r-- | src/map/super/superInt.h | 8 | ||||
-rw-r--r-- | src/map/super/superWrite.c | 2 |
7 files changed, 51 insertions, 42 deletions
diff --git a/src/map/super/super.c b/src/map/super/super.c index ffb432d5..97420c5c 100644 --- a/src/map/super/super.c +++ b/src/map/super/super.c @@ -28,7 +28,7 @@ static int Super_CommandSupergates ( Abc_Frame_t * pAbc, int argc, char **argv static int Super_CommandSupergatesAnd( Abc_Frame_t * pAbc, int argc, char **argv ); //////////////////////////////////////////////////////////////////////// -/// FUNCTION DEFITIONS /// +/// FUNCTION DEFINITIONS /// //////////////////////////////////////////////////////////////////////// /**Function************************************************************* @@ -90,20 +90,20 @@ int Super_CommandSupergatesAnd( Abc_Frame_t * pAbc, int argc, char **argv ) nVarsMax = 4; nLevels = 3; fVerbose = 0; - util_getopt_reset(); - while ( (c = util_getopt(argc, argv, "ilvh")) != EOF ) + Extra_UtilGetoptReset(); + while ( (c = Extra_UtilGetopt(argc, argv, "ilvh")) != EOF ) { switch (c) { case 'i': - nVarsMax = atoi(argv[util_optind]); - util_optind++; + nVarsMax = atoi(argv[globalUtilOptind]); + globalUtilOptind++; if ( nVarsMax < 0 ) goto usage; break; case 'l': - nLevels = atoi(argv[util_optind]); - util_optind++; + nLevels = atoi(argv[globalUtilOptind]); + globalUtilOptind++; if ( nLevels < 0 ) goto usage; break; @@ -172,44 +172,44 @@ int Super_CommandSupergates( Abc_Frame_t * pAbc, int argc, char **argv ) fWriteOldFormat = 0; ExcludeFile = 0; - util_getopt_reset(); - while ( (c = util_getopt(argc, argv, "eiltdasovh")) != EOF ) + Extra_UtilGetoptReset(); + while ( (c = Extra_UtilGetopt(argc, argv, "eiltdasovh")) != EOF ) { switch (c) { case 'e': - ExcludeFile = argv[util_optind]; + ExcludeFile = argv[globalUtilOptind]; if ( ExcludeFile == 0 ) goto usage; - util_optind++; + globalUtilOptind++; break; case 'i': - nVarsMax = atoi(argv[util_optind]); - util_optind++; + nVarsMax = atoi(argv[globalUtilOptind]); + globalUtilOptind++; if ( nVarsMax < 0 ) goto usage; break; case 'l': - nLevels = atoi(argv[util_optind]); - util_optind++; + nLevels = atoi(argv[globalUtilOptind]); + globalUtilOptind++; if ( nLevels < 0 ) goto usage; break; case 't': - TimeLimit = atoi(argv[util_optind]); - util_optind++; + TimeLimit = atoi(argv[globalUtilOptind]); + globalUtilOptind++; if ( TimeLimit < 0 ) goto usage; break; case 'd': - DelayLimit = (float)atof(argv[util_optind]); - util_optind++; + DelayLimit = (float)atof(argv[globalUtilOptind]); + globalUtilOptind++; if ( DelayLimit <= 0.0 ) goto usage; break; case 'a': - AreaLimit = (float)atof(argv[util_optind]); - util_optind++; + AreaLimit = (float)atof(argv[globalUtilOptind]); + globalUtilOptind++; if ( AreaLimit <= 0.0 ) goto usage; break; @@ -231,7 +231,7 @@ int Super_CommandSupergates( Abc_Frame_t * pAbc, int argc, char **argv ) } - if ( argc != util_optind + 1 ) + if ( argc != globalUtilOptind + 1 ) { fprintf( pErr, "The GENLIB library file should be given on the command line.\n" ); goto usage; @@ -244,9 +244,9 @@ int Super_CommandSupergates( Abc_Frame_t * pAbc, int argc, char **argv ) } // get the input file name - FileName = argv[util_optind]; -// if ( (pFile = Io_FileOpen( FileName, "open_path", "r" )) == NULL ) - if ( (pFile = fopen( FileName, "r" )) == NULL ) + FileName = argv[globalUtilOptind]; + if ( (pFile = Io_FileOpen( FileName, "open_path", "r", 0 )) == NULL ) +// if ( (pFile = fopen( FileName, "r" )) == NULL ) { fprintf( pErr, "Cannot open input file \"%s\". ", FileName ); if (( FileName = Extra_FileGetSimilarName( FileName, ".genlib", ".lib", ".gen", ".g", NULL ) )) diff --git a/src/map/super/super.h b/src/map/super/super.h index ce2b7433..a7169924 100644 --- a/src/map/super/super.h +++ b/src/map/super/super.h @@ -19,6 +19,10 @@ #ifndef __SUPER_H__ #define __SUPER_H__ +#ifdef __cplusplus +extern "C" { +#endif + //////////////////////////////////////////////////////////////////////// /// INCLUDES /// //////////////////////////////////////////////////////////////////////// @@ -36,16 +40,21 @@ //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// -/// MACRO DEFITIONS /// +/// MACRO DEFINITIONS /// //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// -/// FUNCTION DEFITIONS /// +/// FUNCTION DEFINITIONS /// //////////////////////////////////////////////////////////////////////// /*=== superCore.c =============================================================*/ + +#ifdef __cplusplus +} +#endif + +#endif //////////////////////////////////////////////////////////////////////// /// END OF FILE /// //////////////////////////////////////////////////////////////////////// -#endif diff --git a/src/map/super/superAnd.c b/src/map/super/superAnd.c index e90fc76d..52473fba 100644 --- a/src/map/super/superAnd.c +++ b/src/map/super/superAnd.c @@ -61,10 +61,10 @@ struct Super2_GateStruct_t_ // manipulation of complemented attributes -#define Super2_IsComplement(p) (((int)((long) (p) & 01))) -#define Super2_Regular(p) ((Super2_Gate_t *)((unsigned)(p) & ~01)) -#define Super2_Not(p) ((Super2_Gate_t *)((long)(p) ^ 01)) -#define Super2_NotCond(p,c) ((Super2_Gate_t *)((long)(p) ^ (c))) +#define Super2_IsComplement(p) (((int)((unsigned long) (p) & 01))) +#define Super2_Regular(p) ((Super2_Gate_t *)((unsigned long)(p) & ~01)) +#define Super2_Not(p) ((Super2_Gate_t *)((unsigned long)(p) ^ 01)) +#define Super2_NotCond(p,c) ((Super2_Gate_t *)((unsigned long)(p) ^ (c))) // iterating through the gates in the library #define Super2_LibForEachGate( Lib, Gate ) \ @@ -93,7 +93,7 @@ static int Super2_LibWriteCompare( char * pStr1, char * pStr2 ); static int Super2_LibCompareGates( Super2_Gate_t ** ppG1, Super2_Gate_t ** ppG2 ); //////////////////////////////////////////////////////////////////////// -/// FUNCTION DEFITIONS /// +/// FUNCTION DEFINITIONS /// //////////////////////////////////////////////////////////////////////// /**Function************************************************************* @@ -183,7 +183,7 @@ Super2_Man_t * Super2_ManStart() ***********************************************************************/ void Super2_ManStop( Super2_Man_t * pMan ) { - Extra_MmFixedStop( pMan->pMem, 0 ); + Extra_MmFixedStop( pMan->pMem ); stmm_free_table( pMan->tTable ); free( pMan ); } diff --git a/src/map/super/superGENERIC.c b/src/map/super/superGENERIC.c index 4c7b67ca..1f2b7651 100644 --- a/src/map/super/superGENERIC.c +++ b/src/map/super/superGENERIC.c @@ -23,7 +23,7 @@ //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// -/// FUNCTION DEFITIONS /// +/// FUNCTION DEFINITIONS /// //////////////////////////////////////////////////////////////////////// /**Function************************************************************* diff --git a/src/map/super/superGate.c b/src/map/super/superGate.c index d0cd0ad7..91a1e513 100644 --- a/src/map/super/superGate.c +++ b/src/map/super/superGate.c @@ -120,7 +120,7 @@ static void Super_WriteLibraryTree( Super_Man_t * pMan ); static void Super_WriteLibraryTree_rec( FILE * pFile, Super_Man_t * pMan, Super_Gate_t * pSuper, int * pCounter ); //////////////////////////////////////////////////////////////////////// -/// FUNCTION DEFITIONS /// +/// FUNCTION DEFINITIONS /// //////////////////////////////////////////////////////////////////////// /**Function************************************************************* @@ -886,7 +886,7 @@ Super_Man_t * Super_ManStart() ***********************************************************************/ void Super_ManStop( Super_Man_t * pMan ) { - Extra_MmFixedStop( pMan->pMem, 0 ); + Extra_MmFixedStop( pMan->pMem ); if ( pMan->tTable ) stmm_free_table( pMan->tTable ); FREE( pMan->pGates ); free( pMan ); diff --git a/src/map/super/superInt.h b/src/map/super/superInt.h index 686c8739..ec6d0a38 100644 --- a/src/map/super/superInt.h +++ b/src/map/super/superInt.h @@ -43,11 +43,11 @@ //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// -/// MACRO DEFITIONS /// +/// MACRO DEFINITIONS /// //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// -/// FUNCTION DEFITIONS /// +/// FUNCTION DEFINITIONS /// //////////////////////////////////////////////////////////////////////// /*=== superAnd.c =============================================================*/ @@ -55,8 +55,8 @@ 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 ); +#endif + //////////////////////////////////////////////////////////////////////// /// END OF FILE /// //////////////////////////////////////////////////////////////////////// - -#endif diff --git a/src/map/super/superWrite.c b/src/map/super/superWrite.c index a0e85604..395ef145 100644 --- a/src/map/super/superWrite.c +++ b/src/map/super/superWrite.c @@ -53,7 +53,7 @@ //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// -/// FUNCTION DEFITIONS /// +/// FUNCTION DEFINITIONS /// //////////////////////////////////////////////////////////////////////// /**Function************************************************************* |