<> <> <> <> <> DIRECTORY Atom, CD, CDSimpleRules, Core, CoreGeometry, CoreRouteFlat, DABasics, FS, GC, GCPrivate, IP, IPBasicOps, IPCoTab, IPTop, Process, Rope, Route, RouteDiGraph; GCImpl: CEDAR PROGRAM IMPORTS CD, CDSimpleRules, GCPrivate, IPBasicOps, IPCoTab, IPTop, Process, Route, RouteDiGraph EXPORTS GC = BEGIN <> Error: PUBLIC ERROR [errorType: GC.ErrorType _ callingError, explanation: Rope.ROPE _ NIL] = CODE; Signal: PUBLIC SIGNAL [signalType: GC.ErrorType _ callingError, explanation: Rope.ROPE _ NIL] = CODE; <> CreateDesignRules: PUBLIC PROC [technologyKey: ATOM, rulesKey: ATOM, horizLayer, vertLayer: Rope.ROPE] RETURNS [designRules: GC.DesignRules] = { <> hLayer: CD.Layer _ CDSimpleRules.GetLayer[technologyKey, horizLayer]; vLayer: CD.Layer _ CDSimpleRules.GetLayer[technologyKey, vertLayer]; technology: CD.Technology _ CD.FetchTechnology[technologyKey]; designRules _ NEW[GC.DesignRulesRec _ [ horizLayer: horizLayer, vertLayer: vertLayer, horizParams: Route.DefaultDesignRulesParameters [technology, hLayer, vLayer, horizontal], --?used to use rulesKey as arg[-1] vertParams: Route.DefaultDesignRulesParameters [technology, hLayer, vLayer, vertical], --?used to use rulesKey as arg[-1] technology: technology]]; designRules.horizRules _ Route.DefaultDesignRules[designRules.horizParams]; --?rulesKey designRules.vertRules _ Route.DefaultDesignRules[designRules.vertParams]}; --?rulesKey <> defaultParms: PUBLIC GC.Parms _ NEW[GC.ParmsRec]; CreateContext: PUBLIC PROC [name: Rope.ROPE _ NIL, structure: CoreRouteFlat.Structure, designRules: GC.DesignRules, parms: GC.Parms] RETURNS [context: GC.Context] = { <> contextName: Rope.ROPE _ IF name # NIL THEN name ELSE structure.name; topology: IPTop.Ref _ IPTop.ReDefineChs [top: IPTop.CreateFromStructure[structure], maxChWidth: TRUE]; <> SetIPComps[structure, topology]; IPTop.Geometrize[topology]; context _ NEW[GC.ContextRec _ [name: contextName, rules: designRules, structure: structure, parms: parms, topology: topology, topologicalOrder: NIL]]}; DoInitialGlobalRoute: PUBLIC PROC [context: GC.Context] = { <> <<>> p: Process.Priority _ Process.GetPriority[]; Process.SetPriority[Process.priorityBackground]; GCPrivate.DoInitialGlobalRoute[context]; Process.SetPriority[p]}; DoImproveGlobalRoute: PUBLIC PROC [context: GC.Context] = { <> p: Process.Priority _ Process.GetPriority[]; Process.SetPriority[Process.priorityBackground]; Process.SetPriority[p]}; DoDetailRoute: PUBLIC PROC [context: GC.Context] RETURNS [result: GC.Result] = { <> p: Process.Priority _ Process.GetPriority[]; Process.SetPriority[Process.priorityBackground]; result _ GCPrivate.DoDetailRoute[context]; Process.SetPriority[p]}; InitialPlace: PUBLIC PROC [structure: CoreRouteFlat.Structure] ~ { FOR insts: LIST OF CoreRouteFlat.Instance _ structure.instances, insts.rest WHILE insts#NIL DO insts.first.placed _ TRUE ENDLOOP}; <> <> <> <> <> <> <> <<};>> <<}; --EachTypeProc>> <<>> <<[] _ CoreRouteFlat.EnumerateObjects[structure, EachTypeProc];>> <<}; --SetIPTypes>> <<>> SetIPComps: PROC[structure: CoreRouteFlat.Structure, topology: IPTop.Ref] ~ { FOR insts: LIST OF CoreRouteFlat.Instance _ structure.instances, insts.rest WHILE insts#NIL DO IF insts.first#structure.outerInstance THEN { co: IPCoTab.Component _ IPCoTab.GetComponent[topology.coTab, insts.first.name]; size: IP.IntVector _ CD.InterestSize[insts.first.layObject]; shapeRec: REF IP.ShapeRep _ NEW[IP.ShapeRep _ [dim: IPBasicOps.NuNatVector[size.x, size.y]]]; co.shape _ shapeRec^} ENDLOOP}; <> Destroy: PUBLIC PROC [context: GC.Context] ~ { <> DestroyNode: RouteDiGraph.EnumNodeProc = { channel: GCPrivate.Channel _ NARROW[node.nodeInfo]; channel.topoOrder _ NIL}; IPTop.DestroySelf[NARROW[context.topology]]; RouteDiGraph.DestroyGraph[graph: NARROW[context.topologicalOrder], enumNode: DestroyNode]; GCPrivate.DestroyChannels[context]}; <> metalVerticalRules: PUBLIC GC.DesignRules _ CreateDesignRules[$cmosB, $Hybrid, "metal2", "metal"]; metalHorizontalRules: PUBLIC GC.DesignRules _ CreateDesignRules[$cmosB, $Hybrid, "metal", "metal2"]; interestingProperties: PUBLIC LIST OF ATOM _ NIL; -- props interesting to GC <<>> END.