summaryrefslogtreecommitdiffstats
path: root/src/base/abc
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/base/abc
parentfa67e3c19e27c011517b91182eb3929412aaf402 (diff)
downloadabc-303baf27cf34c2a57db97c4c567fd744241fa14b.tar.gz
abc-303baf27cf34c2a57db97c4c567fd744241fa14b.tar.bz2
abc-303baf27cf34c2a57db97c4c567fd744241fa14b.zip
Version abc80702
Diffstat (limited to 'src/base/abc')
-rw-r--r--src/base/abc/abc.h4
-rw-r--r--src/base/abc/abcBlifMv.c2
-rw-r--r--src/base/abc/abcCheck.c12
-rw-r--r--src/base/abc/abcDfs.c23
-rw-r--r--src/base/abc/abcFanio.c8
-rw-r--r--src/base/abc/abcLatch.c6
-rw-r--r--src/base/abc/abcNtk.c2
-rw-r--r--src/base/abc/abcObj.c2
-rw-r--r--src/base/abc/abcShow.c3
-rw-r--r--src/base/abc/abcSop.c2
-rw-r--r--src/base/abc/abcUtil.c6
11 files changed, 35 insertions, 35 deletions
diff --git a/src/base/abc/abc.h b/src/base/abc/abc.h
index 8f0c7210..9cb7a855 100644
--- a/src/base/abc/abc.h
+++ b/src/base/abc/abc.h
@@ -439,10 +439,10 @@ static inline bool Abc_LatchIsInitNone( Abc_Obj_t * pLatch ) { assert(Ab
static inline bool Abc_LatchIsInit0( Abc_Obj_t * pLatch ) { assert(Abc_ObjIsLatch(pLatch)); return pLatch->pData == (void *)ABC_INIT_ZERO; }
static inline bool Abc_LatchIsInit1( Abc_Obj_t * pLatch ) { assert(Abc_ObjIsLatch(pLatch)); return pLatch->pData == (void *)ABC_INIT_ONE; }
static inline bool Abc_LatchIsInitDc( Abc_Obj_t * pLatch ) { assert(Abc_ObjIsLatch(pLatch)); return pLatch->pData == (void *)ABC_INIT_DC; }
-static inline int Abc_LatchInit( Abc_Obj_t * pLatch ) { assert(Abc_ObjIsLatch(pLatch)); return (int)pLatch->pData; }
+static inline int Abc_LatchInit( Abc_Obj_t * pLatch ) { assert(Abc_ObjIsLatch(pLatch)); return (int)(PORT_PTRINT_T)pLatch->pData; }
// global BDDs of the nodes
-static inline void * Abc_NtkGlobalBdd( Abc_Ntk_t * pNtk ) { return (void *)Vec_PtrEntry(pNtk->vAttrs, VEC_ATTR_GLOBAL_BDD); }
+static inline void * Abc_NtkGlobalBdd( Abc_Ntk_t * pNtk ) { return (void *)Vec_PtrEntry(pNtk->vAttrs, VEC_ATTR_GLOBAL_BDD); }
static inline DdManager * Abc_NtkGlobalBddMan( Abc_Ntk_t * pNtk ) { return (DdManager *)Vec_AttMan( (Vec_Att_t *)Abc_NtkGlobalBdd(pNtk) ); }
static inline DdNode ** Abc_NtkGlobalBddArray( Abc_Ntk_t * pNtk ) { return (DdNode **)Vec_AttArray( (Vec_Att_t *)Abc_NtkGlobalBdd(pNtk) ); }
static inline DdNode * Abc_ObjGlobalBdd( Abc_Obj_t * pObj ) { return (DdNode *)Vec_AttEntry( (Vec_Att_t *)Abc_NtkGlobalBdd(pObj->pNtk), pObj->Id ); }
diff --git a/src/base/abc/abcBlifMv.c b/src/base/abc/abcBlifMv.c
index f945696e..3d6730e7 100644
--- a/src/base/abc/abcBlifMv.c
+++ b/src/base/abc/abcBlifMv.c
@@ -43,7 +43,7 @@ void Abc_NtkStartMvVars( Abc_Ntk_t * pNtk )
{
Vec_Att_t * pAttMan;
assert( Abc_NtkMvVar(pNtk) == NULL );
- pAttMan = Vec_AttAlloc( 0, Abc_NtkObjNumMax(pNtk) + 1, Extra_MmFlexStart(), Extra_MmFlexStop, NULL, NULL );
+ pAttMan = Vec_AttAlloc( Abc_NtkObjNumMax(pNtk) + 1, Extra_MmFlexStart(), (void(*)(void*))Extra_MmFlexStop, NULL, NULL );
Vec_PtrWriteEntry( pNtk->vAttrs, VEC_ATTR_MVVAR, pAttMan );
//printf( "allocing attr\n" );
}
diff --git a/src/base/abc/abcCheck.c b/src/base/abc/abcCheck.c
index a78632d2..e538bd64 100644
--- a/src/base/abc/abcCheck.c
+++ b/src/base/abc/abcCheck.c
@@ -234,7 +234,7 @@ bool Abc_NtkDoCheck( Abc_Ntk_t * pNtk )
***********************************************************************/
bool Abc_NtkCheckNames( Abc_Ntk_t * pNtk )
{
- Abc_Obj_t * pObj;
+ Abc_Obj_t * pObj = NULL; // Ensure pObj isn't used uninitialized.
Vec_Int_t * vNameIds;
char * pName;
int i, NameId;
@@ -262,6 +262,8 @@ bool Abc_NtkCheckNames( Abc_Ntk_t * pNtk )
}
}
+ assert(pObj); // pObj should point to something here.
+
// return the array of all IDs, which have names
vNameIds = Nm_ManReturnNameIds( pNtk->pManName );
// make sure that these IDs correspond to live objects
@@ -571,10 +573,10 @@ bool Abc_NtkCheckLatch( Abc_Ntk_t * pNtk, Abc_Obj_t * pLatch )
Value = 0;
}
// make sure the latch has a reasonable return value
- if ( (int)pLatch->pData < ABC_INIT_ZERO || (int)pLatch->pData > ABC_INIT_DC )
+ if ( (int)(PORT_PTRINT_T)pLatch->pData < ABC_INIT_ZERO || (int)(PORT_PTRINT_T)pLatch->pData > ABC_INIT_DC )
{
fprintf( stdout, "NodeCheck: Latch \"%s\" has incorrect reset value (%d).\n",
- Abc_ObjName(pLatch), (int)pLatch->pData );
+ Abc_ObjName(pLatch), (int)(PORT_PTRINT_T)pLatch->pData );
Value = 0;
}
// make sure the latch has only one fanin
@@ -857,7 +859,7 @@ int Abc_NtkCheckUniqueCiNames( Abc_Ntk_t * pNtk )
for ( i = 1; i < Abc_NtkCiNum(pNtk); i++ )
if ( !strcmp( Vec_PtrEntry(vNames,i-1), Vec_PtrEntry(vNames,i) ) )
{
- printf( "Abc_NtkCheck: Repeated CI names: %s and %s.\n", Vec_PtrEntry(vNames,i-1), Vec_PtrEntry(vNames,i) );
+ printf( "Abc_NtkCheck: Repeated CI names: %s and %s.\n", (char*)Vec_PtrEntry(vNames,i-1), (char*)Vec_PtrEntry(vNames,i) );
fRetValue = 0;
}
Vec_PtrFree( vNames );
@@ -890,7 +892,7 @@ int Abc_NtkCheckUniqueCoNames( Abc_Ntk_t * pNtk )
// printf( "%s\n", Vec_PtrEntry(vNames,i) );
if ( !strcmp( Vec_PtrEntry(vNames,i-1), Vec_PtrEntry(vNames,i) ) )
{
- printf( "Abc_NtkCheck: Repeated CO names: %s and %s.\n", Vec_PtrEntry(vNames,i-1), Vec_PtrEntry(vNames,i) );
+ printf( "Abc_NtkCheck: Repeated CO names: %s and %s.\n", (char*)Vec_PtrEntry(vNames,i-1), (char*)Vec_PtrEntry(vNames,i) );
fRetValue = 0;
}
}
diff --git a/src/base/abc/abcDfs.c b/src/base/abc/abcDfs.c
index b5fb81db..8759500b 100644
--- a/src/base/abc/abcDfs.c
+++ b/src/base/abc/abcDfs.c
@@ -197,10 +197,11 @@ Vec_Ptr_t * Abc_NtkDfsReverse( Abc_Ntk_t * pNtk )
Abc_NtkDfsReverse_rec( pFanout, vNodes );
}
// add constant nodes in the end
- if ( !Abc_NtkIsStrash(pNtk) )
+ if ( !Abc_NtkIsStrash(pNtk) ) {
Abc_NtkForEachNode( pNtk, pObj, i )
if ( Abc_NodeIsConst(pObj) )
Vec_PtrPush( vNodes, pObj );
+ }
return vNodes;
}
@@ -492,7 +493,7 @@ void Abc_NtkDfs_iter( Vec_Ptr_t * vStack, Abc_Obj_t * pRoot, Vec_Ptr_t * vNodes
while ( Vec_PtrSize(vStack) > 0 )
{
// get the node and its fanin
- iFanin = (int)Vec_PtrPop(vStack);
+ iFanin = (int)(PORT_PTRINT_T)Vec_PtrPop(vStack);
pNode = Vec_PtrPop(vStack);
assert( !Abc_ObjIsNet(pNode) );
// add it to the array of nodes if we finished
@@ -503,7 +504,7 @@ void Abc_NtkDfs_iter( Vec_Ptr_t * vStack, Abc_Obj_t * pRoot, Vec_Ptr_t * vNodes
}
// explore the next fanin
Vec_PtrPush( vStack, pNode );
- Vec_PtrPush( vStack, (void *)(iFanin+1) );
+ Vec_PtrPush( vStack, (void *)(PORT_PTRINT_T)(iFanin+1) );
// get the fanin
pFanin = Abc_ObjFanin0Ntk( Abc_ObjFanin(pNode,iFanin) );
// if this node is already visited, skip
@@ -1112,7 +1113,7 @@ bool Abc_NtkIsAcyclic_rec( Abc_Obj_t * pNode )
Abc_NodeSetTravIdCurrent( pNode );
// visit the transitive fanin
Abc_ObjForEachFanin( pNode, pFanin, i )
- {
+ {
pFanin = Abc_ObjFanin0Ntk(pFanin);
// make sure there is no mixing of networks
assert( pFanin->pNtk == pNode->pNtk );
@@ -1120,7 +1121,7 @@ bool Abc_NtkIsAcyclic_rec( Abc_Obj_t * pNode )
if ( Abc_NodeIsTravIdPrevious(pFanin) )
continue;
// traverse the fanin's cone searching for the loop
- if ( fAcyclic = Abc_NtkIsAcyclic_rec(pFanin) )
+ if ( (fAcyclic = Abc_NtkIsAcyclic_rec(pFanin)) )
continue;
// return as soon as the loop is detected
fprintf( stdout, " %s ->", Abc_ObjName(pFanin) );
@@ -1135,7 +1136,7 @@ bool Abc_NtkIsAcyclic_rec( Abc_Obj_t * pNode )
if ( Abc_NodeIsTravIdPrevious(pFanin) )
continue;
// traverse the fanin's cone searching for the loop
- if ( fAcyclic = Abc_NtkIsAcyclic_rec(pFanin) )
+ if ( (fAcyclic = Abc_NtkIsAcyclic_rec(pFanin)) )
continue;
// return as soon as the loop is detected
fprintf( stdout, " %s", Abc_ObjName(pFanin) );
@@ -1184,7 +1185,7 @@ bool Abc_NtkIsAcyclic( Abc_Ntk_t * pNtk )
if ( Abc_NodeIsTravIdPrevious(pNode) )
continue;
// traverse the output logic cone
- if ( fAcyclic = Abc_NtkIsAcyclic_rec(pNode) )
+ if ( (fAcyclic = Abc_NtkIsAcyclic_rec(pNode)) )
continue;
// stop as soon as the first loop is detected
fprintf( stdout, " CO \"%s\"\n", Abc_ObjName(Abc_ObjFanout0(pNode)) );
@@ -1211,7 +1212,7 @@ int Abc_NodeSetChoiceLevel_rec( Abc_Obj_t * pNode, int fMaximum )
int Level1, Level2, Level, LevelE;
// skip the visited node
if ( Abc_NodeIsTravIdCurrent( pNode ) )
- return (int)pNode->pCopy;
+ return (int)(PORT_PTRINT_T)pNode->pCopy;
Abc_NodeSetTravIdCurrent( pNode );
// compute levels of the children nodes
Level1 = Abc_NodeSetChoiceLevel_rec( Abc_ObjFanin0(pNode), fMaximum );
@@ -1226,9 +1227,9 @@ int Abc_NodeSetChoiceLevel_rec( Abc_Obj_t * pNode, int fMaximum )
Level = ABC_MIN( Level, LevelE );
// set the level of all equivalent nodes to be the same minimum
for ( pTemp = pNode->pData; pTemp; pTemp = pTemp->pData )
- pTemp->pCopy = (void *)Level;
+ pTemp->pCopy = (void *)(PORT_PTRINT_T)Level;
}
- pNode->pCopy = (void *)Level;
+ pNode->pCopy = (void *)(PORT_PTRINT_T)Level;
return Level;
}
@@ -1297,7 +1298,7 @@ Vec_Ptr_t * Abc_AigGetLevelizedOrder( Abc_Ntk_t * pNtk, int fCollectCis )
vLevels = Vec_PtrStart( LevelMax + 1 );
Abc_NtkForEachNode( pNtk, pNode, i )
{
- ppHead = ((Abc_Obj_t **)vLevels->pArray) + (int)pNode->pCopy;
+ ppHead = ((Abc_Obj_t **)vLevels->pArray) + (int)(PORT_PTRINT_T)pNode->pCopy;
pNode->pCopy = *ppHead;
*ppHead = pNode;
}
diff --git a/src/base/abc/abcFanio.c b/src/base/abc/abcFanio.c
index 9f60b0bc..14b2b0c1 100644
--- a/src/base/abc/abcFanio.c
+++ b/src/base/abc/abcFanio.c
@@ -90,14 +90,8 @@ void Abc_ObjAddFanin( Abc_Obj_t * pObj, Abc_Obj_t * pFanin )
Abc_ObjSetFaninC( pObj, Abc_ObjFaninNum(pObj)-1 );
if ( Abc_ObjIsNet(pObj) && Abc_ObjFaninNum(pObj) > 1 )
{
- int x = 0;
+ printf( "Abc_ObjAddFanin(): Error! Creating net with two fanins.\n" );
}
- if ( pObj->Id == 1960 )
- {
- int x = 0;
- }
-// printf( "Adding fanin of %s ", Abc_ObjName(pObj) );
-// printf( "to be %s\n", Abc_ObjName(pFanin) );
}
diff --git a/src/base/abc/abcLatch.c b/src/base/abc/abcLatch.c
index 4529d9f3..79b60cf9 100644
--- a/src/base/abc/abcLatch.c
+++ b/src/base/abc/abcLatch.c
@@ -208,7 +208,7 @@ void Abc_NtkInsertLatchValues( Abc_Ntk_t * pNtk, Vec_Int_t * vValues )
Abc_Obj_t * pLatch;
int i;
Abc_NtkForEachLatch( pNtk, pLatch, i )
- pLatch->pData = (void *)(vValues? (Vec_IntEntry(vValues,i)? ABC_INIT_ONE : ABC_INIT_ZERO) : ABC_INIT_DC);
+ pLatch->pData = (void *)(PORT_PTRINT_T)(vValues? (Vec_IntEntry(vValues,i)? ABC_INIT_ONE : ABC_INIT_ZERO) : ABC_INIT_DC);
}
/**Function*************************************************************
@@ -340,7 +340,7 @@ Vec_Ptr_t * Abc_NtkConverLatchNamesIntoNumbers( Abc_Ntk_t * pNtk )
return NULL;
// set register numbers
Abc_NtkForEachLatch( pNtk, pObj, i )
- pObj->pNext = (Abc_Obj_t *)i;
+ pObj->pNext = (Abc_Obj_t *)(PORT_PTRINT_T)i;
// add the numbers
vResult = Vec_PtrAlloc( Vec_PtrSize(pNtk->vOnehots) );
Vec_PtrForEachEntry( pNtk->vOnehots, vNames, i )
@@ -354,7 +354,7 @@ Vec_Ptr_t * Abc_NtkConverLatchNamesIntoNumbers( Abc_Ntk_t * pNtk )
pObj = Abc_NtkObj( pNtk, Num );
if ( Abc_ObjFaninNum(pObj) != 1 || !Abc_ObjIsLatch(Abc_ObjFanin0(pObj)) )
continue;
- Vec_IntPush( vNumbers, (int)pObj->pNext );
+ Vec_IntPush( vNumbers, (int)(PORT_PTRINT_T)pObj->pNext );
}
if ( Vec_IntSize( vNumbers ) > 1 )
{
diff --git a/src/base/abc/abcNtk.c b/src/base/abc/abcNtk.c
index 4d543547..88bcda69 100644
--- a/src/base/abc/abcNtk.c
+++ b/src/base/abc/abcNtk.c
@@ -932,7 +932,7 @@ void Abc_NtkDelete( Abc_Ntk_t * pNtk )
Abc_Obj_t * pObj;
void * pAttrMan;
int TotalMemory, i;
- int LargePiece = (4 << ABC_NUM_STEPS);
+// int LargePiece = (4 << ABC_NUM_STEPS);
if ( pNtk == NULL )
return;
// free the HAIG
diff --git a/src/base/abc/abcObj.c b/src/base/abc/abcObj.c
index 79bf41a1..a79eb5a7 100644
--- a/src/base/abc/abcObj.c
+++ b/src/base/abc/abcObj.c
@@ -70,7 +70,7 @@ Abc_Obj_t * Abc_ObjAlloc( Abc_Ntk_t * pNtk, Abc_ObjType_t Type )
void Abc_ObjRecycle( Abc_Obj_t * pObj )
{
Abc_Ntk_t * pNtk = pObj->pNtk;
- int LargePiece = (4 << ABC_NUM_STEPS);
+// int LargePiece = (4 << ABC_NUM_STEPS);
// free large fanout arrays
// if ( pNtk->pMmStep && pObj->vFanouts.nCap * 4 > LargePiece )
// FREE( pObj->vFanouts.pArray );
diff --git a/src/base/abc/abcShow.c b/src/base/abc/abcShow.c
index 3bac7316..2b406e81 100644
--- a/src/base/abc/abcShow.c
+++ b/src/base/abc/abcShow.c
@@ -20,8 +20,11 @@
#ifdef WIN32
#include <process.h>
+#else
+#include <unistd.h>
#endif
+
#include "abc.h"
#include "main.h"
#include "ioAbc.h"
diff --git a/src/base/abc/abcSop.c b/src/base/abc/abcSop.c
index b2d6b649..d1d1a468 100644
--- a/src/base/abc/abcSop.c
+++ b/src/base/abc/abcSop.c
@@ -804,7 +804,7 @@ bool Abc_SopCheck( char * pSop, int nFanins )
if ( pCubes - pCubesOld != nFanins )
{
fprintf( stdout, "Abc_SopCheck: SOP has a mismatch between its cover size (%d) and its fanin number (%d).\n",
- pCubes - pCubesOld, nFanins );
+ (int)(PORT_PTRDIFF_T)(pCubes - pCubesOld), nFanins );
return 0;
}
// check the output values for this cube
diff --git a/src/base/abc/abcUtil.c b/src/base/abc/abcUtil.c
index d3d32b98..39f44c11 100644
--- a/src/base/abc/abcUtil.c
+++ b/src/base/abc/abcUtil.c
@@ -1536,9 +1536,9 @@ void Abc_NtkTransferCopy( Abc_Ntk_t * pNtk )
static inline int Abc_ObjCrossCutInc( Abc_Obj_t * pObj )
{
// pObj->pCopy = (void *)(((int)pObj->pCopy)++);
- int Value = (int)pObj->pCopy;
- pObj->pCopy = (void *)(Value + 1);
- return (int)pObj->pCopy == Abc_ObjFanoutNum(pObj);
+ int Value = (int)(PORT_PTRINT_T)pObj->pCopy;
+ pObj->pCopy = (void *)(PORT_PTRINT_T)(Value + 1);
+ return (int)(PORT_PTRINT_T)pObj->pCopy == Abc_ObjFanoutNum(pObj);
}
/**Function*************************************************************