diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2009-01-18 08:01:00 -0800 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2009-01-18 08:01:00 -0800 |
commit | f936cc0680c98ffe51b3a1716c996072d5dbf76c (patch) | |
tree | 784a2a809fb6b972ec6a8e2758ab758ca590d01a /src/aig/hop | |
parent | c9ad5880cc61787dec6d018111b63023407ce0e6 (diff) | |
download | abc-f936cc0680c98ffe51b3a1716c996072d5dbf76c.tar.gz abc-f936cc0680c98ffe51b3a1716c996072d5dbf76c.tar.bz2 abc-f936cc0680c98ffe51b3a1716c996072d5dbf76c.zip |
Version abc90118
Diffstat (limited to 'src/aig/hop')
-rw-r--r-- | src/aig/hop/hop.h | 5 | ||||
-rw-r--r-- | src/aig/hop/hopObj.c | 1 | ||||
-rw-r--r-- | src/aig/hop/hopTruth.c | 12 |
3 files changed, 15 insertions, 3 deletions
diff --git a/src/aig/hop/hop.h b/src/aig/hop/hop.h index db4799ca..6ffc4eac 100644 --- a/src/aig/hop/hop.h +++ b/src/aig/hop/hop.h @@ -64,7 +64,10 @@ typedef enum { struct Hop_Obj_t_ // 6 words { void * pData; // misc - Hop_Obj_t * pNext; // strashing table + union { + Hop_Obj_t * pNext; // strashing table + int PioNum; // the number of PI/PO + }; Hop_Obj_t * pFanin0; // fanin Hop_Obj_t * pFanin1; // fanin unsigned int Type : 3; // object type diff --git a/src/aig/hop/hopObj.c b/src/aig/hop/hopObj.c index 69f63ee6..f173248f 100644 --- a/src/aig/hop/hopObj.c +++ b/src/aig/hop/hopObj.c @@ -44,6 +44,7 @@ Hop_Obj_t * Hop_ObjCreatePi( Hop_Man_t * p ) Hop_Obj_t * pObj; pObj = Hop_ManFetchMemory( p ); pObj->Type = AIG_PI; + pObj->PioNum = Vec_PtrSize( p->vPis ); Vec_PtrPush( p->vPis, pObj ); p->nObjs[AIG_PI]++; return pObj; diff --git a/src/aig/hop/hopTruth.c b/src/aig/hop/hopTruth.c index 47358715..42ded3ed 100644 --- a/src/aig/hop/hopTruth.c +++ b/src/aig/hop/hopTruth.c @@ -44,6 +44,12 @@ static inline void Hop_ManTruthFill( unsigned * pOut, int nVars ) for ( w = Hop_ManTruthWordNum(nVars)-1; w >= 0; w-- ) pOut[w] = ~(unsigned)0; } +static inline void Hop_ManTruthNot( unsigned * pOut, unsigned * pIn, int nVars ) +{ + int w; + for ( w = Hop_ManTruthWordNum(nVars)-1; w >= 0; w-- ) + pOut[w] = ~pIn[w]; +} //////////////////////////////////////////////////////////////////////// /// FUNCTION DEFINITIONS /// @@ -155,7 +161,7 @@ unsigned * Hop_ManConvertAigToTruth( Hop_Man_t * p, Hop_Obj_t * pRoot, int nVars vTtElems = NULL; // clear the data fields and set marks - nNodes = Hop_ManConvertAigToTruth_rec1( pRoot ); + nNodes = Hop_ManConvertAigToTruth_rec1( Hop_Regular(pRoot) ); // prepare memory nWords = Hop_TruthWordNum( nVars ); Vec_IntClear( vTruth ); @@ -199,9 +205,11 @@ unsigned * Hop_ManConvertAigToTruth( Hop_Man_t * p, Hop_Obj_t * pRoot, int nVars } } // clear the marks and compute the truth table - pTruth2 = Hop_ManConvertAigToTruth_rec2( pRoot, vTruth, nWords ); + pTruth2 = Hop_ManConvertAigToTruth_rec2( Hop_Regular(pRoot), vTruth, nWords ); // copy the result Hop_ManTruthCopy( pTruth, pTruth2, nVars ); + if ( Hop_IsComplement(pRoot) ) + Hop_ManTruthNot( pTruth, pTruth, nVars ); if ( vTtElems ) Vec_PtrFree( vTtElems ); return pTruth; |