diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2012-07-15 15:54:36 -0700 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2012-07-15 15:54:36 -0700 |
commit | 96d7699698d439b279cf37367b4c32ef5d1c2d7a (patch) | |
tree | 2d32eb0235f882029d5ba8fabe13e3dd39533dc6 /src/aig/gia | |
parent | 1ca94c102333ebb905b4ad8186ade01cd5f073fe (diff) | |
download | abc-96d7699698d439b279cf37367b4c32ef5d1c2d7a.tar.gz abc-96d7699698d439b279cf37367b4c32ef5d1c2d7a.tar.bz2 abc-96d7699698d439b279cf37367b4c32ef5d1c2d7a.zip |
Updated code for lazy man's synthesis.
Diffstat (limited to 'src/aig/gia')
-rw-r--r-- | src/aig/gia/giaUtil.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/aig/gia/giaUtil.c b/src/aig/gia/giaUtil.c index 3acd3213..0dec3bd9 100644 --- a/src/aig/gia/giaUtil.c +++ b/src/aig/gia/giaUtil.c @@ -1360,12 +1360,17 @@ unsigned * Gia_ManComputePoTruthTables( Gia_Man_t * p, int nBytesMax ) int Gia_ObjComputeTruthTable_rec( Gia_Man_t * p, Gia_Obj_t * pObj ) { word * pTruth0, * pTruth1, * pTruth, * pTruthL; + int Value0, Value1; if ( Gia_ObjIsTravIdCurrent(p, pObj) ) return pObj->Value; Gia_ObjSetTravIdCurrent(p, pObj); assert( Gia_ObjIsAnd(pObj) ); - pTruth0 = Vec_WrdArray(p->vTtMemory) + p->nTtWords * Gia_ObjComputeTruthTable_rec( p, Gia_ObjFanin0(pObj) ); - pTruth1 = Vec_WrdArray(p->vTtMemory) + p->nTtWords * Gia_ObjComputeTruthTable_rec( p, Gia_ObjFanin1(pObj) ); + Value0 = Gia_ObjComputeTruthTable_rec( p, Gia_ObjFanin0(pObj) ); + Value1 = Gia_ObjComputeTruthTable_rec( p, Gia_ObjFanin1(pObj) ); + assert( Value0 < Vec_WrdSize(p->vTtMemory) ); + assert( Value1 < Vec_WrdSize(p->vTtMemory) ); + pTruth0 = Vec_WrdArray(p->vTtMemory) + p->nTtWords * Value0; + pTruth1 = Vec_WrdArray(p->vTtMemory) + p->nTtWords * Value1; assert( p->nTtWords * p->iTtNum < Vec_WrdSize(p->vTtMemory) ); pTruth = Vec_WrdArray(p->vTtMemory) + p->nTtWords * p->iTtNum++; pTruthL = Vec_WrdArray(p->vTtMemory) + p->nTtWords * p->iTtNum; @@ -1387,7 +1392,7 @@ int Gia_ObjComputeTruthTable_rec( Gia_Man_t * p, Gia_Obj_t * pObj ) while ( pTruth < pTruthL ) *pTruth++ = *pTruth0++ & *pTruth1++; } - return p->iTtNum-1; + return (pObj->Value = p->iTtNum-1); } unsigned * Gia_ObjComputeTruthTable( Gia_Man_t * p, Gia_Obj_t * pObj ) { |