SoftHdwBasics.mesa
Copyright Ó 1988 by Xerox Corporation. All rights reserved.
Barth, August 31, 1989 2:59:35 pm PDT
DIRECTORY DABasics, RefTab, Rope, SunRPC, SunRPCAuth;
SoftHdwBasics: CEDAR DEFINITIONS = BEGIN
ArrayPositions: TYPE = LIST OF ArrayPosition;
ArrayPosition: TYPE = REF ArrayPositionRec;
ArrayPositionRec: TYPE = RECORD [
type: NodeType ← OToP,
orientation: Orientation ← Vertical,
chip: Position ← [0, 0],
minorArray: Position ← [0, 0],
grain: Position ← [0, 0]];
NodeType: TYPE = {OToP, RUToP, LDToP, LToP, PToI, PToRU, PToLD, PToL, ORUToI, LDToLD, OLDToI, ORUToL, Tristate, RUToRU, ORUToLD, LDToI, OLDToRU, LToI, RUToI, Inverter, FlipFlop, ParallelInput, InputEnabled, RAMEven, RAMOdd, Master, Input, Interchip, Long, Output, LeftDown, RightUp};
nodeNames: ARRAY NodeType OF Rope.ROPE;
Orientation: TYPE = {Vertical, Horizontal};
orientationNames: ARRAY Orientation OF Rope.ROPE;
Position: TYPE = DABasics.Position;
Input, Interchip, Long, Output, LeftDown, and RightUp are not accessible through Fetch and Store in the actual hardware and they are not state bits in the hardware.
Interchip and all of the edge tiles belong to the minor array or chip to the right or up. The pin tiles belong to the chip up or down, or left or right, depending on the proper low order bit of minorArray. The orientation of InputEnabled refers to the orientation of the output to which the input is connected.
Interchip, Long
vertical: chip, minorArray.x, grain.x
horizontal: chip, minorArray.y, grain.y
OToP, RUToP, LDToP, LToP, PToI, PToRU, PToLD, PToL
vertical: chip, minorArray.x, low order bit of minorArray.y, grain.x
horizontal: chip, low order bit of minorArray.x, minorArray.y, grain.y
Input, Output, LeftDown, RightUp, ORUToI, LDToLD, OLDToI, ORUToL, Tristate, RUToRU, ORUToLD, LDToI, OLDToRU, LToI, RUToI, Inverter, FlipFlop, ParallelInput, Master
vertical: chip, minorArray, grain.x
horizontal: chip, minorArray, grain.y
InputEnabled
vertical: chip, minorArray, grain
horizontal: chip, minorArray, grain
RAMEven, RAMOdd
chip, minorArray
Invariant: Unused indicies in an ArrayPosition are zero.
CreateBase: PROC [sizes: ArrayPosition, useConnectionMachine: BOOLFALSE] RETURNS [array: ArrayBase];
Ignores type and orientation. Uses the rest of the position to size things.
Initialize: PROC [array: ArrayBase];
Fetch: PROC [array: ArrayBase, bit: ArrayPosition, time: INT ← -1] RETURNS [value: BOOL];
Store: PROC [array: ArrayBase, bit: ArrayPosition, value: BOOL];
MasterToSlave: PROC [array: ArrayBase];
Relax: PROC [array: ArrayBase];
Sample: PROC [array: ArrayBase];
ArrayPositionToRope: PROC [position: ArrayPosition] RETURNS [rope: Rope.ROPE];
RopeToArrayPosition: PROC [rope: Rope.ROPE] RETURNS [position: ArrayPosition];
ArrayPositionEqual: RefTab.EqualProc;
ArrayPositionHash: RefTab.HashProc;
The following data structures are not meant to be understood or relied upon by clients.
ArrayBase: TYPE = REF ArrayBaseRec;
ArrayBaseRec: TYPE = RECORD [
sizes: ArrayPosition,
useConnectionMachine: BOOL,
state: ArrayBaseState,
id: CARD,
h: SunRPC.Handle,
c: SunRPCAuth.Conversation];
ArrayBaseState: TYPE = REF ArrayBaseStateRec;
ArrayBaseStateRec: TYPE = RECORD [
positionToEntity: RefTab.Ref, -- grains indexed by Output, minor arrays indexed by RAMEven, long lines by Long
scheduledGrains: Grain ← NIL,
scheduledMinorArrays: MinorArray ← NIL];
MinorArray: TYPE = REF MinorArrayRec;
MinorArrayRec: TYPE = RECORD [
key: ArrayPosition ← NIL,
scheduled: BOOLFALSE,
nextMinorArray: MinorArray ← NIL,
RAMEven, RAMOdd: BOOLFALSE,
vertical: GrainSeq ← NIL,
horizontal: GrainSeq ← NIL];
Grain: TYPE = REF GrainRec;
GrainSeq: TYPE = REF GrainSeqRec;
GrainSeqRec: TYPE = RECORD [elements: SEQUENCE size: CARDINAL OF Grain];
GrainRec: TYPE = RECORD [
key: ArrayPosition ← NIL,
scheduled: BOOLFALSE,
nextGrain: Grain ← NIL,
vertical: BOOLFALSE,
leftDownSelectLeftDown: BOOLFALSE,
leftDown: BOOLFALSE,
rightUpSelectRightUp: BOOLFALSE,
rightUp: BOOLFALSE,
inputSelect: InputSelectIndex ← none,
input: BOOLFALSE,
output: BOOLFALSE,
leftDownGrain: Grain ← NIL,
rightUpGrain: Grain ← NIL,
ORUToL, Tristate: BOOLFALSE,
longControl: LongControl ← off,
longLine: LongLine ← NIL,
minorArray: MinorArray ← NIL,
flipFlop: BOOLFALSE,
master: BOOLFALSE,
invert: BOOLFALSE,
parallelInput: BOOLFALSE,
ORUToI, OLDToI, LDToI, LToI, RUToI: BOOLFALSE,
LDToLD, ORUToLD: BOOLFALSE,
RUToRU, OLDToRU: BOOLFALSE,
perpendicularGrains: SEQUENCE size: CARDINAL OF PerpendicularGrain];
LongControl: TYPE = {off, on, old};
InputSelectIndex: TYPE = {none, oru, old, ld, l, ru};
PerpendicularGrain: TYPE = RECORD [
inputEnabled: BOOL,
grain: Grain];
LongLine: TYPE = REF LongLineRec;
LongLineRec: TYPE = RECORD [
key: ArrayPosition ← NIL,
long: BOOL,
grains: SEQUENCE size: CARDINAL OF Grain];
END.