SmallCacheTest.mesa
Copyright © 1986 by Xerox Corporation. All rights reserved.
Pradeep Sindhu, January 25, 1988 2:57:24 pm PST
DIRECTORY
CD, Core, CoreCDUser, CoreOps, CoreProperties, IO, Ports, Rope, Rosemary, RosemaryUser, Sisyph, TerminalIO;
SmallCacheTest: CEDAR PROGRAM
IMPORTS CoreCDUser, CoreOps, CoreProperties, IO, Ports, Rope, Rosemary, RosemaryUser, Sisyph, TerminalIO
~ BEGIN
PortToRope: PROC [level: Ports.Level] RETURNS [r: Rope.ROPE] ~ {
r ← SELECT level FROM L => "L", H => "H", X => "X", ENDCASE => ERROR;
};
GetBool: PROC [ct: Core.CellType, prop: ATOM, default: BOOL] RETURNS [BOOL] ~ {
Read a boolean property from a CT with the specified default
rb: REF BOOLNARROW [CoreProperties.GetCellTypeProp[ct, prop]];
RETURN [IF rb=NIL THEN default ELSE rb^];
};
Run: PROC [obName: Rope.ROPE, design: CD.Design] = {
ENABLE {
Rosemary.Stop => {
TerminalIO.PutF["\n***Oracle completed normally\n"];
GOTO done
};
Ports.CheckError => {
TerminalIO.PutF["\n***%g\n", IO.rope[msg]]; GOTO done
}
};
ct: Core.CellType;
tester: RosemaryUser.Tester ← NIL;
public, Vdd, Gnd: Core.Wire;
testButtons: LIST OF Rope.ROPENIL;
ct ← Sisyph.ES[obName, Sisyph.Create[design]];
[] ← CoreCDUser.SetDesignRootCellType[design, ct];
public ← ct.public;
Vdd ← CoreOps.FindWire[public, "Vdd"];
Gnd ← CoreOps.FindWire[public, "Gnd"];
IF Vdd=NIL THEN TerminalIO.PutRope["SmallCacheTest: Couldn't find Vdd\n"]
ELSE [] ← Rosemary.SetFixedWire[Vdd, H];
IF Gnd=NIL THEN TerminalIO.PutRope["SmallCacheTest: Couldn't find Gnd\n"]
ELSE [] ← Rosemary.SetFixedWire[Gnd, L];
FOR tbl: LIST OF REF ANYNARROW[CoreProperties.GetCellTypeProp[ct, $Tests]], tbl.rest UNTIL tbl=NIL DO
testButtons ← CONS[CoreOps.FixStupidRef[tbl.first], testButtons];
ENDLOOP;
IF testButtons=NIL THEN testButtons ← LIST["Logic Test"];
tester ← RosemaryUser.TestProcedureViewer[
cellType: ct,
testButtons: testButtons,
name: Rope.Cat[CoreOps.GetCellTypeName[ct], " Test"],
displayWires: RosemaryUser.DisplayPortLeafWires[ct],
recordDeltas: GetBool[ct, $RecordDeltas, TRUE],
cutSet: NARROW[CoreProperties.GetCellTypeProp[ct, $CutSet]]];
RosemaryUser.StartTest[tester];
EXITS
done => RETURN
};
END.