diff options
author | Maciej Kurc <mkurc@antmicro.com> | 2021-10-21 10:19:48 +0200 |
---|---|---|
committer | Maciej Kurc <mkurc@antmicro.com> | 2021-10-25 11:51:53 +0200 |
commit | dbc5f8a3b69d1a8d90fce00b7d1e2aa7d164488b (patch) | |
tree | 93480b0d1ab1d89dd3e3e6f343a094c05d8220ea /src | |
parent | 456e381a02effc8300a22408ee7398b7fb912937 (diff) | |
download | abc-dbc5f8a3b69d1a8d90fce00b7d1e2aa7d164488b.tar.gz abc-dbc5f8a3b69d1a8d90fce00b7d1e2aa7d164488b.tar.bz2 abc-dbc5f8a3b69d1a8d90fce00b7d1e2aa7d164488b.zip |
Added including unconnected carry-outs in the carry-chain connection list.
Signed-off-by: Maciej Kurc <mkurc@antmicro.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/aig/gia/giaSweep.c | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/src/aig/gia/giaSweep.c b/src/aig/gia/giaSweep.c index 1d66caee..344eca44 100644 --- a/src/aig/gia/giaSweep.c +++ b/src/aig/gia/giaSweep.c @@ -388,6 +388,14 @@ Vec_Int_t * Gia_ManComputeCarryOuts( Gia_Man_t * p ) Tim_Man_t * pManTime = (Tim_Man_t *)p->pManTime; int i, iLast, iBox, nBoxes = Tim_ManBoxNum( pManTime ); Vec_Int_t * vCarryOuts = Vec_IntAlloc( nBoxes ); + + // Create and populare reference count (and free later) only if not already + // done. + int createRefs = (p->pRefs == NULL); + if (createRefs) { + Gia_ManCreateRefs( p ); + } + for ( i = 0; i < nBoxes; i++ ) { iLast = Tim_ManBoxInputLast( pManTime, i ); @@ -398,9 +406,24 @@ Vec_Int_t * Gia_ManComputeCarryOuts( Gia_Man_t * p ) if ( iBox == -1 ) continue; assert( Gia_ObjIsCi(pObj) ); - if ( Gia_ObjCioId(pObj) == Tim_ManBoxOutputLast(pManTime, iBox) ) + if ( Gia_ObjCioId(pObj) == Tim_ManBoxOutputLast(pManTime, iBox) ) { Vec_IntPush( vCarryOuts, Gia_ObjId(p, pObj) ); + + // We have identified a carry connection. Check if the carry out + // of the destination box is unconnected. If so then add it to + // the carry list as well. + iLast = Tim_ManBoxOutputLast(pManTime, i); + pObj = Gia_ManCi(p, iLast); + if ( Gia_ObjRefNum(p, pObj) == 0 ) { + Vec_IntPush( vCarryOuts, Gia_ObjId(p, pObj) ); + } + } + } + + if (createRefs) { + ABC_FREE( p->pRefs ); } + return vCarryOuts; } |