summaryrefslogtreecommitdiffstats
path: root/src/opt/ret
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/opt/ret
parentfa67e3c19e27c011517b91182eb3929412aaf402 (diff)
downloadabc-303baf27cf34c2a57db97c4c567fd744241fa14b.tar.gz
abc-303baf27cf34c2a57db97c4c567fd744241fa14b.tar.bz2
abc-303baf27cf34c2a57db97c4c567fd744241fa14b.zip
Version abc80702
Diffstat (limited to 'src/opt/ret')
-rw-r--r--src/opt/ret/retArea.c17
-rw-r--r--src/opt/ret/retDelay.c6
-rw-r--r--src/opt/ret/retFlow.c3
-rw-r--r--src/opt/ret/retIncrem.c15
-rw-r--r--src/opt/ret/retInit.c28
-rw-r--r--src/opt/ret/retLvalue.c4
6 files changed, 38 insertions, 35 deletions
diff --git a/src/opt/ret/retArea.c b/src/opt/ret/retArea.c
index 5eec8e80..318147f5 100644
--- a/src/opt/ret/retArea.c
+++ b/src/opt/ret/retArea.c
@@ -75,7 +75,7 @@ int Abc_NtkRetimeMinArea( Abc_Ntk_t * pNtk, int fForwardOnly, int fBackwardOnly,
if ( fOneFrame )
pNtkTotal = Abc_NtkRetimeMinAreaOne( pNtk, 0, fVerbose );
else
- while ( pNtkBottom = Abc_NtkRetimeMinAreaOne( pNtk, 0, fVerbose ) )
+ while ( (pNtkBottom = Abc_NtkRetimeMinAreaOne( pNtk, 0, fVerbose )) )
pNtkTotal = Abc_NtkAttachBottom( pNtkTotal, pNtkBottom );
}
// compute initial values
@@ -109,7 +109,6 @@ Abc_Ntk_t * Abc_NtkRetimeMinAreaOne( Abc_Ntk_t * pNtk, int fForward, int fVerbos
{
Abc_Ntk_t * pNtkNew = NULL;
Vec_Ptr_t * vMinCut;
- int nLatches = Abc_NtkLatchNum(pNtk);
// mark current latches and TFI(POs)
Abc_NtkRetimeMinAreaPrepare( pNtk, fForward );
// run the maximum forward flow
@@ -265,22 +264,22 @@ int Abc_NtkRetimeMinAreaInitValues_rec( Abc_Obj_t * pObj )
int i;
// skip visited nodes
if ( Abc_NodeIsTravIdCurrent(pObj) )
- return (int)pObj->pCopy;
+ return (int)(PORT_PTRUINT_T)pObj->pCopy;
Abc_NodeSetTravIdCurrent(pObj);
// consider the case of a latch output
if ( Abc_ObjIsBo(pObj) )
{
assert( Abc_ObjIsLatch(Abc_ObjFanin0(pObj)) );
- pObj->pCopy = (void *)Abc_NtkRetimeMinAreaInitValues_rec( Abc_ObjFanin0(pObj) );
- return (int)pObj->pCopy;
+ pObj->pCopy = (void *)(PORT_PTRUINT_T)Abc_NtkRetimeMinAreaInitValues_rec( Abc_ObjFanin0(pObj) );
+ return (int)(PORT_PTRUINT_T)pObj->pCopy;
}
assert( Abc_ObjIsNode(pObj) );
// visit the fanins
Abc_ObjForEachFanin( pObj, pFanin, i )
Abc_NtkRetimeMinAreaInitValues_rec( pFanin );
// compute the value of the node
- pObj->pCopy = (void *)Abc_ObjSopSimulate(pObj);
- return (int)pObj->pCopy;
+ pObj->pCopy = (void *)(PORT_PTRUINT_T)Abc_ObjSopSimulate(pObj);
+ return (int)(PORT_PTRUINT_T)pObj->pCopy;
}
/**Function*************************************************************
@@ -302,7 +301,7 @@ void Abc_NtkRetimeMinAreaInitValues( Abc_Ntk_t * pNtk, Vec_Ptr_t * vMinCut )
Abc_NtkIncrementTravId(pNtk);
Abc_NtkForEachLatch( pNtk, pObj, i )
{
- pObj->pCopy = (void *)Abc_LatchIsInit1(pObj);
+ pObj->pCopy = (void *)(PORT_PTRUINT_T)Abc_LatchIsInit1(pObj);
Abc_NodeSetTravIdCurrent( pObj );
}
// propagate initial values
@@ -479,7 +478,7 @@ void Abc_NtkRetimeMinAreaUpdateLatches( Abc_Ntk_t * pNtk, Vec_Ptr_t * vMinCut, i
Abc_ObjAddFanin( pLatch, pLatchIn );
if ( fForward )
{
- pLatch->pData = (void *)(pObj->pCopy? ABC_INIT_ONE : ABC_INIT_ZERO);
+ pLatch->pData = (void *)(PORT_PTRUINT_T)(pObj->pCopy? ABC_INIT_ONE : ABC_INIT_ZERO);
// redirect edges to the unvisited fanouts of the node
Abc_NodeCollectFanouts( pObj, vNodes );
Vec_PtrForEachEntry( vNodes, pNext, k )
diff --git a/src/opt/ret/retDelay.c b/src/opt/ret/retDelay.c
index bcfe3a2e..0f3c3daa 100644
--- a/src/opt/ret/retDelay.c
+++ b/src/opt/ret/retDelay.c
@@ -74,9 +74,11 @@ int Abc_NtkRetimeMinDelayTry( Abc_Ntk_t * pNtk, int fForward, int fInitial, int
{
Abc_Ntk_t * pNtkNew = NULL;
Vec_Ptr_t * vCritical;
- Vec_Int_t * vValues;
+ Vec_Int_t * vValues = NULL; // Suppress "might be used uninitialized"
Abc_Obj_t * pObj;
- int i, k, IterBest, DelayCur, DelayBest, DelayStart, LatchesBest;
+ int i, k, IterBest, DelayCur, DelayBest;
+ int DelayStart = -1; // Suppress "might be used uninitialized"
+ int LatchesBest;
// transfer intitial values
if ( fInitial )
{
diff --git a/src/opt/ret/retFlow.c b/src/opt/ret/retFlow.c
index 47ee8516..bad4b7e7 100644
--- a/src/opt/ret/retFlow.c
+++ b/src/opt/ret/retFlow.c
@@ -709,7 +709,8 @@ int Abc_NtkMaxFlowVerifyCut( Abc_Ntk_t * pNtk, Vec_Ptr_t * vMinCut, int fForward
***********************************************************************/
void Abc_NtkMaxFlowPrintFlow( Abc_Ntk_t * pNtk, int fForward )
{
- Abc_Obj_t * pLatch, * pNext, * pPrev;
+ Abc_Obj_t * pLatch, * pNext;
+ Abc_Obj_t * pPrev = NULL; // Suppress "might be used uninitialized"
int i;
if ( fForward )
{
diff --git a/src/opt/ret/retIncrem.c b/src/opt/ret/retIncrem.c
index ba8104be..140e5dcc 100644
--- a/src/opt/ret/retIncrem.c
+++ b/src/opt/ret/retIncrem.c
@@ -48,7 +48,8 @@ int Abc_NtkRetimeIncremental( Abc_Ntk_t * pNtk, int fForward, int fMinDelay, int
st_table * tLatches;
int nLatches = Abc_NtkLatchNum(pNtk);
int nIdMaxStart = Abc_NtkObjNumMax(pNtk);
- int RetValue, nIterLimit;
+ int RetValue;
+ int nIterLimit = -1; // Suppress "might be used uninitialized"
if ( Abc_NtkNodeNum(pNtk) == 0 )
return 0;
// reorder CI/CO/latch inputs
@@ -112,7 +113,7 @@ st_table * Abc_NtkRetimePrepareLatches( Abc_Ntk_t * pNtk )
Abc_NtkForEachLatch( pNtk, pLatch, i )
{
// map latch into its true number
- st_insert( tLatches, (void *)pLatch, (void *)(i-nOffSet) );
+ st_insert( tLatches, (void *)(PORT_PTRUINT_T)pLatch, (void *)(PORT_PTRUINT_T)(i-nOffSet) );
// disconnect LI
pLatchIn = Abc_ObjFanin0(pLatch);
pFanin = Abc_ObjFanin0(pLatchIn);
@@ -220,8 +221,8 @@ int Abc_NtkRetimeFinalizeLatches( Abc_Ntk_t * pNtk, st_table * tLatches, int nId
***********************************************************************/
int Abc_NtkRetimeOneWay( Abc_Ntk_t * pNtk, int fForward, int fVerbose )
{
- Abc_Ntk_t * pNtkNew;
- Vec_Int_t * vValues;
+ Abc_Ntk_t * pNtkNew = NULL; // Suppress "might be used uninitialized"
+ Vec_Int_t * vValues = NULL; // Suppress "might be used uninitialized"
Abc_Obj_t * pObj;
int i, fChanges, nTotalMoves = 0, nTotalMovesLimit = 10000;
if ( fForward )
@@ -319,7 +320,7 @@ void Abc_NtkRetimeNode( Abc_Obj_t * pObj, int fForward, int fInitial )
{
// compute the initial value
if ( fInitial )
- pObj->pCopy = (void *)Abc_ObjSopSimulate( pObj );
+ pObj->pCopy = (void *)(PORT_PTRUINT_T)Abc_ObjSopSimulate( pObj );
// collect fanins
Abc_NodeCollectFanins( pObj, vNodes );
// make the node point to the fanins fanins
@@ -399,10 +400,10 @@ int Abc_NtkRetimeCheckCompatibleLatchFanouts( Abc_Obj_t * pObj )
continue;
if ( Init == -1 )
{
- Init = (int)pObj->pData;
+ Init = (int)(PORT_PTRUINT_T)pObj->pData;
nLatches++;
}
- else if ( Init == (int)pObj->pData )
+ else if ( Init == (int)(PORT_PTRUINT_T)pObj->pData )
nLatches++;
}
return nLatches;
diff --git a/src/opt/ret/retInit.c b/src/opt/ret/retInit.c
index dcb71c60..8de0ef47 100644
--- a/src/opt/ret/retInit.c
+++ b/src/opt/ret/retInit.c
@@ -100,9 +100,9 @@ int Abc_ObjSopSimulate( Abc_Obj_t * pObj )
Abc_CubeForEachVar( pCube, Value, v )
{
if ( Value == '0' )
- ResVar = 1 ^ ((int)Abc_ObjFanin(pObj, v)->pCopy);
+ ResVar = 1 ^ ((int)(PORT_PTRUINT_T)Abc_ObjFanin(pObj, v)->pCopy);
else if ( Value == '1' )
- ResVar = (int)Abc_ObjFanin(pObj, v)->pCopy;
+ ResVar = (int)(PORT_PTRUINT_T)Abc_ObjFanin(pObj, v)->pCopy;
else
continue;
ResAnd &= ResVar;
@@ -134,17 +134,17 @@ int Abc_NtkRetimeVerifyModel( Abc_Ntk_t * pNtkCone, Vec_Int_t * vValues, int * p
assert( Abc_NtkIsSopLogic(pNtkCone) );
// set the PIs
Abc_NtkForEachPi( pNtkCone, pObj, i )
- pObj->pCopy = (void *)pModel[i];
+ pObj->pCopy = (void *)(PORT_PTRUINT_T)pModel[i];
// simulate the internal nodes
vNodes = Abc_NtkDfs( pNtkCone, 0 );
Vec_PtrForEachEntry( vNodes, pObj, i )
- pObj->pCopy = (void *)Abc_ObjSopSimulate( pObj );
+ pObj->pCopy = (void *)(PORT_PTRUINT_T)Abc_ObjSopSimulate( pObj );
Vec_PtrFree( vNodes );
// compare the outputs
Abc_NtkForEachPo( pNtkCone, pObj, i )
pObj->pCopy = Abc_ObjFanin0(pObj)->pCopy;
Abc_NtkForEachPo( pNtkCone, pObj, i )
- Counter += (Vec_IntEntry(vValues, i) != (int)pObj->pCopy);
+ Counter += (Vec_IntEntry(vValues, i) != (int)(PORT_PTRUINT_T)pObj->pCopy);
if ( Counter > 0 )
printf( "%d outputs (out of %d) have a value mismatch.\n", Counter, Abc_NtkPoNum(pNtkCone) );
return 1;
@@ -167,7 +167,7 @@ void Abc_NtkRetimeTranferToCopy( Abc_Ntk_t * pNtk )
int i;
Abc_NtkForEachObj( pNtk, pObj, i )
if ( Abc_ObjIsLatch(pObj) )
- pObj->pCopy = (void *)Abc_LatchIsInit1(pObj);
+ pObj->pCopy = (void *)(PORT_PTRUINT_T)Abc_LatchIsInit1(pObj);
}
/**Function*************************************************************
@@ -187,7 +187,7 @@ void Abc_NtkRetimeTranferFromCopy( Abc_Ntk_t * pNtk )
int i;
Abc_NtkForEachObj( pNtk, pObj, i )
if ( Abc_ObjIsLatch(pObj) )
- pObj->pData = (void *)(pObj->pCopy? ABC_INIT_ONE : ABC_INIT_ZERO);
+ pObj->pData = (void *)(PORT_PTRUINT_T)(pObj->pCopy? ABC_INIT_ONE : ABC_INIT_ZERO);
}
/**Function*************************************************************
@@ -230,10 +230,10 @@ void Abc_NtkRetimeInsertLatchValues( Abc_Ntk_t * pNtk, Vec_Int_t * vValues )
int i, Counter = 0;
Abc_NtkForEachObj( pNtk, pObj, i )
if ( Abc_ObjIsLatch(pObj) )
- pObj->pCopy = (void *)Counter++;
+ pObj->pCopy = (void *)(PORT_PTRUINT_T)Counter++;
Abc_NtkForEachObj( pNtk, pObj, i )
if ( Abc_ObjIsLatch(pObj) )
- pObj->pData = (void *)(vValues? (Vec_IntEntry(vValues,(int)pObj->pCopy)? ABC_INIT_ONE : ABC_INIT_ZERO) : ABC_INIT_DC);
+ pObj->pData = (void *)(PORT_PTRUINT_T)(vValues? (Vec_IntEntry(vValues,(int)(PORT_PTRUINT_T)pObj->pCopy)? ABC_INIT_ONE : ABC_INIT_ZERO) : ABC_INIT_DC);
}
/**Function*************************************************************
@@ -316,22 +316,22 @@ void Abc_NtkCycleInitStateSop( Abc_Ntk_t * pNtk, int nFrames, int fVerbose )
srand( 0x12341234 );
// initialize the values
Abc_NtkForEachPi( pNtk, pObj, i )
- pObj->pCopy = (void *)(rand() & 1);
+ pObj->pCopy = (void *)(PORT_PTRUINT_T)(rand() & 1);
Abc_NtkForEachLatch( pNtk, pObj, i )
- pObj->pCopy = (void *)Abc_LatchIsInit1(pObj);
+ pObj->pCopy = (void *)(PORT_PTRUINT_T)Abc_LatchIsInit1(pObj);
// simulate for the given number of timeframes
vNodes = Abc_NtkDfs( pNtk, 0 );
for ( f = 0; f < nFrames; f++ )
{
// simulate internal nodes
Vec_PtrForEachEntry( vNodes, pObj, i )
- pObj->pCopy = (void *)Abc_ObjSopSimulate( pObj );
+ pObj->pCopy = (void *)(PORT_PTRUINT_T)Abc_ObjSopSimulate( pObj );
// bring the results to the COs
Abc_NtkForEachCo( pNtk, pObj, i )
pObj->pCopy = Abc_ObjFanin0(pObj)->pCopy;
// assign PI values
Abc_NtkForEachPi( pNtk, pObj, i )
- pObj->pCopy = (void *)(rand() & 1);
+ pObj->pCopy = (void *)(PORT_PTRUINT_T)(rand() & 1);
// transfer the latch values
Abc_NtkForEachLatch( pNtk, pObj, i )
Abc_ObjFanout0(pObj)->pCopy = Abc_ObjFanin0(pObj)->pCopy;
@@ -339,7 +339,7 @@ void Abc_NtkCycleInitStateSop( Abc_Ntk_t * pNtk, int nFrames, int fVerbose )
Vec_PtrFree( vNodes );
// set the final values
Abc_NtkForEachLatch( pNtk, pObj, i )
- pObj->pData = (void *)(Abc_ObjFanout0(pObj)->pCopy ? ABC_INIT_ONE : ABC_INIT_ZERO);
+ pObj->pData = (void *)(PORT_PTRUINT_T)(Abc_ObjFanout0(pObj)->pCopy ? ABC_INIT_ONE : ABC_INIT_ZERO);
}
////////////////////////////////////////////////////////////////////////
diff --git a/src/opt/ret/retLvalue.c b/src/opt/ret/retLvalue.c
index b4d9e946..26f51f09 100644
--- a/src/opt/ret/retLvalue.c
+++ b/src/opt/ret/retLvalue.c
@@ -37,8 +37,8 @@ static Vec_Ptr_t * Abc_ManCollectLatches( Abc_Ntk_t * pNtk );
static int Abc_NtkRetimeUsingLags( Abc_Ntk_t * pNtk, Vec_Int_t * vLags, int fVerbose );
static inline int Abc_NodeComputeLag( int LValue, int Fi ) { return (LValue + (1<<16)*Fi)/Fi - (1<<16) - (int)(LValue % Fi == 0); }
-static inline int Abc_NodeGetLValue( Abc_Obj_t * pNode ) { return (int)pNode->pCopy; }
-static inline void Abc_NodeSetLValue( Abc_Obj_t * pNode, int Value ) { pNode->pCopy = (void *)Value; }
+static inline int Abc_NodeGetLValue( Abc_Obj_t * pNode ) { return (int)(PORT_PTRUINT_T)pNode->pCopy; }
+static inline void Abc_NodeSetLValue( Abc_Obj_t * pNode, int Value ) { pNode->pCopy = (void *)(PORT_PTRUINT_T)Value; }
////////////////////////////////////////////////////////////////////////
/// FUNCTION DEFINITIONS ///