summaryrefslogtreecommitdiffstats
path: root/src/map/if/ifDsd.c
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2014-08-02 17:01:48 -0700
committerAlan Mishchenko <alanmi@berkeley.edu>2014-08-02 17:01:48 -0700
commitedba505d9d9b18af430ee0fa68f0957d0a3b9f1e (patch)
tree8635bad8ea35ba94d66358e2cd3297b1f6df5f1d /src/map/if/ifDsd.c
parent62bc45d1fb5bd44bf3342b123819e24a13f2d48f (diff)
downloadabc-edba505d9d9b18af430ee0fa68f0957d0a3b9f1e.tar.gz
abc-edba505d9d9b18af430ee0fa68f0957d0a3b9f1e.tar.bz2
abc-edba505d9d9b18af430ee0fa68f0957d0a3b9f1e.zip
Profiling code for SOP/DSD/LMS balancing.
Diffstat (limited to 'src/map/if/ifDsd.c')
-rw-r--r--src/map/if/ifDsd.c21
1 files changed, 21 insertions, 0 deletions
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;
}
}