diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2018-12-13 08:49:00 -0800 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2018-12-13 08:49:00 -0800 |
commit | f62eb635d16201d0c1780ae22d71a18fc9a525b3 (patch) | |
tree | 5b3f7529e5fbf3cf05a5f008667e3a34c0cc1f55 | |
parent | 1f016988b2aaf55b6a4e8868bea1bd1c4259195b (diff) | |
download | abc-f62eb635d16201d0c1780ae22d71a18fc9a525b3.tar.gz abc-f62eb635d16201d0c1780ae22d71a18fc9a525b3.tar.bz2 abc-f62eb635d16201d0c1780ae22d71a18fc9a525b3.zip |
Fixing float overflow during area-flow computation in &lf.
-rw-r--r-- | src/aig/gia/giaLf.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/aig/gia/giaLf.c b/src/aig/gia/giaLf.c index b1a82346..13066005 100644 --- a/src/aig/gia/giaLf.c +++ b/src/aig/gia/giaLf.c @@ -1158,7 +1158,11 @@ static inline void Lf_CutParams( Lf_Man_t * p, Lf_Cut_t * pCut, int Required, fl if ( pCut->Flow >= (float)1e32 || pBest->Flow[Index] >= (float)1e32 ) pCut->Flow = (float)1e32; else + { pCut->Flow += pBest->Flow[Index]; + if ( pCut->Flow > (float)1e32 ) + pCut->Flow = (float)1e32; + } } Delay = pBest->Delay[Index]; } @@ -1172,7 +1176,11 @@ static inline void Lf_CutParams( Lf_Man_t * p, Lf_Cut_t * pCut, int Required, fl if ( p->fUseEla ) pCut->Flow = Lf_CutAreaDerefed(p, pCut) / FlowRefs; else + { pCut->Flow = (pCut->Flow + Lf_CutArea(p, pCut)) / FlowRefs; + if ( pCut->Flow > (float)1e32 ) + pCut->Flow = (float)1e32; + } } void Lf_ObjMergeOrder( Lf_Man_t * p, int iObj ) |