CoreArray.mesa 
Copyright © 1985 by Xerox Corporation. All rights reserved.
Barth, August 21, 1985 4:01:15 pm PDT
DIRECTORY Core;
CoreArray: CEDAR DEFINITIONS = BEGIN OPEN Core;
Theory
The theory section is not up to date. This interface has been generalized to handle heterogenous and homogenous arrays.
This interface describes the structuring mechanism which takes a collection of cell instances of identical type and binds them together. Currently it is only useful to sequence cells whose publicWire consists of a top level record or sequence structure. The public wire of the assembly is computed from the base and the sequence and stitch fields. The components of the top level sequence indicated by the sequence field turn into wires which are sequenced by the count. The components of the top level sequence indicated by the stitches field represent portions of the public wire which are bound together with an internal node. The sink of the first instance and the source of the last instance are made part of the public wire of the assembly.
Practice
arrayCellClass: CellClass;
ArrayCellType: TYPE = REF ArrayCellTypeRec;
ArrayCellTypeRec: TYPE = RECORD [
xparams: ArrayParams ← NIL,
yparams: ArrayParams ← NIL,
select: XYSelect ← NIL,
bind: XYBind ← NIL,
cellTypes: SEQUENCE length: NAT OF CellType];
If the select is NIL then there must be one and only one cellType. If the bind is NIL then the actual wire of each instance is computed according to the following rules:
The publicWire of each of the cellTypes must have the same structure.
ArrayParams: TYPE = REF ArrayParamsRec;
ArrayParamsRec: TYPE = RECORD [
count: NAT ← 0,
orthogonal: Ports ← NIL,
chains: SEQUENCE length: NAT OF Ports];
Ports: TYPE = REF PortsRec;
PortsRec: TYPE = RECORD [SEQUENCE length: NAT OF PortIndex];
PortIndex: TYPE = NAT;
XYSelect: TYPE = PROC [x, y: INT, cellType: CellType] RETURNS [cellTypeIndex: NAT];
XYBind: TYPE = PROC [x, y: INT, cellType: CellType] RETURNS [actual: Wire];
These procedures must persist during the lifetime of the core data structure which accesses them.
Create: PROC [arrayCellType: ArrayCellType, name: ROPENIL, publicWire: Wire ← NIL] RETURNS [cellType: CellType];
If the publicWire argument is NIL then the client must set cellType.publicWire. Data may be passed to the select procedure on the property list of cellType.
Print: PROC [arrayCellType: ArrayCellType, out: STREAM];
END.