Core.mesa
Copyright © 1985 by Xerox Corporation. All rights reserved.
Barth, January 8, 1986 11:53:00 am PST
Bertrand Serlet April 22, 1986 5:12:23 pm PST
Spreitzer, September 9, 1985 11:01:46 pm PDT
DIRECTORY
IO USING [STREAM],
Properties USING [PropList],
Rope USING [ROPE];
Core: CEDAR DEFINITIONS = BEGIN OPEN ImplementationProperties: Properties;
Theory
This interface defines the basic data structure used for representing the structure of a design as a tree. Each node of the tree is a cell type which has a cell class. A cell class is a mechanism for representing the collection of children of a node. The leaves of the tree have cell classes which are primitive. Except for the record cell class and primitive cell classes all cell classes have recast procedures which are a partially ordered set with the record cell class as root. A recast procedure converts the representation of the children of a cell type into a representation which is closer to the root of the partially ordered set. Thus tools which interpret this structure are only required to interpret the record cell class and the primitive cell classes since they may freely convert a cell type of any other cell class to a cell type of record cell class. They may want to interpret other cell classes for efficiency reasons. Wires are directed acyclic graphs. The leaves of a wire DAG represent a single electrical node. The interface of a cell type is a wire.
Common Types
ROPE: TYPE = Rope.ROPE;
STREAM: TYPE = IO.STREAM;
Properties: TYPE = PRIVATE ImplementationProperties.PropList;
This type should be opaque, but due to the current compiler restrictions, it is only PRIVATE.
Use always Core.Properties and do NOT use directly Properties.PropList.
Wires
Zero size means the wire is atomic.
Wire: TYPE = REF WireRec;
WireRec: TYPE = RECORD [
properties: Properties ← NIL,
elements: SEQUENCE size: NAT OF Wire];
Wires: TYPE = LIST OF Wire;
Cell Classes
A cell class must have recast (except recordCellClass and primitive classes).
CellClass: TYPE = REF CellClassRec;
CellClassRec: TYPE = RECORD [
name: ROPE,
recast: RecastProc ← NIL,
properties: Properties ← NIL];
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.
Cell Types
The type of the referent in the data field depends on the referent stored in the class field. Cell types may not share any part of a public wire. The first level of the public wire hierarchy exists only to allow smooth recursion, and to give a handle on the whole public. Consequently, public.size=0 should be interpreted as an empty public and not an atomic wire. CoreOps naming strategy requires that public are immutable, once part of a cellType.
CellType: TYPE = REF CellTypeRec;
CellTypeRec: TYPE = RECORD [
class: CellClass,
public: Wire,
data: REF ANYNIL, 
properties: Properties ← NIL];
END.