DIRECTORY OrderedRefArray, IPNetTab, IPCTG, IPCoTab, IPTop, IPTopOpRecs, IPPlaceKit, IPTopOps, IPPlaceXamples; IPPlaceXamplesImpl: CEDAR PROGRAM IMPORTS OrderedRefArray, IPNetTab, IPCoTab, IPCTG, IPTop, IPPlaceKit, IPTopOps EXPORTS IPPlaceXamples = BEGIN OPEN IPPlaceKit; ofx1Depth: PUBLIC NAT _ 3; ofx1Breadth: PUBLIC NAT _ 5; OrderingFnX1: PUBLIC IPPlaceKit.OrderingFn ={ comps: Components _ NIL; depthBreadths: LIST OF IPPlaceKit.DepthBreadthRec _ NIL; action: IPCoTab.EachComponentAction ={ IF IPCoTab.CoActive[co] THEN RETURN; comps _ CONS[co, comps]; depthBreadths _ CONS[IPPlaceKit.DepthBreadthRec[ofx1Depth, ofx1Breadth], depthBreadths] }; --action IPCoTab.AllComponents[top.coTab, action]; RETURN [comps, depthBreadths] }; --OrderingFnX1 PlaceEvaluatorX1: PUBLIC IPPlaceKit.PlaceEvaluator ={ IPTop.Geometrize[top]; IF yetToPlace = NIL THEN RETURN [IPNetTab.TotalNetLength[top.nets, NIL]] ELSE RETURN [0]; }; --PlaceEvaluatorX1 pex2PruneCoeff: PUBLIC REAL _ 0.1; --Use interpreter to change PlaceEvaluatorX2: PUBLIC IPPlaceKit.PlaceEvaluator = { IPTop.Geometrize[top]; IF yetToPlace = NIL THEN RETURN [IPNetTab.TotalNetLength[top.nets, NIL]] ELSE RETURN [0, (IPNetTab.TotalNetLength[top.nets, NIL] * (1.0 + pex2PruneCoeff * IPPlaceKit.CountComps[yetToPlace])) > cutOff]; }; --PlaceEvaluatorX1 pctgX1Keep: PUBLIC NAT _ 4; --Use interpreter to change PlaceCompTGenX1: PUBLIC IPPlaceKit.PlaceCompTGen ={ trials: OrderedRefArray.Ref _ OrderedRefArray.Create[pctgX1Keep]; eachChAction: IPCTG.EachChannelAction ={ eachSite: IPPlaceKit.EachChGrowSiteAction ={ value: INT _ FitEstimator[toPlace.first, ch, negBnd, posBnd].value; site: REF IPPlaceKit.GrowRec _ NEW[IPPlaceKit.GrowRec _ [toPlace.first, ch, negBnd, posBnd]]; OrderedRefArray.Insert[trials, site, value] }; --eachSite IPPlaceKit.AllChGrowSites[ch, eachSite]; };--eachChAction [] _ IPCTG.Channels[top.ctg, eachChAction, TRUE]; RETURN [trials] }; --PlaceCompTGenX1 pctgX2Keep: PUBLIC NAT _ 4; --Use interpreter to change PlaceCompTGenX2: PUBLIC IPPlaceKit.PlaceCompTGen ={ trials: OrderedRefArray.Ref _ OrderedRefArray.Create[pctgX2Keep]; eachChAction: IPCTG.EachChannelAction ={ eachSite: IPPlaceKit.EachChGrowSiteAction ={ chSpan, coSpan, value: NAT; site: REF IPPlaceKit.GrowRec; [chSpan, coSpan, value] _ FitEstimator[toPlace.first, ch, negBnd, posBnd]; IF value > OrderedRefArray.GetPruneValue[trials] AND chSpan > coSpan THEN RETURN [next: TRUE]; -- not in right direction site _ NEW[IPPlaceKit.GrowRec _ [toPlace.first, ch, negBnd, posBnd]]; OrderedRefArray.Insert[trials, site, value] }; --eachSite IPPlaceKit.AllChGrowSites[ch, eachSite]; };--eachChAction [] _ IPCTG.Channels[top.ctg, eachChAction, TRUE]; RETURN [trials] }; --PlaceCompTGenX2 FitEstimator: PROC[co: IPCoTab.Component, refCh, negBnd, posBnd: IPCTG.Channel] RETURNS [chSpan, coSpan, value: NAT] ={ chSpanWithSlack: NAT _ IPCTG.GetSlack[posBnd].pos - IPCTG.GetSlack[negBnd].neg; chSpan _ IPCTG.GetCoord[posBnd] - IPCTG.GetCoord[negBnd]; coSpan _ IF IPCTG.GetType[refCh] = hor THEN IPCoTab.GetDim[co].x ELSE IPCoTab.GetDim[co].y; value _ MIN[ABS[chSpan - coSpan], ABS[chSpanWithSlack - coSpan]]; }; --FitEstimator RemoveEvaluatorX1: PUBLIC IPPlaceKit.RemoveEvaluator ={ IPTop.Geometrize[top]; IF yetToRemove = 0 THEN RETURN [IPTop.Area[top]] ELSE RETURN [0] }; --RemoveEvaluatorX1 rctgX1Keep: PUBLIC NAT _ 3; rctgX1ShrnkDn: PUBLIC IPCTG.ChType _ hor; RemoveCompsTGenX1: PUBLIC IPPlaceKit.RemoveCompTGen ={ trials: OrderedRefArray.Ref _ OrderedRefArray.Create[rctgX1Keep]; eachCompAction: IPCoTab.EachComponentAction ={ coArea: INT _ IPPlaceKit.GetComponentArea[co, TRUE, FALSE]; remTrial: REF _ IPTopOps.Shrink[top, co, rctgX1ShrnkDn, TRUE].fr; value: INT; IPTop.Geometrize[top]; value _ IPTop.Area[top] + coArea; [] _ IPTopOps.Undo1[top]; -- Undo shrink OrderedRefArray.Insert[trials, remTrial, value] }; --eachCompAction IPCoTab.Components[top.coTab, eachCompAction]; RETURN [trials] }; --RemoveCompsTGenX1 END. ΐ--File: IPPlaceXamplesImpl.mesa Last Edited by: CSChow, January 23, 1985 4:43:15 pm PST -- Used by PlaceCompTGenX1 and PlaceCompTGenX2 --Need more thoughts on counting of corner areas Κš˜J™J™7J™šΟk ˜ J˜J˜ J˜J˜J˜J˜ Icodešœ ˜ K˜ Kšœ˜—K˜K˜šœœœ˜"KšœG˜NKšœœœ ˜/K˜Kšœ œœ˜Kšœ œœ˜šœœ˜-Kšœœ˜Kšœœœœ˜8šœ&˜&Kšœœœ˜$Kšœœ ˜KšœœC˜WKšœΟc˜ —Kšœ)˜)Kšœ˜Kšœž˜—K˜šœœ˜5K˜šœ˜Kšœœ$œ˜4Kšœœ˜—Kšœž˜—K˜Kšœœœž˜>šœœ˜6K˜šœœ˜Kšœœ$œ˜4Kšœœ(œJ˜€—Kšœž˜—K˜Kšœ œœž˜7šœœ˜3KšœA˜Ašœœ˜(šœ,˜,Kšœœ9˜CKšœœœ;˜]K˜+Kšœž ˜ —Kšœ(˜(Kšœž˜—Kšœœ!œ˜1Kšœ ˜Kšœž˜—K˜Kšœ œœž˜7šœœ˜3KšœA˜Ašœœ˜(šœ,˜,Kšœ˜Kšœœ˜KšœJ˜Jšœ/œœ˜DKšœœœž˜3—Kšœœ;˜EK˜+Kšœž ˜ —Kšœ(˜(Kšœž˜—Kšœœ!œ˜1Kšœ ˜Kšœž˜—K˜š Οn œœ/œ œœ˜wKšœ.™.Kšœœœœ˜OKšœ œœ˜9Kš œ œœœœ˜[Kšœœœœ˜AKšœž˜K™—K˜šœœ˜7K˜šœ˜Kšœœ˜Kšœœ˜—Kšœž˜—K˜Kšœ œœ˜Kšœœœ˜)šœœ˜6KšœA˜Ašœ.˜.šœœ#œœ˜