DragonMicroPLATest.mesa
Copyright © 1984 by Xerox Corporation. All rights reserved.
Last edited by TWilliams, August 15, 1984 5:31:29 pm PDT

DIRECTORY
DragonMicroPLA,
DragonMicrocode,
IO,
Commander,
Dragon,
DragOpsCross;
DragonMicroPLATest: CEDAR PROGRAM
IMPORTS DragonMicroPLA, DragonMicrocode, IO, Commander, Dragon = BEGIN
DoTest: Commander.CommandProc = {
screen: IO.STREAM ← cmd.out;
testArgs: DragonMicroPLA.PhBArgs;
screen.PutF["There are %g Microcode minterms currently.\n", IO.int[DragonMicroPLA.PLAMinterms]];
testArgs ← [
state: [ exceptions : none],
delayACycle : FALSE,
iStkEmpty: FALSE,
instReady: TRUE,
alpha: 333B,
beta: 257B,
op: dTrap
];
FOR beta:Dragon.HexByte IN [0..255] DO
testArgs.beta ← beta;
FOR opcode:Dragon.Opcode IN [0..255] DO
testResult: DragonMicroPLA.MicroInst;
knownGoodResult: DragonMicrocode.MicroInst;
unusedState: DragonMicrocode.IFUState;
bArgs: DragonMicrocode.PHBargs;
IF opcode=79 THEN LOOP; -- dMDIV
IF opcode=81 THEN LOOP; -- dRDIV
IF ( opcode=320B OR opcode=324B OR opcode=330B OR opcode=334B ) THEN LOOP; -- RJB format with condition "False", "True"
IF ( opcode=303B OR opcode=304B OR opcode=305B OR opcode=310B ) THEN LOOP; -- RR format with AluOps BndChk, FOP, FOPK, undefined
TRUSTED {
bArgs.state ← LOOPHOLE[testArgs.state];
bArgs.op ← opcode;
bArgs.alpha ← testArgs.alpha;
bArgs.beta ← testArgs.beta;
bArgs.delayACycle ← testArgs.delayACycle;
bArgs.iStkEmpty ← testArgs.iStkEmpty;
bArgs.pushPending ← testArgs.pushPending;
bArgs.popPending ← testArgs.popPending;
bArgs.instReady ← testArgs.instReady;
testArgs.op ← LOOPHOLE[opcode];
testResult ← DragonMicroPLA.GetMicroInst[testArgs];
[ knownGoodResult, unusedState] ← DragonMicrocode.GetMicroInst[bArgs];
Dragon.Assert[ testResult.aReg = LOOPHOLE[knownGoodResult.aReg ]] ;
Dragon.Assert[ testResult.bReg = LOOPHOLE[knownGoodResult.bReg ]];
Dragon.Assert[ testResult.getNextMacro = LOOPHOLE[knownGoodResult.getNextMacro ]];
Dragon.Assert[ testResult.xBSource = LOOPHOLE[knownGoodResult.xBSource ]];
Dragon.Assert[ testResult.doMacroJump = LOOPHOLE[knownGoodResult.doMacroJump ]];
Dragon.Assert[ testResult.cReg = LOOPHOLE[knownGoodResult.cReg ]];
Dragon.Assert[ testResult.lSource = LOOPHOLE[knownGoodResult.lSource ]];
Dragon.Assert[ testResult.sSource = LOOPHOLE[knownGoodResult.sSource ]];
Dragon.Assert[ knownGoodResult.deltaS = LOOPHOLE[(IF testResult.deltaSa=pop THEN -1 ELSE 0)+(IF testResult.deltaSb=pop THEN -1 ELSE 0)+(IF testResult.deltaSc=push THEN 1 ELSE 0) ]];
Dragon.Assert[ testResult.xASource = LOOPHOLE[knownGoodResult.xASource ]];
Dragon.Assert[ testResult.aluRtIsK = LOOPHOLE[knownGoodResult.aluRtIsK ]];
Dragon.Assert[ ( IF testResult.aluOp # op47 THEN testResult.aluOp ELSE LOOPHOLE[opcode MOD 16, Dragon.ALUOps] ) = LOOPHOLE[knownGoodResult.aluOp ]];
Dragon.Assert[ ( IF testResult.condSel # op57 THEN testResult.condSel ELSE LOOPHOLE[opcode MOD 8, Dragon.CondSelects] ) = LOOPHOLE[knownGoodResult.condSel ]];
Dragon.Assert[ testResult.dontBypass = LOOPHOLE[knownGoodResult.dontBypass ]];
Dragon.Assert[ testResult.iStackPostEffect = LOOPHOLE[knownGoodResult.iStackPostEffect ]];
Dragon.Assert[ testResult.iTrapPostEffect = LOOPHOLE[knownGoodResult.iTrapPostEffect ]];
Dragon.Assert[ testResult.euPBusCmd = LOOPHOLE[knownGoodResult.euPBusCmd ]];
Dragon.Assert[ testResult.pipedPLSASpec = LOOPHOLE[knownGoodResult.pipedPLSASpec ]];
Dragon.Assert[ testResult.pushLevel3 = LOOPHOLE[knownGoodResult.pushLevel3 ]];
Dragon.Assert[ testResult.delayed = LOOPHOLE[unusedState.delayed ]];
};
ENDLOOP;
ENDLOOP;
};
Commander.Register [ key: "PLATest", proc: DoTest, doc: "Test of Dragon Microcode PLA."];
END.