<> <> <> DIRECTORY BasicTime, BitOps, BitSwOps, BitTwiddling, Core, CoreProperties, GetMe, IO, Rope, RoseBehavior, RoseBind, RoseControl, SwitchInvTesterRoseDefs; SwitchInvTesting: CEDAR PROGRAM = BEGIN OPEN RoseBehavior, RoseControl, 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.