DIRECTORY Core USING [CellType, ROPE, Wire, WireSequence], CoreClasses USING [CellInstance, TransistorType]; CoreBeau: CEDAR DEFINITIONS = BEGIN CellType: TYPE = Core.CellType; ROPE: TYPE = Core.ROPE; Wire: TYPE = Core.Wire; WireSequence: TYPE = Core.WireSequence; CellInstance: TYPE = CoreClasses.CellInstance; TransistorType: TYPE = CoreClasses.TransistorType; WR: TYPE = REF; Wires: PROC [wr1, wr2, wr3, wr4, wr5, wr6, wr7: WR _ NIL] RETURNS [WireSequence]; Seq: PROC [wr: WR, length: NAT] RETURNS [WireSequence]; Index: PROC [wr: WR, index: NAT] RETURNS [WR]; Indexes: PROC [wr: WR, start: NAT _ 0, length: NAT] RETURNS [WireSequence]; PA: TYPE = RECORD [public, actual: WR]; Instance: PROC [type: CellType, pa1, pa2, pa3, pa4, pa5, pa6: PA _ []] RETURNS [CellInstance]; Cell: PROC [name: ROPE _ NIL, public, onlyInternal: WireSequence _ NIL, instances: LIST OF CellInstance] RETURNS [CellType]; Transistor: PROC [name: ROPE _ NIL, type: TransistorType _ nE, length: NAT _ 2, width: NAT _ 4] RETURNS [CellType]; SequenceCell: PROC [name: ROPE _ NIL, baseCell: CellType, count: NAT, sequencePorts: WireSequence _ NIL] RETURNS [CellType]; FindWire: PROC [cell: CellType, wr: WR] RETURNS [Wire]; END. ΄CoreBeau.mesa Copyright c 1985 by Xerox Corporation. All rights reserved. Created by Bertrand Serlet, November 13, 1985 2:59:33 pm PST Bertrand Serlet, November 13, 1985 7:41:56 pm PST This interface should provide all the syntactic sugar to help the designer create Core data structures, while retaining the ability to have handles on the real Core objects. Aliases Creation of Wires WR is the union of the types Wire, WireSequence and ROPE, for user convenience. Basic constructor for creating a structured wire. It is checked that each WR is of type Wire, WireSequence or ROPE. Constructor for creating structured wires with the attribute 'sequence'. It is checked that WR is either an atomic Wire or a ROPE. Extractor for extracting a wire from a sequence. If the argument is a WireSequence, the wire is actually extracted. If the argument is a Wire, it is checked that it has structure, and then the element is extracted. If the argument is a ROPE, the suffix "[index]" is added to it. All other types are illegal. Extractor/Constructor for creating a structured wire with the attribute 'sequence'. If the argument is a WireSequence, the sub wires are actually extracted and recomposed. If the argument is a Wire, it is checked that it has structure, and then the elements are extracted and recomposed. If the argument is a ROPE, a composed wire made subwires named after the suffixed rope is constructed. Bindings, Instances and RecordCell Records a binding between part of the public The bindings might be incomplete, in that case new wires are created to fill the actual. Creates a CoreClasses.RecordCell, creates an internal by making the union of public and onlyInternal, names all those wires with unique names, fills the public, fills the instances, and finally replaces all actual wires by wires having the same name in the public. Other cell type creation Creates a CoreClasses.RecordCell, creates an internal by making the union of public and onlyInternal, names all those wires with unique names, fills the public, fills the instances, and finally replaces all actual wires by wires having the same name than part of the public. Creates a CoreSequence.SequenceCellType. Utility Looks into the internal (If the cell is a RecordCell) or in the public (otherwire) to retrieve a wire equal (if wr is a Wire or a WireSequence) or having same name (if wr is a Wire or a ROPE). Returns NIL when not finding wr or finding it more than once. Κ¨˜codešœ ™ Kšœ Οmœ1™