-- Sage.mesa
-- Last Edited by: Barth, January 31, 1985 8:22:30 pm PST

Sage: DEFINITIONS =

BEGIN

Error: ERROR [why: ErrorReason];
ErrorReason: TYPE = {nilChannelVector};

PulseLine: TYPE = [0..16);
PulsePair: TYPE = [0..LAST[PulseLine]/2];
WidthPulseLine: PulseLine = 7;
CyclePulseLine: PulseLine = 15;
Tap: TYPE = [0..64);
Channel: TYPE = [0..64);
OutputStage: TYPE = [0..32);
DriveState: TYPE = {L, T, H};
InputStage: TYPE = [0..16);
TesterCycle: TYPE = [0..16];

ChannelSequence: TYPE = LONG POINTER TO ChannelSequenceRec;
VARChannelSequence: TYPE = ChannelSequence;
ChannelSequenceRec: TYPE = RECORD[
  loads: SEQUENCE loadCount: CARDINAL OF ChannelVectorRec];
ChannelVector: TYPE = LONG POINTER TO ChannelVectorRec;
ChannelVectorRec: TYPE = RECORD[
  testerCycles: TesterCycle ← LAST[TesterCycle],
  stageData: PACKED ARRAY Channel OF StageData];
StageData: TYPE = RECORD[
  force: ForceData,
  sense: SenseData];
ForceData: TYPE = PACKED ARRAY OutputStage OF DriveState ← ALL[T];
SenseData: TYPE = PACKED ARRAY InputStage OF BOOL ← ALL[FALSE];

PulseLineTaps: TYPE = LONG POINTER TO PulseLineTapRec;
PulseLineTapRec: TYPE = RECORD[
  taps: ARRAY PulseLine OF Tap];
  
ChannelControlData: TYPE = LONG POINTER TO ChannelControlDataRec;
ChannelControlDataRec: TYPE = RECORD[
  channels: ARRAY Channel OF SingleChannelData];
SingleChannelData: TYPE = RECORD[
  localHold: BOOL ← FALSE,
  inputPulseLine: PulseLine ← 0,
  outputPulsePair: PulsePair ← 0];

Tester: TYPE = LONG POINTER TO TesterRec;
HANDLETester: TYPE = Tester;
TesterRec: TYPE;

InitializeTester: PROC [pulseTaps: PulseLineTaps, channelControl: ChannelControlData, initialData: ChannelVector, feedBack15: BOOL ← FALSE] RETURNS [HANDLETester];
FinalizeTester: PROC [t: HANDLETester];
Run: PROC [t: HANDLETester, runData: VARChannelSequence];

END.