DIRECTORY Real, IP, IPParams, IPCoTab, IPCTG, IPTop, IPNetTab, IPChWidthEst; IPChWidthEstImpl: CEDAR PROGRAM IMPORTS Real, IPCoTab, IPCTG, IPTop, IPParams, IPNetTab EXPORTS IPChWidthEst = BEGIN OPEN IPChWidthEst; 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]) )]]]; }; --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 ComputeChStat: PROC[top: IPTop.Ref] ={ eachCoAction: IPCoTab.EachComponentAction ={ FOR l: LIST OF REF IP.PinNetRep _ co.pinNets, l.rest UNTIL l = NIL DO FOR pS: LIST OF REF IP.PhysicalPinRep _ l.first.physicalPins, pS.rest UNTIL pS = NIL DO phyPin: REF IP.PhysicalPinRep _ pS.first; ch: IPCTG.Channel _ IPCoTab.GetChOnSide[co, phyPin.side, FALSE]; IF ch = NIL THEN LOOP; --phyPin.side = interior IF phyPin.active THEN ch.statistics.activePin _ ch.statistics.activePin.SUCC ELSE ch.statistics.nonActivePin _ ch.statistics.nonActivePin.SUCC; ENDLOOP; ENDLOOP; }; --eachCoAction IPCoTab.Components[top.coTab, eachCoAction]; }; --ComputeChStat END. Μ--File: IPChWidthEstImpl.mesa Last Edited by: CSChow, January 23, 1985 6:56:48 pm PST --Use Real.SqRt[#ActiveComps + 1] to take into account more comps => more nets -- + 1 incase #ActiveComps = 0 Κ˜Jšœ™J™7J™J™codešΟk ˜ K˜Kšœ˜Kšœ ˜ K˜Kšœ˜Kšœ˜Kšœ ˜ Kšœ ˜ —K˜šœœœ˜ Kšœœ˜7Kšœœœ˜/K˜šœœ˜2šœ˜Kšœ œœ ˜!Kšœœ˜"Kš œœœœœœ˜cšœœ˜ Kšœ˜šœ˜Kšœ>˜>Kšœ4˜4Kšœ9˜9šœU˜UKšΟcN™NKšž™—Kšœ˜———Kšœž˜—K˜šΟnœœœ˜&Kšœ˜Kšœ˜Kšœ.˜.Kšœœ˜ Kšœ^œ˜eK˜šœœ˜)Kšœ{˜€Kšœ˜Kšœ˜Kšœ˜Kšœž˜—K˜Kšœœœž ˜3KšœD˜DKšœHœ˜NKšœ˜Kšœ˜Kšœ=˜=Kšœ˜Kšœœ"˜,Kšœœ˜Kšœž˜—K˜šŸ œœ˜&šœ,˜,šœœœœœ œœ˜Ešœœœœœ0œœ˜WKšœœœ˜)Kšœœ0œ˜@Kš œœœœž˜/šœ˜Kšœ3˜;Kšœ9œ˜B—Kšœ˜—Kšœ˜—Kšœž˜—Kšœ,˜,Kšœž˜—K˜K˜Kšœ˜——…— | Z