SimpleChWidthEstimator:
PUBLIC ChWidthEstimator ={
OPEN stat: ch.statistics;
chLength: INT ← IPCTG.Length[ch];
assemblyLength: INT ← xDim + yDim;
coeff: REAL ← (IF IPCTG.GetType[ch] = hor THEN IPParams.CoeffForHorCh ELSE IPParams.CoeffForHorCh);
RETURN[
MAX[
IPParams.ChMinWidth,
Real.RoundLI[coeff * (
(IPParams.WtTotalNetLength * totalNetLength)/assemblyLength +
(IPParams.WtActivePins * stat.activePin)/chLength +
(IPParams.WtNonActivePins * stat.nonActivePin)/chLength +
(IPParams.WtNetFactor * stat.netFactor)/(assemblyLength * Real.SqRt[activeComps + 1])
--Use Real.SqRt[#ActiveComps + 1] to take into account more comps => more nets
-- + 1 incase #ActiveComps = 0
)]]];
}; --SimpleChWidthEstimator
EstimateAndAssignChWidth:
PUBLIC
PROC[
top: IPTop.Ref,
estimator: ChWidthEstimator,
chNetFactorProc: IPNetTab.ChNetFactorEstimator
] RETURNS [
totalNetLength, totalActivePins, totalNonActivePins, xDim, yDim, activeComps, nonActiveComps: INT] ={
eachChAction:
IPCTG.EachChannelAction = {
IPCTG.SetWidth[ch, estimator[ch, totalNetLength, totalActivePins, totalNonActivePins, xDim, yDim, activeComps, nonActiveComps]];
ch.statistics.activePin ← 0;
ch.statistics.nonActivePin ← 0;
ch.statistics.netFactor ← 0.0;
}; --eachChAction
IF IPTop.NoTopology[top] THEN RETURN; --No channels
totalNetLength ← IPNetTab.TotalNetLength[top.nets, chNetFactorProc];
[totalActivePins, totalNonActivePins] ← IPNetTab.CountAllPins[top.nets, TRUE];
xDim ← IPTop.XDim[top];
yDim ← IPTop.YDim[top];
[activeComps, nonActiveComps] ← IPNetTab.CountNets[top.nets];
ComputeChStat[top];
[] ← IPCTG.Channels[top.ctg, eachChAction];
top.initialized ← FALSE;
}; --EstimateAndAssignChWidth1