Core.mesa
Copyright © 1985 by Xerox Corporation. All rights reserved.
Barth, October 2, 1985 9:34:39 am PDT
Bertrand Serlet August 14, 1985 10:47:53 am PDT
Spreitzer, September 9, 1985 11:01:46 pm PDT
DIRECTORY
IO USING [STREAM],
Rope USING [ROPE];
Core: CEDAR DEFINITIONS = BEGIN
Theory
This interface defines the basic data structures for the Core design automation system. It is actually a general decomposition facility that breaks designs down into cells which are then bound together. Any of the procedures which implement operations upon these types may raise StructureError[InvariantFailed]. This indicates that the implementation has a bug in it. Clients should notify the maintainers should this occur.
Common Types and Errors
ROPE: TYPE = Rope.ROPE;
STREAM: TYPE = IO.STREAM;
Properties: TYPE = REF PropertyRec;
PropertyRec: TYPE;
StructureError: SIGNAL [type: StructureErrorType, message: ROPENIL, data: REF ANYNIL] RETURNS [newData: REF ANYNIL];
StructureErrorType: TYPE = {DuplicateName, InvariantFailed, MissingParameter, NoSuchName};
Designs
Design: TYPE = REF DesignRec;
DesignRec: TYPE = RECORD [
name: ROPENIL,
data: DesignData ← NIL,
properties: Properties ← NIL];
DesignData: TYPE = REF DesignDataRec;
DesignDataRec: TYPE;
Wires
Wire: TYPE = REF WireRec;
WireRec: TYPE = RECORD [
name: ROPENIL,
structure: WireStructure ← atom,
elements: WireSequence ← NIL,
properties: Properties ← NIL];
WireStructure: TYPE = {sequence, record, atom};
WireSequence: TYPE = REF WireSequenceRec;
WireSequenceRec: TYPE = RECORD [c: SEQUENCE size: NAT OF Wire];
wire.structure=atom Ò wire.elements=NIL.
wire.structure#atom Ò wire.elements`NIL (and wire.elements.size=0 is legal).
Cell Classes
CellClass: TYPE = REF CellClassRec;
CellClassRec: TYPE = RECORD [
name: ROPE,
recast: RecastProc ← NIL,
read: ReadProc,
write: WriteProc,
properties: Properties ← NIL];
A cell class must have recast, read and write procedures (except RecordCellClass and primitive classes elide the recast proc).
RecastProc: TYPE = PROC [me: CellType] RETURNS [new: CellType];
Returns a new cell type with the same structure as me, expressed in a more familiar way.
A recast proc may or may not return a unique copy of the recast; see CoreOps for a procedure that guarantees uniqueness of result.
WriteProc: TYPE = PROC [out: STREAM, me: CellType];
ReadProc: TYPE = PROC [design: Design, in: STREAM] RETURNS [me: CellType];
Cell Types
CellType: TYPE = REF CellTypeRec;
CellTypeRec: TYPE = RECORD [
name: ROPE,
class: CellClass,
publicWire: Wire,
data: REF ANYNIL, 
properties: Properties ← NIL];
CellTypes may not share any part of a publicWire.
END.