summaryrefslogtreecommitdiffstats
path: root/src/aig/hop
diff options
context:
space:
mode:
Diffstat (limited to 'src/aig/hop')
-rw-r--r--src/aig/hop/hop.h5
-rw-r--r--src/aig/hop/hopObj.c1
-rw-r--r--src/aig/hop/hopTruth.c12
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;