TestDiv.mesa
Jean Gastinel July 8, 1986 4:14:23 pm PDT
DIRECTORY Core, IO, Ports, PW, Rosemary, RosemaryUser;
TestDiv: CEDAR PROGRAM
IMPORTS -- IO, PW, -- Ports, Rosemary, RosemaryUser =
BEGIN
Vdd: NAT;
Gnd: NAT;
CK : NAT;
RESET: NAT;
Q: NAT;
Init: PROC [ct: Core.CellType] = {
sim: Rosemary.Simulation;
Vdd ← Ports.PortIndex[ct.public, "Vdd"];
Gnd ← Ports.PortIndex[ct.public, "Gnd"];
Q ← Ports.PortIndex[ct.public, "Q"];
CK ← Ports.PortIndex[ct.public, "CK"];
RESET ← Ports.PortIndex[ct.public, "RESET"];
[] ← Rosemary.SetFixedWire[ct.public[Vdd], H];
[] ← Rosemary.SetFixedWire[ct.public[Gnd], L];
[] ← Ports.InitPort[ct.public[Q], ls, drive];
[] ← Ports.InitTesterDrive[wire: ct.public[CK], initDrive: force];
[] ← Ports.InitTesterDrive[wire: ct.public[RESET], initDrive: force];
sim ← RosemaryUser.TestProcedureViewer[name: "Tester", cellType: ct, testButtons: LIST["Tester"], displayWires: RosemaryUser.DisplayCellTypePortLeafWires[ct], -- cutSets: LIST["SSI", "MSI"], -- flatten: TRUE];
};
Tester: RosemaryUser.TestProc = {
p[CK].b ← FALSE;
p[RESET].b ← TRUE;
Eval[];
p[RESET].b ← FALSE;
Eval[];
FOR i: NAT IN [0 .. 5) DO
p[CK].b ← TRUE;
Eval[];
p[CK].b ← FALSE;
Eval[]
ENDLOOP;
};
RosemaryUser.RegisterTestProc["Tester", Tester];
END.