CoreClasses.mesa 
Copyright © 1985 by Xerox Corporation. All rights reserved.
Bertrand Serlet, March 18, 1986 0:05:29 am PST
Pradeep Sindhu December 2, 1985 3:36:33 pm PST
Barth, May 6, 1986 5:05:24 pm PDT
Spreitzer, January 10, 1986 4:03:48 pm PST
DIRECTORY Core;
CoreClasses: CEDAR DEFINITIONS = BEGIN OPEN Core;
Theory
This interface defines a set of Classes of general interest.
Record
The record class 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 create this data structure:
1) The actual wire of an instance must conform to the public wire of the cell type which is pointed to by the instance.
2) The actual field of an instance must point directly to a wire that is not reachable from the internal of the record cell. This wire, as is true of all public wires, must not be atomic and all of its subwires must be reachable from the internal of the cell type.
3) The public field of a cell type of record cell class must point to a wire that is not reachable from the internal of the record cell. This wire, as is true of all public wires, must not be atomic and all of its subwires must be reachable from the internal of the cell type.
4) The first level of the internal wire hierarchy exists only to allow smooth recursion, and to give a handle on the whole internal. Consequently, internal.size=0 should be interpreted as an empty internal and not an atomic wire. CoreOps naming strategy requires that internal are immutable, once part of a recordCell.
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
CellInstances: TYPE = LIST OF CellInstance;
CreateRecordCell: PROC [public: Wire, internal: Wire, instances: LIST OF CellInstance, name: ROPENIL, props: Properties ← NIL] RETURNS [recordCell: CellType];
Checks that actuals conform to the sub publics and that actuals and public are part of the internals.
CreateInstance: PROC [actual: Wire, type: CellType, name: ROPENIL, props: Properties ← NIL] RETURNS [instance: CellInstance];
SetCellInstanceName: PROC [instance: CellInstance, name: ROPE] RETURNS [sameInstance: CellInstance];
GetCellInstanceName: PROC [instance: CellInstance] RETURNS [name: ROPE];
CorrespondingActual: PROC [instance: CellInstance, public: Wire] RETURNS [actual: Wire ← NIL];
Returns the actual bound to the public in the instance, NIL if not found
ReverseCellInstances: PROC [instances: CellInstances] RETURNS [rev: CellInstances ← NIL];
Reverses a list of CellInstances
Transistor
transistorCellClass: CellClass;
Transistor: TYPE = REF TransistorRec;
TransistorRec: TYPE = RECORD [
type: TransistorType ← nE,
length: NAT ← 2,
width: NAT ← 4];
TransistorType: TYPE = {nE, pE, nD};
TransistorPort: TYPE = MACHINE DEPENDENT {gate(0), ch1(1), ch2(2)};
transistorTypeNames: ARRAY TransistorType OF ROPE;
transistorPortNames: ARRAY TransistorPort OF ROPE;
Public wires: gate, ch1, ch2.
CreateTransistor: PROC [args: TransistorRec, name: ROPENIL, props: Properties ← NIL] RETURNS [transistor: CellType];
Identity
An identity cell type has the same Core data structure as some other cell type but has a new property list. It is useful when properties describe instances of a class all of whose members have the same Core data structure.
identityCellClass: CellClass;
CreateIdentity: PROC [cellType: CellType, name: ROPENIL, props: Properties ← NIL] RETURNS [identity: CellType];
Unspecified
Unspecified is the 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;
CreateUnspecified: PROC [public: Wire ← NIL, name: ROPENIL, props: Properties ← NIL] RETURNS [cellType: CellType];
END.