DIRECTORY CD, CDDirectory, CDProperties, CoreGeometry, CoreClasses, CoreOps, CoreProperties, IO, PWObjects, Rope, Sinix, TerminalIO; ExtractRouting: CEDAR PROGRAM IMPORTS CDDirectory, CDProperties, CoreGeometry, CoreClasses, CoreOps, CoreProperties, IO, Rope, Sinix, TerminalIO SHARES CoreGeometry ~ BEGIN OPEN Sinix; LazyPinsEnumerate: CoreGeometry.LazyEnumerateProc = { node: PWObjects.Node _ NARROW [CoreProperties.GetWireProp[wire, $PWObjectsNode]]; rir: REF CD.Rect _ NARROW [CoreProperties.GetWireProp[wire, $PWObjectsIR]]; FOR i: NAT IN [0 .. node.size) DO instance: CoreGeometry.Instance = [node[i].object, [node[i].position]]; IF CoreGeometry.AtEdge[rir^, instance] THEN quit _ eachInstance[instance]; IF quit THEN RETURN; ENDLOOP; }; LazyGeometryEnumerate: CoreGeometry.LazyEnumerateProc = { node: PWObjects.Node _ NARROW [CoreProperties.GetWireProp[wire, $PWObjectsNode]]; FOR i: NAT IN [0 .. node.size) DO quit _ eachInstance[[node[i].object, [node[i].position]]]; IF quit THEN RETURN; ENDLOOP; }; ExtractRouting: ExtractProc = { cellType: CellType; routing: PWObjects.RoutingSpecific = NARROW [obj.specific]; publics: LIST OF Wire _ NIL; TerminalIO.PutF["Extracting [%g] routing %g (nodes: %g)\n", IO.rope[mode.decoration.name], IO.rope[CDDirectory.Name[obj]], IO.int[routing.size]]; FOR i: NAT IN [0 .. routing.size) DO node: PWObjects.Node = routing[i]; name1: ROPE = NARROW [CDProperties.GetListProp[node.properties, $InstanceName]]; name2: ROPE = NARROW [CDProperties.GetListProp[node.properties, $SignalName]]; wire: Wire _ CoreOps.CreateWire[ name: name1, props: CoreProperties.Props[ [$PWObjectsNode, node], [$PWObjectsIR, NEW [CD.Rect _ routing.ir]]] ]; IF NOT Rope.Equal[name1, name2] THEN ERROR; -- current implementation of PWObjects CoreGeometry.PutLazyGeometry[mode.decoration, wire, LazyGeometryEnumerate]; CoreGeometry.PutLazyPins[mode.decoration, wire, LazyPinsEnumerate]; publics _ CONS [wire, publics]; ENDLOOP; cellType _ CoreClasses.CreateRecordCell[ public: CoreOps.CreateWire[publics], internal: CoreOps.CreateWire[publics], instances: NIL, name: CDDirectory.Name[obj] ]; CoreGeometry.PutObject[mode.decoration, cellType, obj]; result _ cellType; }; RegisterExtractProc[$ExtractRouting, ExtractRouting]; END. ExtractRouting.mesa Copyright c 1986 by Xerox Corporation. All rights reversed. Created by Bertrand Serlet February 13, 1987 7:16:25 pm PST Bertrand Serlet February 13, 1987 8:07:20 pm PST Extract proc for RoutingClass objects We build the CellType Κ•˜codešœ™Jšœ Οmœ1™