summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2013-10-16 19:02:47 -0700
committerAlan Mishchenko <alanmi@berkeley.edu>2013-10-16 19:02:47 -0700
commit9f2c4e998898a8485cd4afb89ffc268752b1b2e1 (patch)
tree9c2da9f7f4ae9f8c0ef55bc5e1dc9d059918aa01
parent4ab7905b72f8191c0959b129c4b29b38c2a1956c (diff)
downloadabc-9f2c4e998898a8485cd4afb89ffc268752b1b2e1.tar.gz
abc-9f2c4e998898a8485cd4afb89ffc268752b1b2e1.tar.bz2
abc-9f2c4e998898a8485cd4afb89ffc268752b1b2e1.zip
Bug fix in gate-sizing.
-rw-r--r--src/map/scl/sclUpsize.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/map/scl/sclUpsize.c b/src/map/scl/sclUpsize.c
index f1e0fbd9..1bfc1d56 100644
--- a/src/map/scl/sclUpsize.c
+++ b/src/map/scl/sclUpsize.c
@@ -338,7 +338,7 @@ int Abc_SclFindBypasses( SC_Man * p, Vec_Int_t * vPathNodes, int Ratio, int Notc
SC_Cell * pCellOld, * pCellNew;
Vec_Ptr_t * vFanouts;
Vec_Int_t * vRecalcs, * vEvals;
- Abc_Obj_t * pBuf, * pFanin, * pFanout, * pExtra = NULL;
+ Abc_Obj_t * pBuf, * pFanin, * pFanout, * pExtra;
int i, j, iNode, gateBest, gateBest2, fanBest, Counter = 0;
float dGainBest, dGainBest2;
@@ -355,6 +355,7 @@ int Abc_SclFindBypasses( SC_Man * p, Vec_Int_t * vPathNodes, int Ratio, int Notc
pFanin = Abc_ObjFanin0(pBuf);
if ( !Abc_ObjIsNode(pFanin) )
continue;
+ pExtra = NULL;
if ( p->pNtk->vPhases == NULL )
{
if ( Abc_SclIsInv(pBuf) )
@@ -388,6 +389,9 @@ int Abc_SclFindBypasses( SC_Man * p, Vec_Int_t * vPathNodes, int Ratio, int Notc
// skip if fanin already has fanout as a fanout
if ( Abc_NodeFindFanin(pFanout, pFanin) >= 0 )
continue;
+ // skip if fanin already has fanout as a fanout
+ if ( pExtra && Abc_NodeFindFanin(pFanout, pExtra) >= 0 )
+ continue;
// prepare
Abc_SclLoadStore3( p, pBuf );
Abc_SclUpdateLoadSplit( p, pBuf, pFanout );