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 BOOL ← NARROW [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.ROPE ← NIL;
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
ANY ←
NARROW[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];
};