summaryrefslogtreecommitdiffstats
path: root/src/map/mapper
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2008-07-02 08:01:00 -0700
committerAlan Mishchenko <alanmi@berkeley.edu>2008-07-02 08:01:00 -0700
commit303baf27cf34c2a57db97c4c567fd744241fa14b (patch)
treed6235cca48e7bdfe5884e517058c7791e66bb806 /src/map/mapper
parentfa67e3c19e27c011517b91182eb3929412aaf402 (diff)
downloadabc-303baf27cf34c2a57db97c4c567fd744241fa14b.tar.gz
abc-303baf27cf34c2a57db97c4c567fd744241fa14b.tar.bz2
abc-303baf27cf34c2a57db97c4c567fd744241fa14b.zip
Version abc80702
Diffstat (limited to 'src/map/mapper')
-rw-r--r--src/map/mapper/mapper.c2
-rw-r--r--src/map/mapper/mapperCanon.c5
-rw-r--r--src/map/mapper/mapperCreate.c2
-rw-r--r--src/map/mapper/mapperCut.c16
-rw-r--r--src/map/mapper/mapperCutUtils.c3
-rw-r--r--src/map/mapper/mapperLib.c5
-rw-r--r--src/map/mapper/mapperMatch.c3
-rw-r--r--src/map/mapper/mapperSuper.c5
-rw-r--r--src/map/mapper/mapperTable.c2
-rw-r--r--src/map/mapper/mapperTree.c2
-rw-r--r--src/map/mapper/mapperTruth.c2
-rw-r--r--src/map/mapper/mapperUtils.c1
12 files changed, 28 insertions, 20 deletions
diff --git a/src/map/mapper/mapper.c b/src/map/mapper/mapper.c
index b18b68c0..37052100 100644
--- a/src/map/mapper/mapper.c
+++ b/src/map/mapper/mapper.c
@@ -132,7 +132,7 @@ int Map_CommandReadLibrary( Abc_Frame_t * pAbc, int argc, char **argv )
// if ( (pFile = fopen( FileName, "r" )) == NULL )
{
fprintf( pErr, "Cannot open input file \"%s\". ", FileName );
- if ( FileName = Extra_FileGetSimilarName( FileName, ".genlib", ".lib", ".gen", ".g", NULL ) )
+ if (( FileName = Extra_FileGetSimilarName( FileName, ".genlib", ".lib", ".gen", ".g", NULL )) )
fprintf( pErr, "Did you mean \"%s\"?", FileName );
fprintf( pErr, "\n" );
return 1;
diff --git a/src/map/mapper/mapperCanon.c b/src/map/mapper/mapperCanon.c
index 203c9142..4f93ad3b 100644
--- a/src/map/mapper/mapperCanon.c
+++ b/src/map/mapper/mapperCanon.c
@@ -76,7 +76,7 @@ int Map_CanonComputeSlow( unsigned uTruths[][2], int nVarsMax, int nVarsReal, un
for ( m = 0; m < nMints; m++ )
{
Map_CanonComputePhase6( uTruths, nVarsMax, uTruth, m, uTruthPerm );
- if ( uTruthRes[1] > uTruthPerm[1] || uTruthRes[1] == uTruthPerm[1] && uTruthRes[0] > uTruthPerm[0] )
+ if ( uTruthRes[1] > uTruthPerm[1] || (uTruthRes[1] == uTruthPerm[1] && uTruthRes[0] > uTruthPerm[0]) )
{
uTruthRes[0] = uTruthPerm[0];
uTruthRes[1] = uTruthPerm[1];
@@ -170,7 +170,8 @@ void Map_CanonComputePhase6( unsigned uTruths[][2], int nVars, unsigned uTruth[]
int Map_CanonComputeFast( Map_Man_t * p, int nVarsMax, int nVarsReal, unsigned uTruth[], unsigned char * puPhases, unsigned uTruthRes[] )
{
unsigned uTruth0, uTruth1;
- unsigned uCanon0, uCanon1, uCanonBest, uPhaseBest;
+ unsigned uCanon0, uCanon1, uCanonBest;
+ unsigned uPhaseBest = 16; // Suppress "might be used uninitialized" (asserts require < 16)
int i, Limit;
if ( nVarsMax == 6 )
diff --git a/src/map/mapper/mapperCreate.c b/src/map/mapper/mapperCreate.c
index 157d467b..0a971542 100644
--- a/src/map/mapper/mapperCreate.c
+++ b/src/map/mapper/mapperCreate.c
@@ -27,7 +27,7 @@ static void Map_TableResize( Map_Man_t * p );
static Map_Node_t * Map_TableLookup( Map_Man_t * p, Map_Node_t * p1, Map_Node_t * p2 );
// hash key for the structural hash table
-static inline unsigned Map_HashKey2( Map_Node_t * p0, Map_Node_t * p1, int TableSize ) { return ((unsigned)(p0) + (unsigned)(p1) * 12582917) % TableSize; }
+static inline unsigned Map_HashKey2( Map_Node_t * p0, Map_Node_t * p1, int TableSize ) { return (unsigned)(((PORT_PTRUINT_T)(p0) + (PORT_PTRUINT_T)(p1) * 12582917) % TableSize); }
////////////////////////////////////////////////////////////////////////
/// FUNCTION DEFINITIONS ///
diff --git a/src/map/mapper/mapperCut.c b/src/map/mapper/mapperCut.c
index b05e9d0c..46405547 100644
--- a/src/map/mapper/mapperCut.c
+++ b/src/map/mapper/mapperCut.c
@@ -355,8 +355,8 @@ Map_Cut_t * Map_CutMergeLists( Map_Man_t * p, Map_CutTable_t * pTable,
// if ( p->nVarsMax == 5 )
// pCut->uTruth = Map_CutComputeTruth( p, pCut, pTemp1, pTemp2, fComp1, fComp2 );
// add it to the corresponding list
- pCut->pNext = pLists[pCut->nLeaves];
- pLists[pCut->nLeaves] = pCut;
+ pCut->pNext = pLists[(int)pCut->nLeaves];
+ pLists[(int)pCut->nLeaves] = pCut;
// count this cut and quit if limit is reached
Counter++;
if ( Counter == MAP_CUTS_MAX_COMPUTE )
@@ -389,8 +389,8 @@ Map_Cut_t * Map_CutMergeLists( Map_Man_t * p, Map_CutTable_t * pTable,
// if ( p->nVarsMax == 5 )
// pCut->uTruth = Map_CutComputeTruth( p, pCut, pTemp1, pTemp2, fComp1, fComp2 );
// add it to the corresponding list
- pCut->pNext = pLists[pCut->nLeaves];
- pLists[pCut->nLeaves] = pCut;
+ pCut->pNext = pLists[(int)pCut->nLeaves];
+ pLists[(int)pCut->nLeaves] = pCut;
// count this cut and quit if limit is reached
Counter++;
if ( Counter == MAP_CUTS_MAX_COMPUTE )
@@ -426,8 +426,8 @@ Map_Cut_t * Map_CutMergeLists( Map_Man_t * p, Map_CutTable_t * pTable,
// if ( p->nVarsMax == 5 )
// pCut->uTruth = Map_CutComputeTruth( p, pCut, pTemp1, pTemp2, fComp1, fComp2 );
// add it to the corresponding list
- pCut->pNext = pLists[pCut->nLeaves];
- pLists[pCut->nLeaves] = pCut;
+ pCut->pNext = pLists[(int)pCut->nLeaves];
+ pLists[(int)pCut->nLeaves] = pCut;
// count this cut and quit if limit is reached
Counter++;
if ( Counter == MAP_CUTS_MAX_COMPUTE )
@@ -493,8 +493,8 @@ Map_Cut_t * Map_CutMergeLists2( Map_Man_t * p, Map_CutTable_t * pTable,
pCut->pOne = Map_CutNotCond( pTemp1, fComp1 );
pCut->pTwo = Map_CutNotCond( pTemp2, fComp2 );
// add it to the corresponding list
- pCut->pNext = pLists[pCut->nLeaves];
- pLists[pCut->nLeaves] = pCut;
+ pCut->pNext = pLists[(int)pCut->nLeaves];
+ pLists[(int)pCut->nLeaves] = pCut;
// count this cut and quit if limit is reached
Counter++;
if ( Counter == MAP_CUTS_MAX_COMPUTE )
diff --git a/src/map/mapper/mapperCutUtils.c b/src/map/mapper/mapperCutUtils.c
index 4450cb04..42bdd103 100644
--- a/src/map/mapper/mapperCutUtils.c
+++ b/src/map/mapper/mapperCutUtils.c
@@ -161,7 +161,8 @@ int Map_NodeGetLeafPhase( Map_Node_t * pNode, int fPhase, int iLeaf )
***********************************************************************/
Map_Cut_t * Map_CutListAppend( Map_Cut_t * pSetAll, Map_Cut_t * pSets )
{
- Map_Cut_t * pPrev, * pTemp;
+ Map_Cut_t * pPrev = NULL; // Suppress "might be used uninitialized"
+ Map_Cut_t * pTemp;
if ( pSetAll == NULL )
return pSets;
if ( pSets == NULL )
diff --git a/src/map/mapper/mapperLib.c b/src/map/mapper/mapperLib.c
index d916487e..9c47ed03 100644
--- a/src/map/mapper/mapperLib.c
+++ b/src/map/mapper/mapperLib.c
@@ -15,6 +15,11 @@
Revision [$Id: mapperLib.c,v 1.6 2005/01/23 06:59:44 alanmi Exp $]
***********************************************************************/
+#define _BSD_SOURCE
+
+#ifndef WIN32
+#include <unistd.h>
+#endif
#include "mapperInt.h"
diff --git a/src/map/mapper/mapperMatch.c b/src/map/mapper/mapperMatch.c
index bfa72601..74b83f75 100644
--- a/src/map/mapper/mapperMatch.c
+++ b/src/map/mapper/mapperMatch.c
@@ -137,7 +137,8 @@ int Map_MatchNodePhase( Map_Man_t * p, Map_Node_t * pNode, int fPhase )
{
Map_Match_t MatchBest, * pMatch;
Map_Cut_t * pCut, * pCutBest;
- float Area1, Area2, fWorstLimit;
+ float Area1 = 0.0; // Suppress "might be used uninitialized
+ float Area2, fWorstLimit;
// skip the cuts that have been unassigned during area recovery
pCutBest = pNode->pCutBest[fPhase];
diff --git a/src/map/mapper/mapperSuper.c b/src/map/mapper/mapperSuper.c
index ce6a780f..92f73ecb 100644
--- a/src/map/mapper/mapperSuper.c
+++ b/src/map/mapper/mapperSuper.c
@@ -80,7 +80,8 @@ int Map_LibraryReadFile( Map_SuperLib_t * pLib, FILE * pFile )
char pBuffer[2000];
FILE * pFileGen;
Map_Super_t * pGate;
- char * pTemp, * pLibName;
+ char * pTemp = NULL; // Suppress "might be used uninitialized"
+ char * pLibName;
int nCounter, nGatesTotal;
unsigned uCanon[2];
@@ -400,7 +401,7 @@ void Map_LibraryPrintSupergate( Map_Super_t * pGate )
printf( "%5d : ", pGate->nUsed );
printf( "%5d ", pGate->Num );
printf( "A = %5.2f ", pGate->Area );
- printf( "D = %5.2f ", pGate->tDelayMax );
+ printf( "D = %5.2f/%5.2f/%5.2f ", pGate->tDelayMax.Rise, pGate->tDelayMax.Fall, pGate->tDelayMax.Worst );
printf( "%s", pGate->pFormula );
printf( "\n" );
}
diff --git a/src/map/mapper/mapperTable.c b/src/map/mapper/mapperTable.c
index d0cb7a01..3feba352 100644
--- a/src/map/mapper/mapperTable.c
+++ b/src/map/mapper/mapperTable.c
@@ -231,7 +231,7 @@ void Map_SuperTableResize( Map_HashTable_t * p )
{
Map_HashEntry_t ** pBinsNew;
Map_HashEntry_t * pEnt, * pEnt2;
- int nBinsNew, Counter, i, clk = clock();
+ int nBinsNew, Counter, i;
unsigned Key;
// get the new table size
nBinsNew = Cudd_Prime(2 * p->nBins);
diff --git a/src/map/mapper/mapperTree.c b/src/map/mapper/mapperTree.c
index ef66082d..76c1e520 100644
--- a/src/map/mapper/mapperTree.c
+++ b/src/map/mapper/mapperTree.c
@@ -34,7 +34,7 @@ static int Map_LibraryGetMaxSuperPi_rec( Map_Super_t * pGate );
static unsigned Map_LibraryGetGateSupp_rec( Map_Super_t * pGate );
// fanout limits
-extern const int s_MapFanoutLimits[10] = { 1/*0*/, 10/*1*/, 5/*2*/, 2/*3*/, 1/*4*/, 1/*5*/, 1/*6*/ };
+static const int s_MapFanoutLimits[10] = { 1/*0*/, 10/*1*/, 5/*2*/, 2/*3*/, 1/*4*/, 1/*5*/, 1/*6*/ };
////////////////////////////////////////////////////////////////////////
/// FUNCTION DEFINITIONS ///
diff --git a/src/map/mapper/mapperTruth.c b/src/map/mapper/mapperTruth.c
index 388b6dd3..dcc8c1d3 100644
--- a/src/map/mapper/mapperTruth.c
+++ b/src/map/mapper/mapperTruth.c
@@ -194,7 +194,7 @@ void Map_TruthsCut( Map_Man_t * p, Map_Cut_t * pCut )
void Map_TruthsCutOne( Map_Man_t * p, Map_Cut_t * pCut, unsigned uTruth[] )
{
unsigned uTruth1[2], uTruth2[2];
- Map_Cut_t * pTemp;
+ Map_Cut_t * pTemp = NULL; // Suppress "might be used uninitialized"
int i;
// mark the cut leaves
for ( i = 0; i < pCut->nLeaves; i++ )
diff --git a/src/map/mapper/mapperUtils.c b/src/map/mapper/mapperUtils.c
index 11a3a683..b1f425a3 100644
--- a/src/map/mapper/mapperUtils.c
+++ b/src/map/mapper/mapperUtils.c
@@ -37,7 +37,6 @@ static unsigned Map_MappingExpandTruth_rec( unsigned uTruth, int nVars );
static void Map_MappingGetChoiceLevels( Map_Man_t * pMan, Map_Node_t * p1, Map_Node_t * p2, int * pMin, int * pMax );
static float Map_MappingGetChoiceVolumes( Map_Man_t * pMan, Map_Node_t * p1, Map_Node_t * p2 );
static int Map_MappingCountUsedNodes( Map_Man_t * pMan, int fChoices );
-static Map_Man_t * s_pMan = NULL;
////////////////////////////////////////////////////////////////////////
/// FUNCTION DEFINITIONS ///