diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2008-07-02 08:01:00 -0700 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2008-07-02 08:01:00 -0700 |
commit | 303baf27cf34c2a57db97c4c567fd744241fa14b (patch) | |
tree | d6235cca48e7bdfe5884e517058c7791e66bb806 /src/aig/hop | |
parent | fa67e3c19e27c011517b91182eb3929412aaf402 (diff) | |
download | abc-303baf27cf34c2a57db97c4c567fd744241fa14b.tar.gz abc-303baf27cf34c2a57db97c4c567fd744241fa14b.tar.bz2 abc-303baf27cf34c2a57db97c4c567fd744241fa14b.zip |
Version abc80702
Diffstat (limited to 'src/aig/hop')
-rw-r--r-- | src/aig/hop/hop.h | 12 | ||||
-rw-r--r-- | src/aig/hop/hopDfs.c | 8 | ||||
-rw-r--r-- | src/aig/hop/hopMem.c | 2 | ||||
-rw-r--r-- | src/aig/hop/hopOper.c | 2 | ||||
-rw-r--r-- | src/aig/hop/hopUtil.c | 28 |
5 files changed, 26 insertions, 26 deletions
diff --git a/src/aig/hop/hop.h b/src/aig/hop/hop.h index 05e6471e..db4799ca 100644 --- a/src/aig/hop/hop.h +++ b/src/aig/hop/hop.h @@ -166,13 +166,13 @@ static inline int Hop_ObjIsMarkA( Hop_Obj_t * pObj ) { return pObj- static inline void Hop_ObjSetMarkA( Hop_Obj_t * pObj ) { pObj->fMarkA = 1; } static inline void Hop_ObjClearMarkA( Hop_Obj_t * pObj ) { pObj->fMarkA = 0; } -static inline void Hop_ObjSetTravId( Hop_Obj_t * pObj, int TravId ) { pObj->pData = (void *)(long)TravId; } -static inline void Hop_ObjSetTravIdCurrent( Hop_Man_t * p, Hop_Obj_t * pObj ) { pObj->pData = (void *)(long)p->nTravIds; } -static inline void Hop_ObjSetTravIdPrevious( Hop_Man_t * p, Hop_Obj_t * pObj ) { pObj->pData = (void *)(long)(p->nTravIds - 1); } -static inline int Hop_ObjIsTravIdCurrent( Hop_Man_t * p, Hop_Obj_t * pObj ) { return (int)((int)(long)pObj->pData == p->nTravIds); } -static inline int Hop_ObjIsTravIdPrevious( Hop_Man_t * p, Hop_Obj_t * pObj ) { return (int)((int)(long)pObj->pData == p->nTravIds - 1); } +static inline void Hop_ObjSetTravId( Hop_Obj_t * pObj, int TravId ) { pObj->pData = (void *)(PORT_PTRINT_T)TravId; } +static inline void Hop_ObjSetTravIdCurrent( Hop_Man_t * p, Hop_Obj_t * pObj ) { pObj->pData = (void *)(PORT_PTRINT_T)p->nTravIds; } +static inline void Hop_ObjSetTravIdPrevious( Hop_Man_t * p, Hop_Obj_t * pObj ) { pObj->pData = (void *)(PORT_PTRINT_T)(p->nTravIds - 1); } +static inline int Hop_ObjIsTravIdCurrent( Hop_Man_t * p, Hop_Obj_t * pObj ) { return (int)((int)(PORT_PTRINT_T)pObj->pData == p->nTravIds); } +static inline int Hop_ObjIsTravIdPrevious( Hop_Man_t * p, Hop_Obj_t * pObj ) { return (int)((int)(PORT_PTRINT_T)pObj->pData == p->nTravIds - 1); } -static inline int Hop_ObjTravId( Hop_Obj_t * pObj ) { return (int)pObj->pData; } +static inline int Hop_ObjTravId( Hop_Obj_t * pObj ) { return (int)(PORT_PTRINT_T)pObj->pData; } static inline int Hop_ObjPhase( Hop_Obj_t * pObj ) { return pObj->fPhase; } static inline int Hop_ObjRefs( Hop_Obj_t * pObj ) { return pObj->nRefs; } static inline void Hop_ObjRef( Hop_Obj_t * pObj ) { pObj->nRefs++; } diff --git a/src/aig/hop/hopDfs.c b/src/aig/hop/hopDfs.c index d798bc35..29963f6d 100644 --- a/src/aig/hop/hopDfs.c +++ b/src/aig/hop/hopDfs.c @@ -123,15 +123,15 @@ int Hop_ManCountLevels( Hop_Man_t * p ) vNodes = Hop_ManDfs( p ); Vec_PtrForEachEntry( vNodes, pObj, i ) { - Level0 = (int)Hop_ObjFanin0(pObj)->pData; - Level1 = (int)Hop_ObjFanin1(pObj)->pData; - pObj->pData = (void *)(1 + Hop_ObjIsExor(pObj) + AIG_MAX(Level0, Level1)); + Level0 = (int)(PORT_PTRUINT_T)Hop_ObjFanin0(pObj)->pData; + Level1 = (int)(PORT_PTRUINT_T)Hop_ObjFanin1(pObj)->pData; + pObj->pData = (void *)(PORT_PTRUINT_T)(1 + Hop_ObjIsExor(pObj) + AIG_MAX(Level0, Level1)); } Vec_PtrFree( vNodes ); // get levels of the POs LevelsMax = 0; Hop_ManForEachPo( p, pObj, i ) - LevelsMax = AIG_MAX( LevelsMax, (int)Hop_ObjFanin0(pObj)->pData ); + LevelsMax = AIG_MAX( LevelsMax, (int)(PORT_PTRUINT_T)Hop_ObjFanin0(pObj)->pData ); return LevelsMax; } diff --git a/src/aig/hop/hopMem.c b/src/aig/hop/hopMem.c index 0665470a..60f89d53 100644 --- a/src/aig/hop/hopMem.c +++ b/src/aig/hop/hopMem.c @@ -95,7 +95,7 @@ void Hop_ManAddMemory( Hop_Man_t * p ) pMemory = ALLOC( char, nBytes ); Vec_PtrPush( p->vChunks, pMemory ); // align memory at the 32-byte boundary - pMemory = pMemory + 64 - (((int)pMemory) & 63); + pMemory = pMemory + 64 - (((int)(PORT_PTRUINT_T)pMemory) & 63); // remember the manager in the first entry Vec_PtrPush( p->vPages, pMemory ); // break the memory down into nodes diff --git a/src/aig/hop/hopOper.c b/src/aig/hop/hopOper.c index a31ca0f2..0ecb8d61 100644 --- a/src/aig/hop/hopOper.c +++ b/src/aig/hop/hopOper.c @@ -116,7 +116,7 @@ Hop_Obj_t * Hop_And( Hop_Man_t * p, Hop_Obj_t * p0, Hop_Obj_t * p1 ) // return Hop_Exor( p, pFan0, pFan1 ); // check the table pGhost = Hop_ObjCreateGhost( p, p0, p1, AIG_AND ); - if ( pResult = Hop_TableLookup( p, pGhost ) ) + if ( (pResult = Hop_TableLookup( p, pGhost )) ) return pResult; return Hop_ObjCreate( p, pGhost ); } diff --git a/src/aig/hop/hopUtil.c b/src/aig/hop/hopUtil.c index 87fdb15e..d9dbbcaa 100644 --- a/src/aig/hop/hopUtil.c +++ b/src/aig/hop/hopUtil.c @@ -333,7 +333,7 @@ void Hop_ObjPrintEqn( FILE * pFile, Hop_Obj_t * pObj, Vec_Vec_t * vLevels, int L // PI case if ( Hop_ObjIsPi(pObj) ) { - fprintf( pFile, "%s%s", fCompl? "!" : "", pObj->pData ); + fprintf( pFile, "%s%s", fCompl? "!" : "", (char*)pObj->pData ); return; } // AND case @@ -380,7 +380,7 @@ void Hop_ObjPrintVerilog( FILE * pFile, Hop_Obj_t * pObj, Vec_Vec_t * vLevels, i // PI case if ( Hop_ObjIsPi(pObj) ) { - fprintf( pFile, "%s%s", fCompl? "~" : "", pObj->pData ); + fprintf( pFile, "%s%s", fCompl? "~" : "", (char*)pObj->pData ); return; } // EXOR case @@ -516,13 +516,13 @@ void Hop_ManDumpBlif( Hop_Man_t * p, char * pFileName ) // collect nodes in the DFS order vNodes = Hop_ManDfs( p ); // assign IDs to objects - Hop_ManConst1(p)->pData = (void *)Counter++; + Hop_ManConst1(p)->pData = (void *)(PORT_PTRUINT_T)Counter++; Hop_ManForEachPi( p, pObj, i ) - pObj->pData = (void *)Counter++; + pObj->pData = (void *)(PORT_PTRUINT_T)Counter++; Hop_ManForEachPo( p, pObj, i ) - pObj->pData = (void *)Counter++; + pObj->pData = (void *)(PORT_PTRUINT_T)Counter++; Vec_PtrForEachEntry( vNodes, pObj, i ) - pObj->pData = (void *)Counter++; + pObj->pData = (void *)(PORT_PTRUINT_T)Counter++; nDigits = Hop_Base10Log( Counter ); // write the file pFile = fopen( pFileName, "w" ); @@ -532,34 +532,34 @@ void Hop_ManDumpBlif( Hop_Man_t * p, char * pFileName ) // write PIs fprintf( pFile, ".inputs" ); Hop_ManForEachPi( p, pObj, i ) - fprintf( pFile, " n%0*d", nDigits, (int)pObj->pData ); + fprintf( pFile, " n%0*d", nDigits, (int)(PORT_PTRUINT_T)pObj->pData ); fprintf( pFile, "\n" ); // write POs fprintf( pFile, ".outputs" ); Hop_ManForEachPo( p, pObj, i ) - fprintf( pFile, " n%0*d", nDigits, (int)pObj->pData ); + fprintf( pFile, " n%0*d", nDigits, (int)(PORT_PTRUINT_T)pObj->pData ); fprintf( pFile, "\n" ); // write nodes Vec_PtrForEachEntry( vNodes, pObj, i ) { fprintf( pFile, ".names n%0*d n%0*d n%0*d\n", - nDigits, (int)Hop_ObjFanin0(pObj)->pData, - nDigits, (int)Hop_ObjFanin1(pObj)->pData, - nDigits, (int)pObj->pData ); + nDigits, (int)(PORT_PTRUINT_T)Hop_ObjFanin0(pObj)->pData, + nDigits, (int)(PORT_PTRUINT_T)Hop_ObjFanin1(pObj)->pData, + nDigits, (int)(PORT_PTRUINT_T)pObj->pData ); fprintf( pFile, "%d%d 1\n", !Hop_ObjFaninC0(pObj), !Hop_ObjFaninC1(pObj) ); } // write POs Hop_ManForEachPo( p, pObj, i ) { fprintf( pFile, ".names n%0*d n%0*d\n", - nDigits, (int)Hop_ObjFanin0(pObj)->pData, - nDigits, (int)pObj->pData ); + nDigits, (int)(PORT_PTRUINT_T)Hop_ObjFanin0(pObj)->pData, + nDigits, (int)(PORT_PTRUINT_T)pObj->pData ); fprintf( pFile, "%d 1\n", !Hop_ObjFaninC0(pObj) ); if ( Hop_ObjIsConst1(Hop_ObjFanin0(pObj)) ) pConst1 = Hop_ManConst1(p); } if ( pConst1 ) - fprintf( pFile, ".names n%0*d\n 1\n", nDigits, (int)pConst1->pData ); + fprintf( pFile, ".names n%0*d\n 1\n", nDigits, (int)(PORT_PTRUINT_T)pConst1->pData ); fprintf( pFile, ".end\n\n" ); fclose( pFile ); Vec_PtrFree( vNodes ); |