CDRoutingObjects.mesa
Copyright © 1987 by Xerox Corporation. All rights reversed.
Complete implementation of an idea from Bertrand Serlet
Created by: Christian Jacobi, March 16, 1987 4:50:53 pm PST
Last edited by: Christian Jacobi, March 16, 1987 8:56:20 pm PST
DIRECTORY CD, Rope, SymTab;
CDRoutingObjects: CEDAR DEFINITIONS =
BEGIN
Routing objects allow a space-efficient representation of routing areas. This representation also retains the node structure of the cell, and so is very time-efficient for lazy extractions.
Expansion of a Routing object results in an ordinary cell, so that all processors for which time or space is not an issue do not need modification. All instances of the expanded cell have a copy of the properties of their node. This mechanism allows all instances of the expanded cell to carry the $SignalName property (for the benefit of the extractor).
routingClass: CD.ObjectClass;
RoutingSpecific: TYPE = REF RoutingRep; -- Type for specific of routingClass objects
RoutingRep: TYPE = RECORD [
ir: CD.Rect,  -- interest rect
scaleHint: REAL ← 0, -- guide to display simplification
nodes: SEQUENCE size: NAT OF Node
];
Node: TYPE = REF NodeRep;
NodeRep: TYPE = RECORD [
properties: CD.PropList ← NIL,
geometry: SEQUENCE size: NAT OF PlacedObject
];
PlacedObject: TYPE = RECORD [object: CD.Object, position: CD.Position];
CreateRoutingObject: PROC [nodes: LIST OF Node, ir: CD.Rect ← [0, 0, -1, -1]] RETURNS [routing: CD.Object];
-- Creates a new routing cell object.
-- Order of nodes is preserved in the sequence.
-- Uses each node in place; caller must give up access to nodes.
CreateNode: PROC [geometry: LIST OF PlacedObject, properties: CD.PropList ← NIL] RETURNS [node: Node];
-- Convenience function that takes a list (instead of a sequence) of PlacedObject as argument.
-- Uses PlacedObject's in place.
CreateNodes: PROC [table: SymTab.Ref] RETURNS [nodes: LIST OF Node];
-- Convenience function that takes a SymTab as argument.
-- Creates nodes from a SymTab that maps names to their corresponding geometry.
-- Each value of table is of type REF LIST OF PlacedObject.
-- Each key is added as an $SignalName properties on the corresponding node.
-- Uses nodes in place.
SetSimplificationTreshhold: PROC [ro: CD.Object, val: REAL←-1];
-- The routing object will be simplified if its height on the screen is smaller than val pixels
-- val -1: tries a fair guess for val
END.