Commit a1dd7e3f by Alan Mishchenko

Saturating floating point computation.

parent 96c5b562
...@@ -387,6 +387,7 @@ static inline void Amap_ManMatchGetFlows( Amap_Man_t * p, Amap_Mat_t * pM ) ...@@ -387,6 +387,7 @@ static inline void Amap_ManMatchGetFlows( Amap_Man_t * p, Amap_Mat_t * pM )
Amap_Mat_t * pMFanin; Amap_Mat_t * pMFanin;
Amap_Obj_t * pFanin; Amap_Obj_t * pFanin;
Amap_Gat_t * pGate; Amap_Gat_t * pGate;
float AddOn;
int i; int i;
pGate = Amap_LibGate( p->pLib, pM->pSet->iGate ); pGate = Amap_LibGate( p->pLib, pM->pSet->iGate );
assert( pGate->nPins == pM->pCut->nFans ); assert( pGate->nPins == pM->pCut->nFans );
...@@ -399,10 +400,15 @@ static inline void Amap_ManMatchGetFlows( Amap_Man_t * p, Amap_Mat_t * pM ) ...@@ -399,10 +400,15 @@ static inline void Amap_ManMatchGetFlows( Amap_Man_t * p, Amap_Mat_t * pM )
pMFanin = &pFanin->Best; pMFanin = &pFanin->Best;
pM->Delay = Abc_MaxInt( pM->Delay, pMFanin->Delay ); pM->Delay = Abc_MaxInt( pM->Delay, pMFanin->Delay );
pM->AveFan += Amap_ObjRefsTotal(pFanin); pM->AveFan += Amap_ObjRefsTotal(pFanin);
if ( Amap_ObjRefsTotal(pFanin) == 0 ) // if ( Amap_ObjRefsTotal(pFanin) == 0 )
pM->Area += pMFanin->Area; // pM->Area += pMFanin->Area;
else // else
pM->Area += pMFanin->Area / pFanin->EstRefs; // pM->Area += pMFanin->Area / pFanin->EstRefs;
AddOn = Amap_ObjRefsTotal(pFanin) == 0 ? pMFanin->Area : pMFanin->Area / pFanin->EstRefs;
if ( pM->Area >= (float)1e32 || AddOn >= (float)1e32 )
pM->Area = (float)1e32;
else
pM->Area += AddOn;
} }
pM->AveFan /= pGate->nPins; pM->AveFan /= pGate->nPins;
pM->Delay += 1.0; pM->Delay += 1.0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment