summaryrefslogtreecommitdiffstats
path: root/src/aig/gia/giaTruth.c
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2016-01-16 17:35:46 -0800
committerAlan Mishchenko <alanmi@berkeley.edu>2016-01-16 17:35:46 -0800
commitf5ee46eb3c2c691e4bafc5b7a7dbe3be16bef5dd (patch)
tree751dbb7242b7716919c744748c0ef09ed43581b5 /src/aig/gia/giaTruth.c
parent579bcccc651bb1d1ebe4011259f75ba32f76921a (diff)
downloadabc-f5ee46eb3c2c691e4bafc5b7a7dbe3be16bef5dd.tar.gz
abc-f5ee46eb3c2c691e4bafc5b7a7dbe3be16bef5dd.tar.bz2
abc-f5ee46eb3c2c691e4bafc5b7a7dbe3be16bef5dd.zip
New command to dump LUT network.
Diffstat (limited to 'src/aig/gia/giaTruth.c')
-rw-r--r--src/aig/gia/giaTruth.c42
1 files changed, 42 insertions, 0 deletions
diff --git a/src/aig/gia/giaTruth.c b/src/aig/gia/giaTruth.c
index f05e2f68..56cf8785 100644
--- a/src/aig/gia/giaTruth.c
+++ b/src/aig/gia/giaTruth.c
@@ -54,6 +54,48 @@ static inline word * Gla_ObjTruthDup( Gia_Man_t * p, word * pDst, word * pSrc, i
/**Function*************************************************************
+ Synopsis [Compute truth table.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+word Gia_LutComputeTruth6_rec( Gia_Man_t * p, int iNode, Vec_Wrd_t * vTruths )
+{
+ Gia_Obj_t * pObj;
+ word Truth0, Truth1;
+ if ( Gia_ObjIsTravIdCurrentId(p, iNode) )
+ return Vec_WrdEntry(vTruths, iNode);
+ Gia_ObjSetTravIdCurrentId(p, iNode);
+ pObj = Gia_ManObj( p, iNode );
+ assert( Gia_ObjIsAnd(pObj) );
+ Truth0 = Gia_LutComputeTruth6_rec( p, Gia_ObjFaninId0p(p, pObj), vTruths );
+ Truth1 = Gia_LutComputeTruth6_rec( p, Gia_ObjFaninId1p(p, pObj), vTruths );
+ if ( Gia_ObjFaninC0(pObj) )
+ Truth0 = ~Truth0;
+ if ( Gia_ObjFaninC1(pObj) )
+ Truth1 = ~Truth1;
+ Vec_WrdWriteEntry( vTruths, iNode, Truth0 & Truth1 );
+ return Truth0 & Truth1;
+}
+word Gia_LutComputeTruth6( Gia_Man_t * p, int iObj, Vec_Wrd_t * vTruths )
+{
+ int k, iFan;
+ assert( Gia_ObjIsLut(p, iObj) );
+ Gia_ManIncrementTravId( p );
+ Gia_LutForEachFanin( p, iObj, iFan, k )
+ {
+ Vec_WrdWriteEntry( vTruths, iFan, s_Truths6[k] );
+ Gia_ObjSetTravIdCurrentId( p, iFan );
+ }
+ return Gia_LutComputeTruth6_rec( p, iObj, vTruths );
+}
+
+/**Function*************************************************************
+
Synopsis [Computes truth table of a 6-LUT.]
Description []