summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/aig/gia/giaLf.c6
-rw-r--r--src/aig/gia/giaNf.c6
-rw-r--r--src/base/cmd/cmdHist.c2
-rw-r--r--src/map/if/ifCut.c10
4 files changed, 18 insertions, 6 deletions
diff --git a/src/aig/gia/giaLf.c b/src/aig/gia/giaLf.c
index 2c216a9b..15ec3529 100644
--- a/src/aig/gia/giaLf.c
+++ b/src/aig/gia/giaLf.c
@@ -1154,7 +1154,11 @@ static inline void Lf_CutParams( Lf_Man_t * p, Lf_Cut_t * pCut, int Required, fl
else
{
Index = (int)(pBest->Delay[1] + 1 <= Required && Required != ABC_INFINITY);
- pCut->Flow += pBest->Flow[Index];
+ //pCut->Flow += pBest->Flow[Index];
+ if ( pCut->Flow >= (float)1e32 || pBest->Flow[Index] >= (float)1e32 )
+ pCut->Flow = (float)1e32;
+ else
+ pCut->Flow += pBest->Flow[Index];
}
Delay = pBest->Delay[Index];
}
diff --git a/src/aig/gia/giaNf.c b/src/aig/gia/giaNf.c
index 6f1d0c8d..403c220a 100644
--- a/src/aig/gia/giaNf.c
+++ b/src/aig/gia/giaNf.c
@@ -1147,7 +1147,11 @@ void Nf_ManCutMatchOne( Nf_Man_t * p, int iObj, int * pCut, int * pCutSet )
if ( pD->D < SCL_INFINITY && pA->D < SCL_INFINITY && ArrivalD + pC->iDelays[k] > Required )
break;
Delay = Abc_MaxInt( Delay, ArrivalD + pC->iDelays[k] );
- AreaF += pBestF[iFanin]->M[fComplF][0].F;
+ //AreaF += pBestF[iFanin]->M[fComplF][0].F;
+ if ( AreaF >= (float)1e32 || pBestF[iFanin]->M[fComplF][0].F >= (float)1e32 )
+ AreaF = (float)1e32;
+ else
+ AreaF += pBestF[iFanin]->M[fComplF][0].F;
}
}
if ( k < nFans )
diff --git a/src/base/cmd/cmdHist.c b/src/base/cmd/cmdHist.c
index 36e546a7..218d832f 100644
--- a/src/base/cmd/cmdHist.c
+++ b/src/base/cmd/cmdHist.c
@@ -57,7 +57,7 @@ void Cmd_HistoryAddCommand( Abc_Frame_t * p, const char * command )
return;
Len = strlen(command);
strcpy( Buffer, command );
- if ( Buffer[Len-1] == '\n' )
+ if ( Len > 0 && Buffer[Len-1] == '\n' )
Buffer[Len-1] = 0;
if ( strlen(Buffer) > 3 &&
strncmp(Buffer,"set",3) &&
diff --git a/src/map/if/ifCut.c b/src/map/if/ifCut.c
index 9b8d75ad..667a21c5 100644
--- a/src/map/if/ifCut.c
+++ b/src/map/if/ifCut.c
@@ -919,18 +919,22 @@ void If_CutLift( If_Cut_t * pCut )
float If_CutAreaFlow( If_Man_t * p, If_Cut_t * pCut )
{
If_Obj_t * pLeaf;
- float Flow;
+ float Flow, AddOn;
int i;
Flow = If_CutLutArea(p, pCut);
If_CutForEachLeaf( p, pCut, pLeaf, i )
{
if ( pLeaf->nRefs == 0 || If_ObjIsConst1(pLeaf) )
- Flow += If_ObjCutBest(pLeaf)->Area;
+ AddOn = If_ObjCutBest(pLeaf)->Area;
else
{
assert( pLeaf->EstRefs > p->fEpsilon );
- Flow += If_ObjCutBest(pLeaf)->Area / pLeaf->EstRefs;
+ AddOn = If_ObjCutBest(pLeaf)->Area / pLeaf->EstRefs;
}
+ if ( Flow >= (float)1e32 || AddOn >= (float)1e32 )
+ Flow = (float)1e32;
+ else
+ Flow += AddOn;
}
return Flow;
}