diff options
Diffstat (limited to 'src/map/if')
-rw-r--r-- | src/map/if/ifDelay.c | 29 | ||||
-rw-r--r-- | src/map/if/ifDsd.c | 21 |
2 files changed, 50 insertions, 0 deletions
diff --git a/src/map/if/ifDelay.c b/src/map/if/ifDelay.c index 7fbcd2af..bf143ce5 100644 --- a/src/map/if/ifDelay.c +++ b/src/map/if/ifDelay.c @@ -269,6 +269,7 @@ int If_CutSopBalanceEval( If_Man_t * p, If_Cut_t * pCut, Vec_Int_t * vAig ) } else { + int fVerbose = 0; Vec_Int_t * vCover = Vec_WecEntry( p->vTtIsops[pCut->nLeaves], Abc_Lit2Var(If_CutTruthLit(pCut)) ); int Delay, Area = 0; int i, pTimes[IF_MAX_FUNC_LUTSIZE]; @@ -279,6 +280,34 @@ int If_CutSopBalanceEval( If_Man_t * p, If_Cut_t * pCut, Vec_Int_t * vAig ) pTimes[i] = (int)If_ObjCutBest(If_CutLeaf(p, pCut, i))->Delay; Delay = If_CutSopBalanceEvalIntInt( vCover, If_CutLeaveNum(pCut), pTimes, vAig, Abc_LitIsCompl(If_CutTruthLit(pCut)) ^ pCut->fCompl, &Area ); pCut->Cost = Area; + if ( fVerbose ) + { + int Max = 0, Two = 0; + for ( i = 0; i < If_CutLeaveNum(pCut); i++ ) + Max = Abc_MaxInt( Max, pTimes[i] ); + for ( i = 0; i < If_CutLeaveNum(pCut); i++ ) + if ( pTimes[i] != Max ) + Two = Abc_MaxInt( Two, pTimes[i] ); + if ( Two + 2 < Max && Max + 3 < Delay ) + { + for ( i = 0; i < If_CutLeaveNum(pCut); i++ ) + printf( "%3d ", pTimes[i] ); + for ( ; i < p->pPars->nLutSize; i++ ) + printf( " " ); + printf( "-> %3d ", Delay ); + Dau_DsdPrintFromTruth( If_CutTruthW(p, pCut), If_CutLeaveNum(pCut) ); + Kit_TruthIsopPrintCover( vCover, If_CutLeaveNum(pCut), Abc_LitIsCompl(If_CutTruthLit(pCut)) ^ pCut->fCompl ); + { + Vec_Int_t vIsop; + int pIsop[64]; + vIsop.nCap = vIsop.nSize = Abc_Tt6Esop( *If_CutTruthW(p, pCut), pCut->nLeaves, pIsop ); + vIsop.pArray = pIsop; + printf( "ESOP (%d -> %d)\n", Vec_IntSize(vCover), vIsop.nSize ); + Kit_TruthIsopPrintCover( &vIsop, If_CutLeaveNum(pCut), 0 ); + } + printf( "\n" ); + } + } return Delay; } } diff --git a/src/map/if/ifDsd.c b/src/map/if/ifDsd.c index 375b80fd..1f8bcf64 100644 --- a/src/map/if/ifDsd.c +++ b/src/map/if/ifDsd.c @@ -2096,12 +2096,33 @@ int If_CutDsdBalanceEval( If_Man_t * p, If_Cut_t * pCut, Vec_Int_t * vAig ) } else { + int fVerbose = 0; int i, pTimes[IF_MAX_FUNC_LUTSIZE]; int Delay, Area = 0; + char * pPermLits = If_CutDsdPerm(p, pCut); for ( i = 0; i < If_CutLeaveNum(pCut); i++ ) pTimes[i] = (int)If_ObjCutBest(If_CutLeaf(p, pCut, i))->Delay; Delay = If_CutDsdBalanceEvalInt( p->pIfDsdMan, Abc_LitNotCond(If_CutDsdLit(p, pCut), pCut->fCompl), pTimes, vAig, &Area, If_CutDsdPerm(p, pCut) ); pCut->Cost = Area; + if ( fVerbose ) + { + int Max = 0, Two = 0; + for ( i = 0; i < If_CutLeaveNum(pCut); i++ ) + Max = Abc_MaxInt( Max, pTimes[i] ); + for ( i = 0; i < If_CutLeaveNum(pCut); i++ ) + if ( pTimes[i] != Max ) + Two = Abc_MaxInt( Two, pTimes[i] ); + if ( Two + 2 < Max && Max + 3 < Delay ) + { + for ( i = 0; i < If_CutLeaveNum(pCut); i++ ) + printf( "%3d ", pTimes[Abc_Lit2Var(pPermLits[i])] ); + for ( ; i < p->pPars->nLutSize; i++ ) + printf( " " ); + printf( "-> %3d ", Delay ); + If_DsdManPrintOne( stdout, p->pIfDsdMan, Abc_Lit2Var(If_CutDsdLit(p, pCut)), NULL, 0 ); + printf( "\n" ); + } + } return Delay; } } |