DIRECTORY OrderedRefArray, IP, IPCTG, IPCoTab, IPTop, IPTopOpRecs; IPPlaceKit: CEDAR DEFINITIONS = BEGIN Components: TYPE = LIST OF IPCoTab.Component; DepthBreadthRec: TYPE = RECORD[depth, breadth: NAT]; OrderingFn: TYPE = PROC[top: IPTop.Ref] RETURNS [Components, LIST OF DepthBreadthRec]; PlaceEvaluator: TYPE = PROC[top: IPTop.Ref, yetToPlace: Components, cutOff: INT _ LAST[INT]] RETURNS [value: INT, prune: BOOL _ FALSE]; PlaceCompTGen: TYPE = PROC[top: IPTop.Ref, toPlace: Components] RETURNS [OrderedRefArray.Ref]; RemoveEvaluator: TYPE = PROC[top: IPTop.Ref, yetToRemove: NAT, cutOff: INT _ LAST[INT]] RETURNS [value: INT, prune: BOOL _ FALSE]; RemoveCompTGen: TYPE = PROC[top: IPTop.Ref, toRemove: NAT] RETURNS [OrderedRefArray.Ref]; GrowRec: TYPE = RECORD[co: IPCoTab.Component, chToSplit, negBnd, posBnd: IPCTG.Channel]; Execute: PROC[top: IPTop.Ref, trial: REF]; EachChGrowSiteAction: TYPE = PROC[negBnd, posBnd: IPCTG.Channel] RETURNS [next, quit: BOOL _ FALSE]; EachTopGrow1SiteAction: TYPE = PROC[host: IPCoTab.Component, corner: IPCoTab.CornerTypes] RETURNS [quit: BOOL _ FALSE]; ChEnumData: TYPE = REF ChEnumDataRep; ChEnumDataRep: TYPE = RECORD[ nextCh, finalCh: IPCTG.Channel, negSidePtr, posSidePtr: LIST OF REF IP.IntersectionNodeRep]; --Should be opaque and TREAT it as such CreateChEnumData: PROC[refCh: IPCTG.Channel] RETURNS [ChEnumData]; GetChSucc: PROC[data: ChEnumData, getXOnce: BOOL _ TRUE] RETURNS [IPCTG.Channel]; -- Get the next channel. Calling this repetetively, enumerates all channel intersecting AllChGrowSites: PROC[refCh: IPCTG.Channel, action: EachChGrowSiteAction]; ChGrowSites: PROC[refCh: IPCTG.Channel, whichSide: IP.PolarityTypes, action: EachChGrowSiteAction]; AllTopGrow1Sites: PROC[top: IPTop.Ref, action: EachTopGrow1SiteAction]; SideComponents: PROC[refCh: IPCTG.Channel, which: IPCTG.Side, action: IPCoTab.EachComponentAction]; SideChannels: PROC[refCh: IPCTG.Channel, which: IPCTG.Side, action: IPCTG.EachChannelAction]; NonActiveComps: PROC [top: IPTop.Ref, action: IPCoTab.EachComponentAction]; CountComps: PROC[comps: Components] RETURNS [NAT]; CopyCompsHead: PROC[comps: Components, head: NAT] RETURNS [compHd, compRest: Components]; GetComponents: PROC[remTrack: LIST OF REF] RETURNS [Components]; GetComponentArea: PROC[comp: IPCoTab.Component, minusUsedCorners, minusFreeCorners: BOOL _ TRUE] RETURNS [INT]; CoCornerFree: PROC[co: IPCoTab.Component, corner: IPCoTab.CornerTypes] RETURNS [BOOL]; ComputeZType: PROC[corner: IPCoTab.CornerTypes, refChType: IPCTG.ChType] RETURNS [IP.PolarityTypes]; CompactComp0: PROC[ top: IPTop.Ref, comp: IPCoTab.Component, direction: IPCTG.ChType, placeEval: PlaceEvaluator, -- Simply use as an eval function no prunning results: OrderedRefArray.Ref, resultsAfter: NAT, keepInitTrack: BOOL _ TRUE, --Provided for convenience formZOk: BOOL _ TRUE -- This means okay to formz during compaction ]; CompactComp1: PROC[ top: IPTop.Ref, comp: IPCoTab.Component, direction: IPCTG.ChType, placeEval: PlaceEvaluator, -- Simply use as an eval function no prunning results: OrderedRefArray.Ref, -- improvement added here resultsAfter: NAT, keepInitTrack: BOOL _ TRUE --Provided for convenience ]; FTPerturbTop: PROC[ --FT = FlipT top: IPTop.Ref, placeEval: PlaceEvaluator, -- Simply use as an eval function no prunning depth: NAT, results: OrderedRefArray.Ref, resultsAfter: NAT, keepInitTrack: BOOL _ TRUE --Provided for convenience ]; END. --File: IPPlaceKit.mesa Last Edited by: CSChow, February 1, 1985 10:48:37 pm PST -- Types Declarations used in definition of IPPlaceProcs --Order the components to be placed and specify depth and breadth for PlaceComps --Geometrize top and compute figure of merit (value) -- yetToPlace # NIL => Just Geometrize, need not compute value -- cutOff is use to do pruning --Only place 1 comps, but pass in all components to be placed eventually to -- give more information to the generator --This only remove 1 component. Pass in eventual number of component toRemove -- so that it has more information -- Operation to execute a trial --Plus any other FR or R in IPTopRecs --New Records definitions should be added here --need this because IPTopStackOps.Redo1 doesnt understand -- this it is process by Execute below --trial must be ref to one of the above records OR LIST OF REF --Calls IPTopOps.Redo if trial is not a ref to one of the above record -- Trials Generating Primitives: -- refCh above. getXOnce => enumerate cross intersection once only, else 2x -- enumerates all places where a Grow can be performed on refCh -- enumereate all places for grow; but only for the specified site --Calls AllChGrowSites but apply a filter to get grow that is bounded by -- channels spanning the same sides, so not the most efficient -- enumerate all places for Grow1 -- Enumerate all components on the side of a channel -- This is different from IPCTG.Component in that -- the component passed to action is never NIL --Simple layer above IPCTG.Intersections -- provided for convenience -- Useful routines -- count number of element in list of component --Doesnt modify comps --From track of removals to list of components --Get area of bounding rectangle of component -- minusUsedCorners => subtract area of corner if used -- minusFreeCorners => minus area of corner if it is not used -- = (There is a bite at that corner) AND (bite is not used OR ~co.active) --High level routines -- It is CompactComp0 on comp and its neighbours Κm˜Jšœ™J™8Icode˜šΟk ˜ K˜Kšœ˜Kšœ˜K˜Kšœ˜Kšœ ˜ —K˜K˜šœ œ œ˜%K˜Kšœ œœœ˜-K˜K™8K˜Kšœœœœ˜4š Οn œœœœœœ˜VK™P—K˜šžœœœ1œœœœ œ œœ˜‡K™4Kšœ?™?KšΟc™K˜—šž œœœ&œ˜^K™MK™)—K˜Kšžœœœœ œœœœ œ œœ˜ƒK˜š žœœœœœ˜YKšœM™MK™"—K˜K˜K™šœ œœ3œ ˜XJ™5J™.Jšœ:™:JšœŸžŸ™&—K˜šžœœœ˜*Kšœ>™>KšŸF™F—K˜K™KšŸ!™!K˜Kšžœœœœ œœœ˜dK˜Kš žœœœ7œœœ˜wK˜Kšœ œœ˜%šœœœ˜Kš œœ"œœœœŸ'˜„—K˜Kšžœœœ œ˜BK˜K˜š ž œœœœœœ ˜QK˜WKšœK™K—K˜šžœœœ(˜IKšœ?™?—K˜šž œœœœ.˜cK™BKšœžœ2™HKšŸ>™>—K˜šžœœ1˜GK™!—K˜šžœœœœ,˜cK™4K™2K™.—K˜š ž œœœœœ˜]Kšœž ™(K™—K˜K™K™Kšžœœ7˜KK˜šž œœœœ˜2K™/—K˜šž œœœœ ˜YK™—K˜š ž œœ œœœœ˜@K™.—K˜š žœœ>œœœœ˜oK™-Kšœ6™6Kšœ=™=—K˜šž œœ5œœ˜VKšœK™K—K˜Kš ž œœ)œ œœ˜dK˜K™K˜šžœ˜K˜Kšœ˜Kšœ œ˜KšœŸ-˜HKšœ˜Kšœ˜KšœœœŸ˜6Kšœ œœŸ-˜BKšœ˜—K˜šž œœ˜K˜Kšœ˜Kšœ œ˜KšœŸ-˜HKšœŸ˜7Kšœ˜KšœœœŸ˜5Kšœ˜Jšœ ž œ™0—K˜šž œœŸ ˜!K˜KšœŸ-˜HKšœœ˜ Kšœ˜Kšœ˜KšœœœŸ˜5Kšœ˜—K˜Kšœ˜——…— Šω