summaryrefslogtreecommitdiffstats
path: root/src/map/if/ifDelay.c
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2014-04-11 12:20:36 -0700
committerAlan Mishchenko <alanmi@berkeley.edu>2014-04-11 12:20:36 -0700
commit865526f88094140c458a244fc8bb279bfa154fc1 (patch)
tree79af4109829c87a5a20a8634ccf6084644baee16 /src/map/if/ifDelay.c
parente855eaa080c0ac1162ff8a8b5d227dce0c456997 (diff)
downloadabc-865526f88094140c458a244fc8bb279bfa154fc1.tar.gz
abc-865526f88094140c458a244fc8bb279bfa154fc1.tar.bz2
abc-865526f88094140c458a244fc8bb279bfa154fc1.zip
New feature to optimize delay during mapping.
Diffstat (limited to 'src/map/if/ifDelay.c')
-rw-r--r--src/map/if/ifDelay.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/map/if/ifDelay.c b/src/map/if/ifDelay.c
index 433b4e4d..1c10d950 100644
--- a/src/map/if/ifDelay.c
+++ b/src/map/if/ifDelay.c
@@ -287,8 +287,9 @@ int If_CutLutBalancePinDelays( If_Man_t * p, If_Cut_t * pCut, char * pPerm )
}
else
{
+ char * pCutPerm = If_CutDsdPerm( p, pCut );
int LutSize = p->pPars->pLutStruct[0] - '0';
- int i, Delay, DelayMax;
+ int i, Delay, DelayMax = 0;
assert( (If_CutLeaveNum(pCut) > LutSize) == (pCut->uMaskFunc > 0) );
for ( i = 0; i < If_CutLeaveNum(pCut); i++ )
{
@@ -296,7 +297,7 @@ int If_CutLutBalancePinDelays( If_Man_t * p, If_Cut_t * pCut, char * pPerm )
pPerm[i] = 2;
else
pPerm[i] = 1;
- Delay = (int)If_ObjCutBest(If_CutLeaf(p, pCut, i))->Delay;
+ Delay = (int)If_ObjCutBest(If_CutLeaf(p, pCut, pCutPerm[i]))->Delay;
DelayMax = Abc_MaxInt( DelayMax, Delay + (int)pPerm[i] );
}
return DelayMax;
@@ -330,17 +331,17 @@ int If_CutLutBalanceEval( If_Man_t * p, If_Cut_t * pCut )
}
else
{
+ char * pCutPerm = If_CutDsdPerm( p, pCut );
int LutSize = p->pPars->pLutStruct[0] - '0';
int i, pTimes[IF_MAX_FUNC_LUTSIZE];
int DelayMax = 0, nLeafMax = 0;
unsigned uLeafMask = 0;
for ( i = 0; i < If_CutLeaveNum(pCut); i++ )
{
- pTimes[i] = (int)If_ObjCutBest(If_CutLeaf(p, pCut, i))->Delay;
- assert( DelayMax <= pTimes[i] );
+ pTimes[i] = (int)If_ObjCutBest(If_CutLeaf(p, pCut, pCutPerm[i]))->Delay;
if ( DelayMax < pTimes[i] )
DelayMax = pTimes[i], nLeafMax = 1, uLeafMask = (1 << (i << 2));
- else
+ else if ( DelayMax == pTimes[i] )
nLeafMax++, uLeafMask |= (1 << (i << 2));
}
if ( If_CutLeaveNum(pCut) <= LutSize )