PORTS [
AlphaBA < INT[8],
SAB < INT[8],
LStkTopAB < INT[8], -- sometimes from Stack
LAB > INT[8], -- to several places (S,A,B,C)
LPipe3BA > INT[8], -- to Stack
LSourceLtBA < EnumType["IFUPLAInstrDecode.LSourceLt"],
LSourceRtBA < EnumType["IFUPLAInstrDecode.LSourceRt"],
LoadStage1Ac < BOOL,
LoadStage1Bc < BOOL,
LoadStage2Ac < BOOL,
LoadStage3Ac < BOOL,
PhA < BOOL,
PhB < BOOL
]
State
lBA, lAB: Dragon.HexByte,
lPipe:
ARRAY [0..3]
OF
ARRAY Dragon.Phase
OF Dragon.HexByte
lPipe[i] is the value of the L register to be recovered if the microinstruction at pipeline level i "fails". This assumes that each microinstruction can "fail" in only one way, and that that way is known as the microinstruction enters the pipeline.
EvalSimple
lBusLtB, lBusRtB: [0..256);
IF PhA
THEN
LAB ← lAB ← lBA;
IF PhB
THEN {
lPipe[0][b] ← lAB;
lBusLtB ←
SELECT LSourceLtBA
FROM
l => LAB,
s => SAB,
zero => 0,
l3 => lPipe[3][a],
ENDCASE => ERROR;
lBusRtB ←
SELECT LSourceRtBA
FROM
zero => 0,
alpha => AlphaBA,
stack => LStkTopAB,
one => 1,
ENDCASE => ERROR;
lBA ← (lBusLtB + lBusRtB) MOD 128;
};
Pipe
IF LoadStage1Ac THEN lPipe[1][a] ← lPipe[0][b];
IF LoadStage1Bc THEN lPipe[1][b] ← lPipe[1][a];
IF LoadStage2Ac THEN lPipe[2][a] ← lPipe[1][b];
IF PhB THEN lPipe[2][b] ← lPipe[2][a];
IF LoadStage3Ac THEN lPipe[3][a] ← lPipe[2][b];
IF PhB THEN lPipe[3][b] ← lPipe[3][a];
LPipe3BA ← lPipe[3][b];