summaryrefslogtreecommitdiffstats
path: root/src/base/abci/abcResub.c
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2010-11-01 01:35:04 -0700
committerAlan Mishchenko <alanmi@berkeley.edu>2010-11-01 01:35:04 -0700
commit6130e39b18b5f53902e4eab14f6d5cdde5219563 (patch)
tree0db0628479a1b750e9af1f66cb8379ebd0913d31 /src/base/abci/abcResub.c
parentf0e77f6797c0504b0da25a56152b707d3357f386 (diff)
downloadabc-6130e39b18b5f53902e4eab14f6d5cdde5219563.tar.gz
abc-6130e39b18b5f53902e4eab14f6d5cdde5219563.tar.bz2
abc-6130e39b18b5f53902e4eab14f6d5cdde5219563.zip
initial commit of public abc
Diffstat (limited to 'src/base/abci/abcResub.c')
-rw-r--r--src/base/abci/abcResub.c193
1 files changed, 96 insertions, 97 deletions
diff --git a/src/base/abci/abcResub.c b/src/base/abci/abcResub.c
index 655f158e..a0a1af91 100644
--- a/src/base/abci/abcResub.c
+++ b/src/base/abci/abcResub.c
@@ -20,6 +20,9 @@
#include "abc.h"
#include "dec.h"
+
+ABC_NAMESPACE_IMPL_START
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
@@ -93,7 +96,7 @@ struct Abc_ManRes_t_
// external procedures
static Abc_ManRes_t* Abc_ManResubStart( int nLeavesMax, int nDivsMax );
static void Abc_ManResubStop( Abc_ManRes_t * p );
-static Dec_Graph_t * Abc_ManResubEval( Abc_ManRes_t * p, Abc_Obj_t * pRoot, Vec_Ptr_t * vLeaves, int nSteps, bool fUpdateLevel, int fVerbose );
+static Dec_Graph_t * Abc_ManResubEval( Abc_ManRes_t * p, Abc_Obj_t * pRoot, Vec_Ptr_t * vLeaves, int nSteps, int fUpdateLevel, int fVerbose );
static void Abc_ManResubCleanup( Abc_ManRes_t * p );
static void Abc_ManResubPrint( Abc_ManRes_t * p );
@@ -114,12 +117,6 @@ static Dec_Graph_t * Abc_ManResubDivs3( Abc_ManRes_t * p, int Required );
static Vec_Ptr_t * Abc_CutFactorLarge( Abc_Obj_t * pNode, int nLeavesMax );
static int Abc_CutVolumeCheck( Abc_Obj_t * pNode, Vec_Ptr_t * vLeaves );
-// don't-care manager
-extern void * Abc_NtkDontCareAlloc( int nVarsMax, int nLevels, int fVerbose, int fVeryVerbose );
-extern void Abc_NtkDontCareClear( void * p );
-extern void Abc_NtkDontCareFree( void * p );
-extern int Abc_NtkDontCareCompute( void * p, Abc_Obj_t * pNode, Vec_Ptr_t * vLeaves, unsigned * puTruth );
-
extern int s_ResubTime;
////////////////////////////////////////////////////////////////////////
@@ -137,13 +134,13 @@ extern int s_ResubTime;
SeeAlso []
***********************************************************************/
-int Abc_NtkResubstitute( Abc_Ntk_t * pNtk, int nCutMax, int nStepsMax, int nLevelsOdc, bool fUpdateLevel, bool fVerbose, bool fVeryVerbose )
+int Abc_NtkResubstitute( Abc_Ntk_t * pNtk, int nCutMax, int nStepsMax, int nLevelsOdc, int fUpdateLevel, int fVerbose, int fVeryVerbose )
{
- extern void Dec_GraphUpdateNetwork( Abc_Obj_t * pRoot, Dec_Graph_t * pGraph, bool fUpdateLevel, int nGain );
+ extern void Dec_GraphUpdateNetwork( Abc_Obj_t * pRoot, Dec_Graph_t * pGraph, int fUpdateLevel, int nGain );
ProgressBar * pProgress;
Abc_ManRes_t * pManRes;
Abc_ManCut_t * pManCut;
- void * pManOdc = NULL;
+ Odc_Man_t * pManOdc = NULL;
Dec_Graph_t * pFForm;
Vec_Ptr_t * vLeaves;
Abc_Obj_t * pNode;
@@ -153,7 +150,7 @@ int Abc_NtkResubstitute( Abc_Ntk_t * pNtk, int nCutMax, int nStepsMax, int nLeve
assert( Abc_NtkIsStrash(pNtk) );
// cleanup the AIG
- Abc_AigCleanup(pNtk->pManFunc);
+ Abc_AigCleanup((Abc_Aig_t *)pNtk->pManFunc);
// start the managers
pManCut = Abc_NtkManCutStart( nCutMax, 100000, 100000, 100000 );
pManRes = Abc_ManResubStart( nCutMax, ABC_RS_DIV1_MAX );
@@ -166,7 +163,7 @@ int Abc_NtkResubstitute( Abc_Ntk_t * pNtk, int nCutMax, int nStepsMax, int nLeve
if ( Abc_NtkLatchNum(pNtk) ) {
Abc_NtkForEachLatch(pNtk, pNode, i)
- pNode->pNext = pNode->pData;
+ pNode->pNext = (Abc_Obj_t *)pNode->pData;
}
// resynthesize each node once
@@ -312,7 +309,7 @@ Abc_ManRes_t * Abc_ManResubStart( int nLeavesMax, int nDivsMax )
// set elementary truth tables
for ( k = 0; k < p->nLeavesMax; k++ )
{
- pData = p->vSims->pArray[k];
+ pData = (unsigned *)p->vSims->pArray[k];
for ( i = 0; i < p->nBits; i++ )
if ( i & (1 << k) )
pData[i>>5] |= (1 << (i&31));
@@ -445,19 +442,19 @@ int Abc_ManResubCollectDivs( Abc_ManRes_t * p, Abc_Obj_t * pRoot, Vec_Ptr_t * vL
// add the leaves of the cuts to the divisors
Vec_PtrClear( p->vDivs );
Abc_NtkIncrementTravId( pRoot->pNtk );
- Vec_PtrForEachEntry( vLeaves, pNode, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vLeaves, pNode, i )
{
Vec_PtrPush( p->vDivs, pNode );
Abc_NodeSetTravIdCurrent( pNode );
}
// mark nodes in the MFFC
- Vec_PtrForEachEntry( p->vTemp, pNode, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, p->vTemp, pNode, i )
pNode->fMarkA = 1;
// collect the cone (without MFFC)
Abc_ManResubCollectDivs_rec( pRoot, p->vDivs );
// unmark the current MFFC
- Vec_PtrForEachEntry( p->vTemp, pNode, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, p->vTemp, pNode, i )
pNode->fMarkA = 0;
// check if the number of divisors is not exceeded
@@ -469,7 +466,7 @@ int Abc_ManResubCollectDivs( Abc_ManRes_t * p, Abc_Obj_t * pRoot, Vec_Ptr_t * vL
// explore the fanouts, which are not in the MFFC
Counter = 0;
- Vec_PtrForEachEntry( p->vDivs, pNode, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, p->vDivs, pNode, i )
{
if ( Abc_ObjFanoutNum(pNode) > 100 )
{
@@ -499,7 +496,7 @@ Quits :
p->nDivs = Vec_PtrSize(p->vDivs);
// add the nodes in the MFFC
- Vec_PtrForEachEntry( p->vTemp, pNode, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, p->vTemp, pNode, i )
Vec_PtrPush( p->vDivs, pNode );
assert( pRoot == Vec_PtrEntryLast(p->vDivs) );
@@ -523,7 +520,7 @@ void Abc_ManResubPrintDivs( Abc_ManRes_t * p, Abc_Obj_t * pRoot, Vec_Ptr_t * vLe
Abc_Obj_t * pFanin, * pNode;
int i, k;
// print the nodes
- Vec_PtrForEachEntry( p->vDivs, pNode, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, p->vDivs, pNode, i )
{
if ( i < Vec_PtrSize(vLeaves) )
{
@@ -532,7 +529,7 @@ void Abc_ManResubPrintDivs( Abc_ManRes_t * p, Abc_Obj_t * pRoot, Vec_Ptr_t * vLe
}
printf( "%6d : %2d = ", pNode->Id, i );
// find the first fanin
- Vec_PtrForEachEntry( p->vDivs, pFanin, k )
+ Vec_PtrForEachEntry( Abc_Obj_t *, p->vDivs, pFanin, k )
if ( Abc_ObjFanin0(pNode) == pFanin )
break;
if ( k < Vec_PtrSize(vLeaves) )
@@ -541,7 +538,7 @@ void Abc_ManResubPrintDivs( Abc_ManRes_t * p, Abc_Obj_t * pRoot, Vec_Ptr_t * vLe
printf( "%d", k );
printf( "%s ", Abc_ObjFaninC0(pNode)? "\'" : "" );
// find the second fanin
- Vec_PtrForEachEntry( p->vDivs, pFanin, k )
+ Vec_PtrForEachEntry( Abc_Obj_t *, p->vDivs, pFanin, k )
if ( Abc_ObjFanin1(pNode) == pFanin )
break;
if ( k < Vec_PtrSize(vLeaves) )
@@ -575,7 +572,7 @@ void Abc_ManResubSimulate( Vec_Ptr_t * vDivs, int nLeaves, Vec_Ptr_t * vSims, in
int i, k;
assert( Vec_PtrSize(vDivs) - nLeaves <= Vec_PtrSize(vSims) - nLeavesMax );
// simulate
- Vec_PtrForEachEntry( vDivs, pObj, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vDivs, pObj, i )
{
if ( i < nLeaves )
{ // initialize the leaf
@@ -585,9 +582,9 @@ void Abc_ManResubSimulate( Vec_Ptr_t * vDivs, int nLeaves, Vec_Ptr_t * vSims, in
// set storage for the node's simulation info
pObj->pData = Vec_PtrEntry( vSims, i - nLeaves + nLeavesMax );
// get pointer to the simulation info
- puData = pObj->pData;
- puData0 = Abc_ObjFanin0(pObj)->pData;
- puData1 = Abc_ObjFanin1(pObj)->pData;
+ puData = (unsigned *)pObj->pData;
+ puData0 = (unsigned *)Abc_ObjFanin0(pObj)->pData;
+ puData1 = (unsigned *)Abc_ObjFanin1(pObj)->pData;
// simulate
if ( Abc_ObjFaninC0(pObj) && Abc_ObjFaninC1(pObj) )
for ( k = 0; k < nWords; k++ )
@@ -603,9 +600,9 @@ void Abc_ManResubSimulate( Vec_Ptr_t * vDivs, int nLeaves, Vec_Ptr_t * vSims, in
puData[k] = puData0[k] & puData1[k];
}
// normalize
- Vec_PtrForEachEntry( vDivs, pObj, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vDivs, pObj, i )
{
- puData = pObj->pData;
+ puData = (unsigned *)pObj->pData;
pObj->fPhase = (puData[0] & 1);
if ( pObj->fPhase )
for ( k = 0; k < nWords; k++ )
@@ -849,13 +846,13 @@ void Abc_ManResubDivsS( Abc_ManRes_t * p, int Required )
Vec_PtrClear( p->vDivs1UP );
Vec_PtrClear( p->vDivs1UN );
Vec_PtrClear( p->vDivs1B );
- puDataR = p->pRoot->pData;
- Vec_PtrForEachEntryStop( p->vDivs, pObj, i, p->nDivs )
+ puDataR = (unsigned *)p->pRoot->pData;
+ Vec_PtrForEachEntryStop( Abc_Obj_t *, p->vDivs, pObj, i, p->nDivs )
{
if ( (int)pObj->Level > Required - 1 )
continue;
- puData = pObj->pData;
+ puData = (unsigned *)pObj->pData;
// check positive containment
for ( w = 0; w < p->nWords; w++ )
// if ( puData[w] & ~puDataR[w] )
@@ -901,19 +898,19 @@ void Abc_ManResubDivsD( Abc_ManRes_t * p, int Required )
Vec_PtrClear( p->vDivs2UP1 );
Vec_PtrClear( p->vDivs2UN0 );
Vec_PtrClear( p->vDivs2UN1 );
- puDataR = p->pRoot->pData;
- Vec_PtrForEachEntry( p->vDivs1B, pObj0, i )
+ puDataR = (unsigned *)p->pRoot->pData;
+ Vec_PtrForEachEntry( Abc_Obj_t *, p->vDivs1B, pObj0, i )
{
if ( (int)pObj0->Level > Required - 2 )
continue;
- puData0 = pObj0->pData;
- Vec_PtrForEachEntryStart( p->vDivs1B, pObj1, k, i + 1 )
+ puData0 = (unsigned *)pObj0->pData;
+ Vec_PtrForEachEntryStart( Abc_Obj_t *, p->vDivs1B, pObj1, k, i + 1 )
{
if ( (int)pObj1->Level > Required - 2 )
continue;
- puData1 = pObj1->pData;
+ puData1 = (unsigned *)pObj1->pData;
if ( Vec_PtrSize(p->vDivs2UP0) < ABC_RS_DIV2_MAX )
{
@@ -1019,7 +1016,7 @@ Dec_Graph_t * Abc_ManResubQuit( Abc_ManRes_t * p )
Dec_Graph_t * pGraph;
unsigned * upData;
int w;
- upData = p->pRoot->pData;
+ upData = (unsigned *)p->pRoot->pData;
for ( w = 0; w < p->nWords; w++ )
// if ( upData[w] )
if ( upData[w] & p->pCareSet[w] ) // care set
@@ -1050,10 +1047,10 @@ Dec_Graph_t * Abc_ManResubDivs0( Abc_ManRes_t * p )
Abc_Obj_t * pObj;
unsigned * puData, * puDataR;
int i, w;
- puDataR = p->pRoot->pData;
- Vec_PtrForEachEntryStop( p->vDivs, pObj, i, p->nDivs )
+ puDataR = (unsigned *)p->pRoot->pData;
+ Vec_PtrForEachEntryStop( Abc_Obj_t *, p->vDivs, pObj, i, p->nDivs )
{
- puData = pObj->pData;
+ puData = (unsigned *)pObj->pData;
for ( w = 0; w < p->nWords; w++ )
// if ( puData[w] != puDataR[w] )
if ( (puData[w] ^ puDataR[w]) & p->pCareSet[w] ) // care set
@@ -1080,14 +1077,14 @@ Dec_Graph_t * Abc_ManResubDivs1( Abc_ManRes_t * p, int Required )
Abc_Obj_t * pObj0, * pObj1;
unsigned * puData0, * puData1, * puDataR;
int i, k, w;
- puDataR = p->pRoot->pData;
+ puDataR = (unsigned *)p->pRoot->pData;
// check positive unate divisors
- Vec_PtrForEachEntry( p->vDivs1UP, pObj0, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, p->vDivs1UP, pObj0, i )
{
- puData0 = pObj0->pData;
- Vec_PtrForEachEntryStart( p->vDivs1UP, pObj1, k, i + 1 )
+ puData0 = (unsigned *)pObj0->pData;
+ Vec_PtrForEachEntryStart( Abc_Obj_t *, p->vDivs1UP, pObj1, k, i + 1 )
{
- puData1 = pObj1->pData;
+ puData1 = (unsigned *)pObj1->pData;
for ( w = 0; w < p->nWords; w++ )
// if ( (puData0[w] | puData1[w]) != puDataR[w] )
if ( ((puData0[w] | puData1[w]) ^ puDataR[w]) & p->pCareSet[w] ) // care set
@@ -1100,12 +1097,12 @@ Dec_Graph_t * Abc_ManResubDivs1( Abc_ManRes_t * p, int Required )
}
}
// check negative unate divisors
- Vec_PtrForEachEntry( p->vDivs1UN, pObj0, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, p->vDivs1UN, pObj0, i )
{
- puData0 = pObj0->pData;
- Vec_PtrForEachEntryStart( p->vDivs1UN, pObj1, k, i + 1 )
+ puData0 = (unsigned *)pObj0->pData;
+ Vec_PtrForEachEntryStart( Abc_Obj_t *, p->vDivs1UN, pObj1, k, i + 1 )
{
- puData1 = pObj1->pData;
+ puData1 = (unsigned *)pObj1->pData;
for ( w = 0; w < p->nWords; w++ )
// if ( (puData0[w] & puData1[w]) != puDataR[w] )
if ( ((puData0[w] & puData1[w]) ^ puDataR[w]) & p->pCareSet[w] ) // care set
@@ -1136,17 +1133,17 @@ Dec_Graph_t * Abc_ManResubDivs12( Abc_ManRes_t * p, int Required )
Abc_Obj_t * pObj0, * pObj1, * pObj2, * pObjMax, * pObjMin0 = NULL, * pObjMin1 = NULL;
unsigned * puData0, * puData1, * puData2, * puDataR;
int i, k, j, w, LevelMax;
- puDataR = p->pRoot->pData;
+ puDataR = (unsigned *)p->pRoot->pData;
// check positive unate divisors
- Vec_PtrForEachEntry( p->vDivs1UP, pObj0, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, p->vDivs1UP, pObj0, i )
{
- puData0 = pObj0->pData;
- Vec_PtrForEachEntryStart( p->vDivs1UP, pObj1, k, i + 1 )
+ puData0 = (unsigned *)pObj0->pData;
+ Vec_PtrForEachEntryStart( Abc_Obj_t *, p->vDivs1UP, pObj1, k, i + 1 )
{
- puData1 = pObj1->pData;
- Vec_PtrForEachEntryStart( p->vDivs1UP, pObj2, j, k + 1 )
+ puData1 = (unsigned *)pObj1->pData;
+ Vec_PtrForEachEntryStart( Abc_Obj_t *, p->vDivs1UP, pObj2, j, k + 1 )
{
- puData2 = pObj2->pData;
+ puData2 = (unsigned *)pObj2->pData;
for ( w = 0; w < p->nWords; w++ )
// if ( (puData0[w] | puData1[w] | puData2[w]) != puDataR[w] )
if ( ((puData0[w] | puData1[w] | puData2[w]) ^ puDataR[w]) & p->pCareSet[w] ) // care set
@@ -1179,15 +1176,15 @@ Dec_Graph_t * Abc_ManResubDivs12( Abc_ManRes_t * p, int Required )
}
}
// check negative unate divisors
- Vec_PtrForEachEntry( p->vDivs1UN, pObj0, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, p->vDivs1UN, pObj0, i )
{
- puData0 = pObj0->pData;
- Vec_PtrForEachEntryStart( p->vDivs1UN, pObj1, k, i + 1 )
+ puData0 = (unsigned *)pObj0->pData;
+ Vec_PtrForEachEntryStart( Abc_Obj_t *, p->vDivs1UN, pObj1, k, i + 1 )
{
- puData1 = pObj1->pData;
- Vec_PtrForEachEntryStart( p->vDivs1UN, pObj2, j, k + 1 )
+ puData1 = (unsigned *)pObj1->pData;
+ Vec_PtrForEachEntryStart( Abc_Obj_t *, p->vDivs1UN, pObj2, j, k + 1 )
{
- puData2 = pObj2->pData;
+ puData2 = (unsigned *)pObj2->pData;
for ( w = 0; w < p->nWords; w++ )
// if ( (puData0[w] & puData1[w] & puData2[w]) != puDataR[w] )
if ( ((puData0[w] & puData1[w] & puData2[w]) ^ puDataR[w]) & p->pCareSet[w] ) // care set
@@ -1238,17 +1235,17 @@ Dec_Graph_t * Abc_ManResubDivs2( Abc_ManRes_t * p, int Required )
Abc_Obj_t * pObj0, * pObj1, * pObj2;
unsigned * puData0, * puData1, * puData2, * puDataR;
int i, k, w;
- puDataR = p->pRoot->pData;
+ puDataR = (unsigned *)p->pRoot->pData;
// check positive unate divisors
- Vec_PtrForEachEntry( p->vDivs1UP, pObj0, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, p->vDivs1UP, pObj0, i )
{
- puData0 = pObj0->pData;
- Vec_PtrForEachEntry( p->vDivs2UP0, pObj1, k )
+ puData0 = (unsigned *)pObj0->pData;
+ Vec_PtrForEachEntry( Abc_Obj_t *, p->vDivs2UP0, pObj1, k )
{
- pObj2 = Vec_PtrEntry( p->vDivs2UP1, k );
+ pObj2 = (Abc_Obj_t *)Vec_PtrEntry( p->vDivs2UP1, k );
- puData1 = Abc_ObjRegular(pObj1)->pData;
- puData2 = Abc_ObjRegular(pObj2)->pData;
+ puData1 = (unsigned *)Abc_ObjRegular(pObj1)->pData;
+ puData2 = (unsigned *)Abc_ObjRegular(pObj2)->pData;
if ( Abc_ObjIsComplement(pObj1) && Abc_ObjIsComplement(pObj2) )
{
for ( w = 0; w < p->nWords; w++ )
@@ -1285,15 +1282,15 @@ Dec_Graph_t * Abc_ManResubDivs2( Abc_ManRes_t * p, int Required )
}
}
// check negative unate divisors
- Vec_PtrForEachEntry( p->vDivs1UN, pObj0, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, p->vDivs1UN, pObj0, i )
{
- puData0 = pObj0->pData;
- Vec_PtrForEachEntry( p->vDivs2UN0, pObj1, k )
+ puData0 = (unsigned *)pObj0->pData;
+ Vec_PtrForEachEntry( Abc_Obj_t *, p->vDivs2UN0, pObj1, k )
{
- pObj2 = Vec_PtrEntry( p->vDivs2UN1, k );
+ pObj2 = (Abc_Obj_t *)Vec_PtrEntry( p->vDivs2UN1, k );
- puData1 = Abc_ObjRegular(pObj1)->pData;
- puData2 = Abc_ObjRegular(pObj2)->pData;
+ puData1 = (unsigned *)Abc_ObjRegular(pObj1)->pData;
+ puData2 = (unsigned *)Abc_ObjRegular(pObj2)->pData;
if ( Abc_ObjIsComplement(pObj1) && Abc_ObjIsComplement(pObj2) )
{
for ( w = 0; w < p->nWords; w++ )
@@ -1348,22 +1345,22 @@ Dec_Graph_t * Abc_ManResubDivs3( Abc_ManRes_t * p, int Required )
Abc_Obj_t * pObj0, * pObj1, * pObj2, * pObj3;
unsigned * puData0, * puData1, * puData2, * puData3, * puDataR;
int i, k, w = 0, Flag;
- puDataR = p->pRoot->pData;
+ puDataR = (unsigned *)p->pRoot->pData;
// check positive unate divisors
- Vec_PtrForEachEntry( p->vDivs2UP0, pObj0, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, p->vDivs2UP0, pObj0, i )
{
- pObj1 = Vec_PtrEntry( p->vDivs2UP1, i );
- puData0 = Abc_ObjRegular(pObj0)->pData;
- puData1 = Abc_ObjRegular(pObj1)->pData;
+ pObj1 = (Abc_Obj_t *)Vec_PtrEntry( p->vDivs2UP1, i );
+ puData0 = (unsigned *)Abc_ObjRegular(pObj0)->pData;
+ puData1 = (unsigned *)Abc_ObjRegular(pObj1)->pData;
Flag = (Abc_ObjIsComplement(pObj0) << 3) | (Abc_ObjIsComplement(pObj1) << 2);
- Vec_PtrForEachEntryStart( p->vDivs2UP0, pObj2, k, i + 1 )
+ Vec_PtrForEachEntryStart( Abc_Obj_t *, p->vDivs2UP0, pObj2, k, i + 1 )
{
- pObj3 = Vec_PtrEntry( p->vDivs2UP1, k );
- puData2 = Abc_ObjRegular(pObj2)->pData;
- puData3 = Abc_ObjRegular(pObj3)->pData;
+ pObj3 = (Abc_Obj_t *)Vec_PtrEntry( p->vDivs2UP1, k );
+ puData2 = (unsigned *)Abc_ObjRegular(pObj2)->pData;
+ puData3 = (unsigned *)Abc_ObjRegular(pObj3)->pData;
- Flag = (Flag & 12) | (Abc_ObjIsComplement(pObj2) << 1) | Abc_ObjIsComplement(pObj3);
+ Flag = (Flag & 12) | ((int)Abc_ObjIsComplement(pObj2) << 1) | (int)Abc_ObjIsComplement(pObj3);
assert( Flag < 16 );
switch( Flag )
{
@@ -1477,14 +1474,14 @@ Dec_Graph_t * Abc_ManResubDivs3( Abc_ManRes_t * p, int Required )
}
/*
// check negative unate divisors
- Vec_PtrForEachEntry( p->vDivs2UN0, pObj0, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, p->vDivs2UN0, pObj0, i )
{
pObj1 = Vec_PtrEntry( p->vDivs2UN1, i );
puData0 = Abc_ObjRegular(pObj0)->pData;
puData1 = Abc_ObjRegular(pObj1)->pData;
Flag = (Abc_ObjIsComplement(pObj0) << 3) | (Abc_ObjIsComplement(pObj1) << 2);
- Vec_PtrForEachEntryStart( p->vDivs2UN0, pObj2, k, i + 1 )
+ Vec_PtrForEachEntryStart( Abc_Obj_t *, p->vDivs2UN0, pObj2, k, i + 1 )
{
pObj3 = Vec_PtrEntry( p->vDivs2UN1, k );
puData2 = Abc_ObjRegular(pObj2)->pData;
@@ -1605,7 +1602,7 @@ void Abc_ManResubCleanup( Abc_ManRes_t * p )
{
Abc_Obj_t * pObj;
int i;
- Vec_PtrForEachEntry( p->vDivs, pObj, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, p->vDivs, pObj, i )
pObj->pData = NULL;
Vec_PtrClear( p->vDivs );
p->pRoot = NULL;
@@ -1622,7 +1619,7 @@ void Abc_ManResubCleanup( Abc_ManRes_t * p )
SeeAlso []
***********************************************************************/
-Dec_Graph_t * Abc_ManResubEval( Abc_ManRes_t * p, Abc_Obj_t * pRoot, Vec_Ptr_t * vLeaves, int nSteps, bool fUpdateLevel, bool fVerbose )
+Dec_Graph_t * Abc_ManResubEval( Abc_ManRes_t * p, Abc_Obj_t * pRoot, Vec_Ptr_t * vLeaves, int nSteps, int fUpdateLevel, int fVerbose )
{
extern int Abc_NodeMffcInside( Abc_Obj_t * pNode, Vec_Ptr_t * vLeaves, Vec_Ptr_t * vInside );
Dec_Graph_t * pGraph;
@@ -1780,7 +1777,7 @@ int Abc_CutVolumeCheck( Abc_Obj_t * pNode, Vec_Ptr_t * vLeaves )
int i;
// mark the leaves
Abc_NtkIncrementTravId( pNode->pNtk );
- Vec_PtrForEachEntry( vLeaves, pObj, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vLeaves, pObj, i )
Abc_NodeSetTravIdCurrent( pObj );
// traverse the nodes starting from the given one and count them
return Abc_CutVolumeCheck_rec( pNode );
@@ -1833,7 +1830,7 @@ Vec_Ptr_t * Abc_CutFactor( Abc_Obj_t * pNode )
vLeaves = Vec_PtrAlloc( 10 );
Abc_CutFactor_rec( Abc_ObjFanin0(pNode), vLeaves );
Abc_CutFactor_rec( Abc_ObjFanin1(pNode), vLeaves );
- Vec_PtrForEachEntry( vLeaves, pObj, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vLeaves, pObj, i )
pObj->fMarkA = 0;
return vLeaves;
}
@@ -1874,7 +1871,7 @@ Vec_Ptr_t * Abc_CutFactorLarge( Abc_Obj_t * pNode, int nLeavesMax )
// initialize the factor cuts for the leaves
vFactors = Vec_PtrAlloc( nLeavesMax );
Abc_NtkIncrementTravId( pNode->pNtk );
- Vec_PtrForEachEntry( vLeaves, pLeaf, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vLeaves, pLeaf, i )
{
Abc_NodeSetTravIdCurrent( pLeaf );
if ( Abc_ObjIsCi(pLeaf) )
@@ -1889,13 +1886,13 @@ Vec_Ptr_t * Abc_CutFactorLarge( Abc_Obj_t * pNode, int nLeavesMax )
BestCut = -1, BestShare = -1;
// find the next feasible cut to add
Vec_IntClear( vFeasible );
- Vec_PtrForEachEntry( vFactors, vFact, i )
+ Vec_PtrForEachEntry( Vec_Ptr_t *, vFactors, vFact, i )
{
if ( vFact == NULL )
continue;
// count the number of unmarked leaves of this factor cut
Counter = 0;
- Vec_PtrForEachEntry( vFact, pTemp, k )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vFact, pTemp, k )
Counter += !Abc_NodeIsTravIdCurrent(pTemp);
// if the number of new leaves is smaller than the diff, it is feasible
if ( Counter <= nLeavesMax - Vec_PtrSize(vLeaves) + 1 )
@@ -1913,8 +1910,8 @@ Vec_Ptr_t * Abc_CutFactorLarge( Abc_Obj_t * pNode, int nLeavesMax )
// choose the cut that has most sharing with the other cuts
RandLeaf = BestCut;
- pLeaf = Vec_PtrEntry( vLeaves, RandLeaf );
- vNext = Vec_PtrEntry( vFactors, RandLeaf );
+ pLeaf = (Abc_Obj_t *)Vec_PtrEntry( vLeaves, RandLeaf );
+ vNext = (Vec_Ptr_t *)Vec_PtrEntry( vFactors, RandLeaf );
// unmark this leaf
Abc_NodeSetTravIdPrevious( pLeaf );
// remove this cut from the leaves and factor cuts
@@ -1926,7 +1923,7 @@ Vec_Ptr_t * Abc_CutFactorLarge( Abc_Obj_t * pNode, int nLeavesMax )
Vec_PtrShrink( vLeaves, Vec_PtrSize(vLeaves) -1 );
Vec_PtrShrink( vFactors, Vec_PtrSize(vFactors)-1 );
// add new leaves, compute their factor cuts
- Vec_PtrForEachEntry( vNext, pLeaf, i )
+ Vec_PtrForEachEntry( Abc_Obj_t *, vNext, pLeaf, i )
{
if ( Abc_NodeIsTravIdCurrent(pLeaf) )
continue;
@@ -1944,7 +1941,7 @@ Vec_Ptr_t * Abc_CutFactorLarge( Abc_Obj_t * pNode, int nLeavesMax )
}
// remove temporary storage
- Vec_PtrForEachEntry( vFactors, vFact, i )
+ Vec_PtrForEachEntry( Vec_Ptr_t *, vFactors, vFact, i )
if ( vFact ) Vec_PtrFree( vFact );
Vec_PtrFree( vFactors );
Vec_IntFree( vFeasible );
@@ -1956,3 +1953,5 @@ Vec_Ptr_t * Abc_CutFactorLarge( Abc_Obj_t * pNode, int nLeavesMax )
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+