time: BasicTime.GMT;
-- Initialization starts here
PRtoByte: PROC[pr: DragOpsCross.ProcessorRegister] RETURNS [byte: NAT]={byte ← ORD[pr]};
Array: PROC [a, b, c, d, e: NAT ← 0] RETURNS [InputSels] ~ {RETURN[[a, b, c, d, e]]};
stackAdr: PUBLIC NAT ← PRtoByte[euStack];
junkAdr: PUBLIC NAT ← PRtoByte[euJunk];
fieldAdr: PUBLIC NAT ← PRtoByte[euField];
marAdr: PUBLIC NAT ← PRtoByte[euMAR];
constAdr: PUBLIC NAT ← PRtoByte[euConstant];
IFUAdr: PUBLIC NAT ← PRtoByte[euToKBus];
bogusAdr: PUBLIC NAT ← PRtoByte[euBogus];
KernalLimit: PUBLIC LONG CARDINAL ← DragOpsCross.KernalLimit;
dReadBus: PUBLIC ROPE ← "cBus";
nRows: PUBLIC NAT ← 40;
nbWords: PUBLIC NAT ← sizeSelLow*nRows;
-- Flags to provoke/read checkpoints.
useInnerCheckpoint: PUBLIC BOOL ← TRUE;
useControlCheckpoint: PUBLIC BOOL ← TRUE;
useRamControlCheckpoint: PUBLIC BOOL ← TRUE;
useDPControlCheckpoint: PUBLIC BOOL ← TRUE;
useDataPathCheckpoint: PUBLIC BOOL ← TRUE;
usekRegAndRightCheckpoint: PUBLIC BOOL ← TRUE;
useRamCheckpoint: PUBLIC BOOL ← TRUE;
useALUCheckpoint: PUBLIC BOOL ← TRUE;
aluOps[SAdd] ← [op: add, cIn: prev, cOut: zero];
aluOps[SSub] ← [op: add, cIn: nprev, cOut: zero, invertB: TRUE];
aluOps[UAdd] ← [op: add, cIn: prev, cOut: comp];
aluOps[USub] ← [op: add, cIn: nprev, cOut: ncomp, invertB: TRUE];
aluOps[VAdd] ← [op: add, cIn: zero, cOut: prev];
aluOps[VSub] ← [op: add, cIn: one, cOut: prev, invertB: TRUE];
aluOps[LAdd] ← [op: add, cIn: zero, cOut: zero];
aluOps[LSub] ← [op: add, cIn: one, cOut: zero, invertB: TRUE];
aluOps[VAdd2] ← aluOps[VAdd];
aluOps[BndChk] ← [op: add, cIn: one, cOut: prev, invertB: TRUE];
aluOps[Or] ← [op: or, cIn: zero, cOut: prev];
aluOps[And] ← [op: and, cIn: zero, cOut: prev];
aluOps[Xor] ← [op: xor, cIn: zero, cOut: prev];
aluOps[FOP] ← aluOps[Or]; -- or anything else?
sources[ifuIn] ← [name: "ifuIn",
trackPosX: 5,
topOnlyBuses: NIL,
botOnlyBuses: LIST[ifuIn],
throughBuses: LIST[cBus]];
sources[ramA] ← [name: "ramA",
trackPosX: 1,
topOnlyBuses: NIL,
botOnlyBuses: LIST[ramA, ramB, cBus],
throughBuses: NIL];
sources[ramB] ← [name: "ramB",
trackPosX: 2,
topOnlyBuses: NIL,
botOnlyBuses: LIST[ramA, ramB, cBus],
throughBuses: NIL];
sources[kReg] ← [name: "kReg",
nameSel: "selKRegSrc", -- PhB
sizeSel: 1,
trackPosX: 3,
topOnlyBuses: NIL,
botOnlyBuses: LIST[kReg, ifuIn],
throughBuses: LIST[ramA, ramB, cBus],
inputs: Array[ifuIn]];
sources[right] ← [name: "right",
nameSel: "selRightSrc", -- PhA
sizeSel: 5,
trackPosX: 5,
topOnlyBuses: LIST[ifuIn],
botOnlyBuses: LIST[right, field, r2B],
throughBuses: LIST[ramA, ramB, cBus],
inputs: Array[ramB, r2B, cBus, ifuIn, field]];
sources[field] ← [name: "field",
nameSel: "selFieldSrc", -- PhA
sizeSel: 1,
trackPosX: 0,
topOnlyBuses: LIST[field],
botOnlyBuses: NIL,
throughBuses: LIST[ramA, ramB, r2B, cBus, right],
inputs: Array[cBus]];
sources[left] ← [name: "left",
nameSel: "selLeftSrc", -- PhA
sizeSel: 3,
trackPosX: 1,
topOnlyBuses: LIST[ramA],
botOnlyBuses: LIST[left],
throughBuses: LIST[ramB, r2B, cBus, right],
inputs: Array[ramA, r2B, cBus]];
sources[st2A] ← [name: "st2A",
nameSel: "selSt2ASrc", -- PhA
sizeSel: 3,
trackPosX: 2,
topOnlyBuses: LIST[ramB],
botOnlyBuses: LIST[st2A],
throughBuses: LIST[left, r2B, cBus, right],
inputs: Array[ramB, r2B, cBus]];
sources[aluOut] ← [name: "aluOut",
trackPosX: 5,
topOnlyBuses: LIST[right],
botOnlyBuses: LIST[aluOut],
throughBuses: LIST[left, st2A, r2B, cBus]];
sources[r2B] ← [name: "r2B",
nameSel: "selRes2BASrc", -- PhB
sizeSel: 3,
trackPosX: 3,
topOnlyBuses: LIST[aluOut],
botOnlyBuses: LIST[fuOut],
throughBuses: LIST[left, st2A, r2B, cBus],
inputs: Array[aluOut, fuOut, left]];
sources[fuOut] ← [name: "fuOut",
trackPosX: 5,
topOnlyBuses: LIST[left, fuOut],
botOnlyBuses: NIL,
throughBuses: LIST[st2A, r2B, cBus]];
sources[st2B] ← [name: "st2B",
nameSel: "selSt2BASrc", -- PhB
sizeSel: 1,
trackPosX: 5,
topOnlyBuses: LIST[st2A],
botOnlyBuses: LIST[st2B],
throughBuses: LIST[r2B, cBus],
inputs: Array[st2A]];
sources[st3A] ← [name: "st3A",
nameSel: "selSt3ABSrc", -- PhA
sizeSel: 2,
trackPosX: 5,
topOnlyBuses: LIST[st2B],
botOnlyBuses: LIST[st3A],
throughBuses: LIST[r2B, cBus],
inputs: Array[st2B, cBus]];
sources[pDriver] ← [name: "pDriver",
-- special
trackPosX: 5,
topOnlyBuses: LIST[st3A],
botOnlyBuses: LIST[pDriver],
throughBuses: LIST[r2B, cBus],
inputs: Array[st3A, r2B]];
sources[r3A] ← [name: "r3A",
nameSel: "selRes3ABSrc", -- PhA
sizeSel: 1,
trackPosX: 3,
topOnlyBuses: LIST[r2B],
botOnlyBuses: LIST[r3A],
throughBuses: LIST[cBus, pDriver],
inputs: Array[r2B]];
sources[r3B] ← [name: "r3B",
nameSel: "selRes3BASrc", -- PhB
sizeSel: 1,
trackPosX: 3,
topOnlyBuses: LIST[r3A],
botOnlyBuses: LIST[r3B],
throughBuses: LIST[pDriver, cBus],
inputs: Array[r3A]];
sources[cBus] ← [name: "cBus",
nameSel: "selcBusSrc", -- PhA
tristate: TRUE,
sizeSel: 2,
trackPosX: 4,
topOnlyBuses: LIST[r3B],
botOnlyBuses: LIST[dataIn],
throughBuses: LIST[pDriver, cBus],
inputs: Array[r3B, dataIn]];
sources[dataIn] ← [name: "dataIn",
nameSel: "selDataInSrc", -- PhB
sizeSel: 1,
trackPosX: 2,
topOnlyBuses: LIST[dataIn],
botOnlyBuses: LIST[pIn],
throughBuses: LIST[pDriver, cBus],
inputs: Array[pIn]];
sources[pIn] ← [name: "pIn",
trackPosX: 3,
topOnlyBuses: LIST[pIn],
botOnlyBuses: NIL,
throughBuses: LIST[cBus]];