DIRECTORY Atom, CD, CDSimpleRules, Core, CoreFlat, CoreGeometry, CoreProperties, FS, GC, GCPrivate, IO, IPToolBox, IPTop, Process, Rope, Route, RouteDiGraph, RTCoreUtil, RTStructure, TerminalIO; GCImpl: CEDAR PROGRAM IMPORTS Atom, CD, CDSimpleRules, CoreProperties, FS, GCPrivate, IO, IPToolBox, IPTop, Process, Rope, Route, RouteDiGraph, RTStructure, TerminalIO EXPORTS GC SHARES GC = { 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, horizLayer, vertLayer: Rope.ROPE, properties: GC.PropList _ NIL] RETURNS [designRules: GC.DesignRules] = BEGIN hLayer, vLayer: GC.Layer; designRules _ NEW[GC.DesignRulesRec]; designRules.technology _ CD.FetchTechnology[technologyKey]; hLayer _ CDSimpleRules.GetLayer[technologyKey, horizLayer]; vLayer _ CDSimpleRules.GetLayer[technologyKey, vertLayer]; designRules.horizLayer _ horizLayer; designRules.vertLayer _ vertLayer; designRules.horizRules _ Route.CreateDesignRules[technologyKey, hLayer, vLayer, horizontal, properties]; designRules.vertRules _ Route.CreateDesignRules[technologyKey, hLayer, vLayer, vertical, properties]; END; CreateStructure: PUBLIC PROC [cellType: Core.CellType, flattenCellType: RTCoreUtil.FlattenCellTypeProc, pinFilter: RTStructure.CorePinFilterProc _ NIL, userData: REF ANY _ NIL, decoration: CoreGeometry.Decoration, defaultLib: CD.Design _ NIL] RETURNS [structure: RTStructure.Structure] ~ { RETURN[RTStructure.CreateFromCore[cellType, flattenCellType, pinFilter, interestingProperties, userData, decoration, defaultLib]]}; defaultParms: PUBLIC GC.Parms _ NEW[GC.ParmsRec]; CreateContext: PUBLIC PROC [name: Rope.ROPE _ NIL, structure: RTStructure.Structure, designRules: GC.DesignRules, parms: GC.Parms, properties: GC.PropList _ NIL] 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]; IPTop.Geometrize[topology]; context _ NEW[GC.ContextRec _ [name: contextName, rules: designRules, structure: structure, properties: properties, 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]}; 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]; }; InitialPlace: PUBLIC PROC [structure: RTStructure.Structure, initFile: Rope.ROPE] ~ { IF initFile # NIL THEN { stream: IO.STREAM _ FS.StreamOpen[initFile]; DO ENABLE IO.EndOfStream => EXIT; token: ATOM _ IPToolBox.GetIdAtom[stream]; SELECT token FROM $initialPlacement => GetInitialPlacement[structure, stream] ENDCASE => { TerminalIO.PutRope[Rope.Cat["Unknown Token: ", Atom.GetPName[token]]]; IPToolBox.RemoveBlock[stream]; TerminalIO.PutRope["\n\t Associated block is ignored"]; }; ENDLOOP; }; --endIF }; GetInitialPlacement: PROC[structure: RTStructure.Structure, stream: IO.STREAM] ={ FindName: PROC [structure: RTStructure.Structure, name: Rope.ROPE] RETURNS [inst: RTStructure.Instance _ NIL] ~ { EachInstance: RTStructure.EachInstanceAction ~ { IF Rope.Equal[instance.name, name] THEN {quit _ TRUE; inst _ instance}}; [] _ RTStructure.EnumerateInstances[structure, EachInstance]; }; IPToolBox.EnterBlock[stream]; UNTIL IPToolBox.ExitBlock[stream] DO instName: Rope.ROPE _ IO.GetTokenRope[stream, IO.IDProc].token; char: CHAR _ IO.GetChar[stream]; instance: RTStructure.Instance _ FindName[structure, instName]; IF instance # NIL THEN { IPToolBox.EnterBlock[stream]; UNTIL IPToolBox.ExitBlock[stream] DO token: ATOM _ IPToolBox.GetIdAtom[stream]; SELECT token FROM $origin => {instance.position _ IPToolBox.GetIntVector[stream]^; instance.placed _ TRUE}; $orient => instance.orientation _ GCPrivate.CDOrien[stream.GetInt]; ENDCASE => { TerminalIO.PutRope[Rope.Cat["Unknown token: ", Atom.GetPName[token], ". associated value ignored"]]; [] _ stream.GetRefAny; }; ENDLOOP; } ELSE { TerminalIO.PutRope[Rope.Cat[instName, " _ Unknown instance. Block is ignored\n"]]; IPToolBox.RemoveBlock[stream] }; ENDLOOP; }; --GetInitialPlacement metalVerticalRules: PUBLIC GC.DesignRules _ CreateDesignRules[$cmosB, "metal2", "metal",]; metalHorizontalRules: PUBLIC GC.DesignRules _ CreateDesignRules[$cmosB, "metal", "metal2",]; sideProp: PUBLIC ATOM _ CoreProperties.RegisterProperty[$GCSide]; bottomSideValue: PUBLIC ATOM _ $bottom; rightSideValue: PUBLIC ATOM _ $right; topSideValue: PUBLIC ATOM _ $top; leftSideValue: PUBLIC ATOM _ $left; noSideValue: PUBLIC ATOM _ $none; interestingProperties: PUBLIC RTCoreUtil.PropertyKeys _ NEW[RTCoreUtil.PropertyKeysRec[1]]; interestingProperties.p[0] _ sideProp; }. GCImpl.mesa Copyright c 1986 by Xerox Corporation. All rights reserved. Bryan Preas, August 21, 1986 6:42:42 pm PDT Define the general cell design rules. technologyKey values must correspond to one of the ChipNDale technologies. horizLayer, vertLayer should be "poly", "metal" or "metal2". Derive the interconnection requirements from a Core Data structure. Create a General Cell context. The General Cell context definition includes the design rules (conductor and via widths and spacings) for the routing channels as well as the circuit structure definition. Determine strategic paths for the wiring among the cells. Determine strategic paths for the wiring among the cells. Determine actual wiring paths. Remove circular references so garbage collection can work temporary initial placement: read from a file Global frame variables Used to specify the side on which a public pin is to be placed. sideProp with (mumble)Value should be a property/value on a public wire Used to specify all the properties that aer interesting to GC Êg˜šœ ™ Jšœ Ïmœ1™