From edba505d9d9b18af430ee0fa68f0957d0a3b9f1e Mon Sep 17 00:00:00 2001 From: Alan Mishchenko Date: Sat, 2 Aug 2014 17:01:48 -0700 Subject: Profiling code for SOP/DSD/LMS balancing. --- src/map/if/ifDelay.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'src/map/if/ifDelay.c') 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; } } -- cgit v1.2.3