diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2019-05-25 18:39:45 -0700 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2019-05-25 18:39:45 -0700 |
commit | 890ff42cb7c80acf3dc4023b7ea430aa283cd8aa (patch) | |
tree | 1fd4743a9fc1340a2b1d7979b0b232b8e5f4fb55 /src/aig | |
parent | 91b542815488fe23c2d625e69eb2a1add12cf1fe (diff) | |
download | abc-890ff42cb7c80acf3dc4023b7ea430aa283cd8aa.tar.gz abc-890ff42cb7c80acf3dc4023b7ea430aa283cd8aa.tar.bz2 abc-890ff42cb7c80acf3dc4023b7ea430aa283cd8aa.zip |
Adding command &print_truth to print truth tables for primary outputs.
Diffstat (limited to 'src/aig')
-rw-r--r-- | src/aig/gia/giaTruth.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/src/aig/gia/giaTruth.c b/src/aig/gia/giaTruth.c index 86f17594..2062f2ad 100644 --- a/src/aig/gia/giaTruth.c +++ b/src/aig/gia/giaTruth.c @@ -63,6 +63,40 @@ static inline word * Gla_ObjTruthDup( Gia_Man_t * p, word * pDst, word * pSrc, i SeeAlso [] ***********************************************************************/ +word Gia_LutComputeTruth6Simple_rec( Gia_Man_t * p, int iObj ) +{ + word Truth0, Truth1, Truth; + Gia_Obj_t * pObj = Gia_ManObj(p, iObj); + if ( Gia_ObjIsConst0(pObj) ) + return 0; + if ( Gia_ObjIsCi(pObj) ) + return s_Truths6[Gia_ObjCioId(pObj)]; + Truth0 = Gia_LutComputeTruth6Simple_rec( p, Gia_ObjFaninId0(pObj, iObj) ); + Truth1 = Gia_LutComputeTruth6Simple_rec( p, Gia_ObjFaninId1(pObj, iObj) ); + Truth0 = Gia_ObjFaninC0(pObj) ? ~Truth0 : Truth0; + Truth1 = Gia_ObjFaninC1(pObj) ? ~Truth1 : Truth1; + Truth = Gia_ObjIsXor(pObj) ? Truth0 ^ Truth1 : Truth0 & Truth1; + return Truth; +} +word Gia_LutComputeTruth6Simple( Gia_Man_t * p, int iPo ) +{ + Gia_Obj_t * pObj = Gia_ManPo( p, iPo ); + word Truth = Gia_LutComputeTruth6Simple_rec( p, Gia_ObjFaninId0p(p, pObj) ); + return Gia_ObjFaninC0(pObj) ? ~Truth : Truth; + +} + +/**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; |