SwitchInvTesting.mesa
Copyright © 1985 by Xerox Corporation. All rights reversed.
Spreitzer, October 5, 1985 3:37:51 pm PDT
DIRECTORY BasicTime, BitOps, BitSwOps, BitTwiddling, Core, CoreProperties, GetMe, IO, Rope, RoseBehavior, SwitchInvTesterRoseDefs;
SwitchInvTesting: CEDAR PROGRAM
=
BEGIN OPEN RoseBehavior, SwitchInvTesterRoseDefs;
Invert: ARRAY Level OF Level = [H: L, L: H, X: X];
ToStrength: PROC [str: Strength, l: Level] RETURNS [sv: SwitchVal] = {
sv ← SELECT l FROM
L => [s: [q: str, u: none, d: str], val: L],
H => [s: [q: str, u: str, d: none], val: H],
X => [s: [q: str, u: str, d: str], val: X],
ENDCASE => ERROR;
};
TestSwitchInv
: PROC [
testeeType: Core.CellType,
testData, switchInstructions, simpleInstructions, driveInstructions, stateAny: REF ANY,
Eval: PROC
]
= {
instr: REF SwitchInvTesterSwitch = NARROW[switchInstructions];
instr.vdd ← ToStrength[input, H];
instr.gnd ← ToStrength[input, L];
FOR l: Level IN Level DO
instr.in ← ToStrength[drive, l];
Eval[];
IF instr.out.val # Invert[l] THEN ERROR;
ENDLOOP;
stateAny ← stateAny;
};
END.