[Indigo]<Rosemary>®>Rosemary.DF=>SwitchTypes.Mesa
Last Edited by: Spreitzer, May 2, 1985 4:26:59 pm PDT
DIRECTORY Basics, BitTwiddling, RoseTypes;
SwitchTypes: CEDAR DEFINITIONS =
BEGIN OPEN BitTwiddling;
Strength: TYPE = RoseTypes.Strength;
NodeType: TYPE = RoseTypes.NodeType;
bitType: NodeType;
Bundle: PROC [bits: CARDINAL] RETURNS [NodeType];
IsSwitchType: PROC [NodeType] RETURNS [BOOLEAN];
SwitchVal: TYPE = MACHINE DEPENDENT RECORD [
s: PACKED ARRAY StrengthIndex OF Strength ← ALL[none],
val: Level ← X,
pad: [0 .. 4) ← 0];
StrengthIndex: TYPE = {q, u, d};
none: Strength = ignore;
Level: TYPE = {L, H, X};
X means completely unknown level (as opposed to meaning something between low and high).
refInput, refDriveStrong, refDrive, refDriveWeak, refChargeStrong, refCharge, refChargeWeak, refNone: REF Strength;
switchValsPerWord: INTEGER = 480/SIZE[PACKED ARRAY [0 .. 480) OF SwitchVal];
480 is LCM [Floor[32/1], Floor[32/2], Floor[32/3], ... Floor[32/32]].
bitsPerSwitchVal: INTEGER = 16;
bitsPerSwitchValFiller: INTEGER = Basics.bitsPerWord - bitsPerSwitchVal;
wordsPerSwitchValPort: INTEGER = (bitsPerSwitchVal + bitsPerSwitchValFiller) / Basics.bitsPerWord;
SwitchValHolder: TYPE = MACHINE DEPENDENT RECORD [
fill(0:0..bitsPerSwitchValFiller-1): SwitchValFiller,
held(0:Basics.bitsPerWord-bitsPerSwitchVal..Basics.bitsPerWord-1): SwitchVal];
SwitchValFiller: TYPE = [0..TwoToThe[bitsPerSwitchValFiller]);
Block: PROC [a, b: Strength] RETURNS [c: Strength];
END.