PriorityEncoderTest.mesa
Copyright © 1986 by Xerox Corporation. All rights reserved.
Created by Neil Gunther, August 8, 1986 11:02:28 am PDT
Last Edited by: Neil Gunther August 8, 1986 3:59:10 pm PDT
DIRECTORY
Core, CoreFlat, CoreOps, Ports, PW, Rope, Rosemary, RosemaryUser, Sisyph;
PriorityEncoderTest: CEDAR PROGRAM
IMPORTS CoreOps, Ports, PW, RosemaryUser, Sisyph
= BEGIN
EncoderTestProc: RosemaryUser.TestProc = {
CycleEncoder: PROC = {
Truth Table
Pulse: TYPE = [0..10);
-- Inputs --
lD0: ARRAY Pulse OF Ports.Level ← [X, L, X, X, X, X, X, X, X, H];
lD1: ARRAY Pulse OF Ports.Level ← [X, L, X, X, X, X, X, X, H, L];
lD2: ARRAY Pulse OF Ports.Level ← [X, L, X, X, X, X, X, H, L, L];
lD3: ARRAY Pulse OF Ports.Level ← [X, L, X, X, X, X, H, L, L, L];
lD4: ARRAY Pulse OF Ports.Level ← [X, L, X, X, X, H, L, L, L, L];
lD5: ARRAY Pulse OF Ports.Level ← [X, L, X, X, H, L, L, L, L, L];
lD6: ARRAY Pulse OF Ports.Level ← [X, L, X, H, L, L, L, L, L, L];
lD7: ARRAY Pulse OF Ports.Level ← [X, H, L, L, L, L, L, L, L, L];
lEin: ARRAY Pulse OF Ports.Level ← [L, H, H, H, H, H, H, H, H, H];
-- Outputs --
lO0: ARRAY Pulse OF Ports.Level ← [L, L, H, L, H, L, H, L, H, L];
lO1: ARRAY Pulse OF Ports.Level ← [L, L, H, H, L, L, H, H, L, L];
lO2: ARRAY Pulse OF Ports.Level ← [L, L, H, H, H, H, L, L, L, L];
lGS: ARRAY Pulse OF Ports.Level ← [L, L, H, H, H, H, H, H, H, H];
lEout: ARRAY Pulse OF Ports.Level ← [L, H, L, L, L, L, L, L, L, L];
FOR pulse: Pulse IN Pulse DO
p[D0].l ← lD0[pulse];
p[D1].l ← lD1[pulse];
p[D2].l ← lD2[pulse];
p[D3].l ← lD3[pulse];
p[D4].l ← lD4[pulse];
p[D5].l ← lD5[pulse];
p[D6].l ← lD6[pulse];
p[D7].l ← lD7[pulse];
p[Ein].l ← lEin[pulse];
p[O0].l ← lO0[pulse];
p[O1].l ← lO1[pulse];
p[O2].l ← lO2[pulse];
p[GS].l ← lGS[pulse];
p[Eout].l ← lEout[pulse];
Eval[];
ENDLOOP;
}; --CycleEncoder
p[D0].l ← p[D1].l p[D2].l ← p[D3].l ← p[D4].l ← p[D5].l ← p[D6].l ← p[D7].l ← p[Ein].l ← L;
p[O0].l ← p[O1].l p[O2].l ← p[GS].l ← p[Eout].l ← L;
CycleEncoder[];
}; --EncoderTestProc
designName: Rope.ROPE = "///Users/gunther.pa/chips/IOPInterruptController";
testee: Rope.ROPE = "8-3PriorityEncoder.sch";
viewerName: Rope.ROPE = "Priority Encoder";
ct: Core.CellType ← Sisyph.ExtractSchematicByName[testee, Sisyph.Create[PW.OpenDesign[designName]]];
-- Inputs --
D0: NAT = CoreOps.GetWireIndex[ct.public, "Data0"];
D1: NAT = CoreOps.GetWireIndex[ct.public, "Data1"];
D2: NAT = CoreOps.GetWireIndex[ct.public, "Data2"];
D3: NAT = CoreOps.GetWireIndex[ct.public, "Data3"];
D4: NAT = CoreOps.GetWireIndex[ct.public, "Data4"];
D5: NAT = CoreOps.GetWireIndex[ct.public, "Data5"];
D6: NAT = CoreOps.GetWireIndex[ct.public, "Data6"];
D7: NAT = CoreOps.GetWireIndex[ct.public, "Data7"];
Ein: NAT = CoreOps.GetWireIndex[ct.public, "InEnable"];
-- Outputs --
O0: NAT = CoreOps.GetWireIndex[ct.public, "Out0"];
O1: NAT = CoreOps.GetWireIndex[ct.public, "Out1"];
O2: NAT = CoreOps.GetWireIndex[ct.public, "Out2"];
GS: NAT = CoreOps.GetWireIndex[ct.public, "GroupSelect"];
Eout: NAT = CoreOps.GetWireIndex[ct.public, "OutEnable"];
FOR i: NAT IN [0..ct.public.size) DO
[] ← Ports.InitPort[wire: ct.public[i]];
ENDLOOP;
[] ← Ports.InitTesterDrive[wire: ct.public[D0], initDrive: force];
[] ← Ports.InitTesterDrive[wire: ct.public[D1], initDrive: force];
[] ← Ports.InitTesterDrive[wire: ct.public[D2], initDrive: force];
[] ← Ports.InitTesterDrive[wire: ct.public[D3], initDrive: force];
[] ← Ports.InitTesterDrive[wire: ct.public[D4], initDrive: force];
[] ← Ports.InitTesterDrive[wire: ct.public[D5], initDrive: force];
[] ← Ports.InitTesterDrive[wire: ct.public[D6], initDrive: force];
[] ← Ports.InitTesterDrive[wire: ct.public[D7], initDrive: force];
[] ← Ports.InitTesterDrive[wire: ct.public[Ein], initDrive: force];
[] ← Ports.InitTesterDrive[wire: ct.public[O0], initDrive: expect];
[] ← Ports.InitTesterDrive[wire: ct.public[O1], initDrive: expect];
[] ← Ports.InitTesterDrive[wire: ct.public[O2], initDrive: expect];
[] ← Ports.InitTesterDrive[wire: ct.public[GS], initDrive: expect];
[] ← Ports.InitTesterDrive[wire: ct.public[Eout], initDrive: expect];
-- Simulation --
[] ← RosemaryUser.TestProcedureViewer[
cellType: ct,
testButtons: LIST["Encoder Test"],
name: viewerName,
displayWires: LIST[NEW[CoreFlat.FlatWireRec ← [path: CoreFlat.NullPath, wire: ct.public]]],
flatten: TRUE
];
END.