CoreClasses.mesa 
Copyright © 1985 by Xerox Corporation. All rights reserved.
Bertrand Serlet, November 26, 1985 11:48:59 am PST
Pradeep Sindhu December 2, 1985 3:36:33 pm PST
DIRECTORY Core;
CoreClasses: CEDAR DEFINITIONS = BEGIN OPEN Core;
Theory
This interface defines a set of Classes of general interest.
Record
Record describes the structuring mechanism which takes a collection of cell types of various classes and binds them together.
Some invariants must be established by programs which creates this data structure:
1) For each instance the actual field must conform to the public field of the cell type which is pointed to by the instance.
2) The wires of each actual field must point to wires that are reachable from the internal of the RecordCell.
3) The public of the CellType must point to wires that are reachable from the internal of the RecordCell.
4) The public of the CellType is a non atomic wire.
recordCellClass: CellClass;
RecordCellType: TYPE = REF RecordCellTypeRec;
RecordCellTypeRec: TYPE = RECORD [
internal: Wire,
instances: SEQUENCE size: NAT OF CellInstance];
internal.size#0
instances.size may be 0
CellInstance: TYPE = REF CellInstanceRec;
CellInstanceRec: TYPE = RECORD [
actual: Wire,
type: CellType,
properties: Properties ← NIL];
actual.size#0
CreateRecordCell: PROC [public: Wire, internal: Wire, instances: LIST OF CellInstance, name: ROPENIL, props: Properties ← NIL] RETURNS [recordCell: CellType];
GetCellInstanceName: PROC [instance: CellInstance] RETURNS [name: ROPENIL];
Convenience prop for finding the name of an instance. The property used is CoreOps.nameProp
RecordPrint: PROC [recordCellType: RecordCellType, out: STREAM];
CorrespondingActual: PROC [instance: CellInstance, public: Wire] RETURNS [actual: Wire ← NIL];
Returns the actual bound to the public in the instance, NIL if not found
internalFullName: ATOM;
Used to put full names on internal wires when CoreOps.NameAllWires is called.
Transistor
Until the next release, for simplifying the software, a transistor only have 3 wires.
transistorCellClass: CellClass;
Transistor: TYPE = REF TransistorRec;
TransistorRec: TYPE = RECORD [
type: TransistorType ← nE,
length: NAT ← 2,
width: NAT ← 4];
TransistorType: TYPE = {nE, pE, nD};
Public wires: gate, ch1, ch2.
CreateTransistor: PROC [args: TransistorRec] RETURNS [transistor: CellType];
Identity
identityCellClass: CellClass;
CreateIdentity: PROC [cellType: CellType, name: ROPENIL, props: Properties ← NIL] RETURNS [identity: CellType];
Returns a CellType which refers to the original CellType but has a new property list. Useful when properties describe instances of a class all of whose members have the same Core data structure.
Unspecified
Unspecified is the (structural) cell class that means to not specify structure. Cell types in this class are not necessarily leaves, nor composites --- their internal structure is unspecified.
unspecifiedCellClass: CellClass;
END.