DIRECTORY DABasics, CD, Core, CoreFlat, CoreGeometry, RefTab, Rope, RTBasic, RTCoreUtil; RTStructure: CEDAR DEFINITIONS IMPORTS RTCoreUtil, RefTab = BEGIN Error: ERROR [errorType: ErrorType _ callingError, explanation: Rope.ROPE _ NIL]; Signal: SIGNAL [signalType: ErrorType _ callingError, explanation: Rope.ROPE _ NIL]; ErrorType: TYPE = {programmingError, callingError, noResource, designRuleViolation, other}; Instances, Objects, Nets, InstancePins, ObjectPins, NetPins: TYPE = RefTab.Ref; -- A RefTab for the instances, interconnections and the pins Key: TYPE = REF; Structure: TYPE = REF StructureRec; StructureRec: TYPE = RECORD [ name: Rope.ROPE _ NIL, instances: Instances _ NIL, -- invocations of objects within the cell being laid out objects: Objects _ NIL, -- objects within the cell being laid out nets: Nets _ NIL, -- public and private wires for the cell being laid out outerInstance: Instance _ NIL, -- instance representing next level of heirarchy (if any) netWidth: NetWidthProc _ NIL, properties: Core.Properties _ NIL ]; NetWidthProc: TYPE = PROC[net: Net, structure: Structure, direction: RTBasic.Direction, context: REF ANY _ NIL] RETURNS [wireWidth: INT]; WidestPinProc: NetWidthProc; Instance: TYPE = REF InstanceRec; InstanceRec: TYPE = RECORD [ name: Rope.ROPE _ NIL, -- should be unique among the instances placed: BOOLEAN _ FALSE, -- indicates if instance has been placed position: DABasics.Position _ [0, 0], -- current position of instance orientation: DABasics.Orientation _ original, -- current orientation object: Object _ NIL, -- the object definition iPins: InstancePins _ NIL, -- bindings for pins for this instance properties: Core.Properties _ NIL, any: REF ANY _ NIL -- for use by client ]; InstancePin: TYPE = REF InstancePinRec; -- specifies binding of pin to net InstancePinRec: TYPE = RECORD [ oPin: ObjectPin _ NIL, net: Net _ NIL ]; HeirarchyLevel: TYPE = {this, nextHigher}; -- next higher indicates a public Object: TYPE = REF ObjectRec; ObjectRec: TYPE = RECORD [ name: Rope.ROPE _ NIL, -- should be unique among the objects cdObject: CD.Object _ NIL, -- the base object definition heirarchyLevel: HeirarchyLevel _ this, -- level of this object oPins: ObjectPins _ NIL, -- bindings for pins for this instance properties: Core.Properties _ NIL, any: REF ANY _ NIL -- for use by client ]; ObjectPin: TYPE = REF ObjectPinRec; ObjectPinRec: TYPE = RECORD [ name: Rope.ROPE _ NIL, -- optional name of connection heirarchyLevel: HeirarchyLevel _ this, -- level of this object physicalPins: LIST OF PhysicalPin _ NIL, -- physical connections for this logical pin properties: Core.Properties _ NIL ]; PhysicalPin: TYPE = REF PhysicalPinRec; PhysicalPinRec: TYPE = RECORD [ range: Range _ [0, 0], -- in interest coordinate system side: RTBasic.SideOrNone _ none, -- side toward which routing should connect layer: CD.Layer _ CD.undefLayer, depth: INT _ 0, -- depth of pin into object, 0 if on edge properties: Core.Properties _ NIL ]; Range: TYPE = RECORD [ min, max: INT -- range of pin along side ]; Net: TYPE = REF NetRec; NetRec: TYPE = RECORD [ name: Rope.ROPE _ NIL, -- should be unique among the nets nPins: NetPins _ NIL, -- pins for this net properties: Core.Properties _ NIL, any: REF ANY _ NIL -- for use by client ]; NetPin: TYPE = REF NetPinRec; -- binding to instance and pin on object NetPinRec: TYPE = RECORD [ oPin: ObjectPin _ NIL, -- pin on defining object instance: Instance _ NIL -- the owning instance ]; CreateForRopes: PROC [name: Rope.ROPE _ NIL, nInsts, nObjs, nNets, nPubs: NAT _ 17, netWidth: NetWidthProc _ WidestPinProc, properties: Core.Properties _ NIL] RETURNS [Structure]; FetchInstance: PROC [structure: Structure, key: Key] RETURNS [found: BOOLEAN, instance: Instance]; StoreInstance: PROC [structure: Structure, key: Key, instance: Instance] RETURNS [BOOLEAN] = INLINE{RETURN[RefTab.Store[structure.instances, key, instance]]}; FetchInstancePin: PROC [instance: Instance, key: Key] RETURNS [found: BOOLEAN, iPin: InstancePin]; StoreInstancePin: PROC [instance: Instance, key: Key, iPin: InstancePin] RETURNS [BOOLEAN] = INLINE{RETURN[RefTab.Store[instance.iPins, key, iPin]]}; EnumerateInstances: PROC [structure: Structure, action: EachInstanceAction] RETURNS [quit: BOOLEAN]; EachInstanceAction: TYPE = PROC [key: Key, instance: Instance] RETURNS [quit: BOOLEAN _ FALSE]; EnumerateInstancePins: PROC [instance: Instance, action: EachInstancePinAction] RETURNS [quit: BOOLEAN]; EachInstancePinAction: TYPE = PROC [key: Key, instance: Instance, iPin: InstancePin] RETURNS [quit: BOOLEAN _ FALSE]; FetchObject: PROC [structure: Structure, key: Key] RETURNS [found: BOOLEAN, object: Object]; StoreObject: PROC [structure: Structure, key: Key, object: Object] RETURNS [BOOLEAN] = INLINE{RETURN[RefTab.Store[structure.objects, key, object]]}; FetchObjectPin: PROC [object: Object, key: Key] RETURNS [found: BOOLEAN, oPin: ObjectPin]; StoreObjectPin: PROC [object: Object, key: Key, oPin: ObjectPin] RETURNS [BOOLEAN] = INLINE{RETURN[RefTab.Store[object.oPins, key, oPin]]}; StorePhysicalPin: PROC [oPin: ObjectPin, pPin: PhysicalPin] = INLINE{oPin.physicalPins _ CONS[pPin, oPin.physicalPins]}; EnumerateObjects: PROC [structure: Structure, action: EachObjectAction] RETURNS [quit: BOOLEAN]; EachObjectAction: TYPE = PROC [key: Key, object: Object] RETURNS [quit: BOOLEAN _ FALSE]; EnumerateObjectPins: PROC [object: Object, action: EachObjectPinAction] RETURNS [quit: BOOLEAN]; EachObjectPinAction: TYPE = PROC [key: Key, object: Object, oPin: ObjectPin] RETURNS [quit: BOOLEAN _ FALSE]; EnumeratePhysicalPins: PROC [oPin: ObjectPin, action: EachPhysicalPinAction] RETURNS [quit: BOOLEAN]; EachPhysicalPinAction: TYPE = PROC [oPin: ObjectPin, pPin: PhysicalPin] RETURNS [quit: BOOLEAN _ FALSE]; PosOfObjectPin: PROC [object: Object, pPin: PhysicalPin] RETURNS [position: DABasics.Position]; FetchNet: PROC [structure: Structure, key: Key] RETURNS [found: BOOLEAN, net: Net]; StoreNet: PROC [structure: Structure, key: Key, net: Net] RETURNS [BOOLEAN] = INLINE{RETURN[RefTab.Store[structure.nets, key, net]]}; FetchNetPin: PROC [net: Net, key: Key] RETURNS [found: BOOLEAN, nPin: NetPin]; StoreNetPin: PROC [net: Net, key: Key, nPin: NetPin] RETURNS [BOOLEAN] = INLINE{RETURN[RefTab.Store[net.nPins, key, nPin]]}; EnumerateNets: PROC [structure: Structure, action: EachNetAction] RETURNS [quit: BOOLEAN]; EachNetAction: TYPE = PROC [key: Key, net: Net] RETURNS [quit: BOOLEAN _ FALSE]; EnumerateNetPins: PROC [net: Net, action: EachNetPinAction] RETURNS [quit: BOOLEAN]; EachNetPinAction: TYPE = PROC [key: Key, net: Net, nPin: NetPin] RETURNS [quit: BOOLEAN _ FALSE]; IsPublic: PROC [net: Net] RETURNS [isPublic: BOOLEAN]; CreateFromCore: PROC [root: Core.CellType, flattenCellType: RTCoreUtil.FlattenCellTypeProc _ RTCoreUtil.defaultFlatten, instanceName: InstanceName, wireName: WireName, interestingProperties: RTCoreUtil.PropertyKeys _ NIL, decoration: CoreGeometry.Decoration, libDesign: CD.Design _ NIL, properties: Core.Properties _ NIL] RETURNS [structure: Structure]; InstanceName: TYPE ~ PROC [root: Core.CellType, flatCellType: CoreFlat.FlatCellTypeRec] RETURNS [Rope.ROPE]; WireName: TYPE ~ PROC [root: Core.CellType, flatWire: CoreFlat.FlatWireRec] RETURNS [Rope.ROPE]; InsertPublic: PROC [structure: Structure, name: Rope.ROPE, cdObject: CD.Object, pinFilter: CDPinFilterProc _ NIL, userData: REF ANY _ NIL, makeHashKey: HashKeyProc _ NIL]; InsertInstance: PROC [structure: Structure, name: Rope.ROPE, position: DABasics.Position, orientation: DABasics.Orientation, cdObject: CD.Object, pinFilter: CDPinFilterProc _ NIL, userData: REF ANY _ NIL, makeHashKey: HashKeyProc _ NIL]; CDPinFilterProc: TYPE = PROC [inst: CD.Instance, obj: CD.Object, userData: REF ANY] RETURNS [keepIt: BOOLEAN _ TRUE]; HashKeyProc: TYPE = PROC [instance: CD.Instance] RETURNS [key: Rope.ROPE]; PrintStructure: PUBLIC PROC [structure: Structure]; CoordsAlongSide: PROC [instance: CD.Instance, object: CD.Object, side: RTBasic.Side] RETURNS [range: Range]; TranslateRange: PROC [instance: Instance, pPin: PhysicalPin] RETURNS [range: Range]; END. ๊RTStructure.mesa Copyright (C) 1986 by Xerox Corporation. All rights reserved. Created by Bryan Preas, August 21, 1986 6:23:51 pm PDT Theory This interface provides a simple way to describe the structure in a cell to be laid out. This includes the interconnections (public and private), the instances and their objects, Facilities are providesd to create this structure from a Core cellType as well as a collection of ChipNDale objects with pins ( binding by name in this case). This is intended to be used as an interface to the routers as well as their internal data structure. Errors Types net width is same as width of widest pin Building and Using The Structure Table Creating The Structure Table Instance Manipulation looks up key in table, returns associated instance (if any) if found is TRUE, net is value associated with given key if found is FALSE, instance is NIL returns TRUE after inserting new instance returns FALSE after overwriting old instance for existing key-instance pair looks up key in table, returns associated iPin (if any) if found is TRUE, net is value associated with given key if found is FALSE, iPin is NIL returns TRUE after inserting new iPin returns FALSE after overwriting old instancePin for existing key-instance pair enumerates objects currently in symbol table in unspecified order instances inserted/deleted during enumeration may or may not be seen applies action to each object until action returns TRUE or no more pairs returns TRUE if some action returns TRUE enumerates pins on instance in unspecified order pins inserted/deleted during enumeration may or may not be seen applies action to each pin until action returns TRUE or no more pins returns TRUE if some action returns TRUE Object Manipulation looks up key in table, returns associated object (if any) if found is TRUE, net is value associated with given key if found is FALSE, net is NIL returns TRUE after inserting new object returns FALSE after overwriting old net for existing key-net pair looks up key in table, returns associated objectPin (if any) if found is TRUE, net is value associated with given key if found is FALSE, objectPin is NIL returns TRUE after inserting new objectPin returns FALSE after overwriting old objectPin for existing key-objectPin pair add a new physical pin to a logical pin enumerates objects currently in symbol table in unspecified order instances inserted/deleted during enumeration may or may not be seen applies action to each object until action returns TRUE or no more pairs returns TRUE if some action returns TRUE enumerates pins on object in unspecified order pins inserted/deleted during enumeration may or may not be seen applies action to each segment until action returns TRUE or no more object pins returns TRUE if some action returns TRUE enumerates physical pins on ObjectPin in unspecified order pins inserted/deleted during enumeration may or may not be seen applies action to each segment until action returns TRUE or no more object pins returns TRUE if some action returns TRUE returns position of object Pin wrt the object Net Manipulation looks up key in table, returns associated net (if any) if found is TRUE, net is value associated with given key if found is FALSE, net is NIL returns TRUE after inserting new pair returns FALSE after overwriting old net for existing key-net pair looks up key in table, returns associated netPin (if any) if found is TRUE, net is value associated with given key if found is FALSE, netPin is NIL returns TRUE after inserting new netPin returns FALSE after overwriting old net for existing key-netPin pair enumerates nets currently in symbol table in unspecified order nets inserted/deleted during enumeration may or may not be seen applies action to each net until action returns TRUE or no more nets returns TRUE if some action returns TRUE enumerates pins on net in unspecified order pins inserted/deleted during enumeration may or may not be seen applies action to each pin until action returns TRUE or no more pins returns TRUE if some action returns TRUE TRUE iff this tet has a connection to the next higher level Utilities derive the interconnection requirements from a Core data structure. instances: Core cellInstance of flattened object instancePins: Core public wires on associated object objects: Core cellType objectPins: Rope name of defining pins nets: Core actual wires of flattened object netPins: publicWire of flattened object construct an instance, an object and put the pins on the interest rec of the object in the structure if pinFilter returns true. makeHashKey can be used to transform the pin names to net names. Ropes are use for keys; this means that CreateForRopes must be used to create the structure used by theis procedure. In addition, the obhect and pins must be named. pinFilter = NIL => keep all pins on object. construct an instance, an object and put the pins on the interest rec of the object in the structure if pinFilter returns true. makeHashKey can be used to transform the pin names to net names. Ropes are use for keys; this means that CreateForRopes must be used to create the structure used by theis procedure. In addition, the obhect and pins must be named. pinFilter = NIL => keep all pins on object. provides client an opportunity to disregard some pins. print the given structure ส ฦ˜Jšœ™Jšœ?™?Jšœ3ฯk™6J˜š œ˜ Jšœ œB˜N—J˜šฯn œœ ˜Jšœ˜Jš˜—head™Ibodyšœำ™ำL™d—™Jšžœœ9œœ˜QJšžœœ:œœ˜TJšœ œL˜[—™Icodešœ=œฯc=˜šœœœ˜M˜—Mšœ œœ˜#šœœœ˜Mšœ œœ˜MšœœŸ8˜UMšœœŸ*˜DMšœ œŸ7˜KMšœœŸ9˜YMšœœ˜Mšœ˜!M˜—MšœœœHœœœœ œ˜‰šž œ˜M™(—˜M˜—Mšœ œœ ˜!šœ œœ˜Mšœ œœŸ(˜AMšœœœŸ(˜BMšœ'Ÿ˜FMšœ/Ÿ˜EMšœœŸ˜0MšœœŸ&˜BMšœœ˜"MšœœœœŸ˜)M˜M˜—Mšœ œœŸ"˜Kšœœœ˜Mšœœ˜Mšœ ˜M˜M˜—MšœœŸ!˜LMšœœœ ˜šœ œœ˜Mšœ œœŸ&˜?Mšœ œ œŸ˜9Mšœ'Ÿ˜>MšœœŸ&˜AMšœœ˜"MšœœœœŸ˜)M˜M˜—Mšœ œœ˜#šœœœ˜Mšœ œœŸ˜7Mšœ'Ÿ˜>MšœœœœŸ,˜UMšœ˜!M˜M˜—Mšœ œœ˜'šœœœ˜MšœŸ ˜9Mšœ"Ÿ+˜MMšœœ œ ˜ MšœœŸ)˜;Mšœ˜!M˜M˜—šœœœ˜Mšœ œŸ˜*Mšœ˜—M˜Mšœœœ˜šœœœ˜Mšœ œœŸ#˜™KM˜—šžœœ œ œ˜bMšœ7™7Mšœ œ(™8Mšœ œ ™M˜—š žœœ3œœœœ+˜•Mšœœ™%MšœœA™NM˜—šžœœ4œœ˜dMšœA™AMšœD™DMšœ3œ™HMšœœ™(—Mš œœœ œœœ˜_M˜šžœœ5œœ˜hMšœ0™0Mšœ?™?Mšœ0œ™DMšœœ™(—Mš œœœ3œœœ˜uK™šž œœ"œ œ˜\Mšœ9™9Mšœ œ(™8Mšœ œ ™M˜—š ž œœ2œœœœ0˜”Mšœœ™'Mšœœ4™AM™—šžœœœ œ˜ZMšœ<™™>Mšœ?™?Mšœ0œ™DMšœœ™(—Mš œœœœœœ˜PM˜šžœœ&œœ˜TMšœ+™+Mšœ?™?Mšœ0œ™DMšœœ™(—š œœœ$œœœ˜aM˜—šžœœ œ œ˜6Mšœ7™;——™ šžœœลœ2œ œ œœ˜แJšœC™Cšœ0™0J™4—šœ™J™(—™+Jšœ(™(J™—M˜—Mš œœœ?œœ˜lMš œ œœ7œœ˜`M˜šž œœ#œ œ&œ œœœœ˜ซMšœม™มMšœณœ™า—M˜šžœœ#œLœ&œ œœœœ˜ํMšœม™มMšœณœ™า—M˜šœœœœœœœœ œœ˜uM™6M™—Mš œ œœ œ œ œ˜JM˜šžœœœ˜3Mšœ™—M˜Mš žœœ œœœ˜lM˜šžœœ)œ˜TM˜——Mšœ˜—…— @บ