DecoderCellType:
PUBLIC
PROC []
RETURNS [recordCell: CellType] = {
inputDriver: CellType ← AlpsExtract["InputDriver.sch"];
outputDriver: CellType ← AlpsExtract["ClockedOutputDriver.sch"];
recordCell ← AlpsCell[
public: CoreCreate.Wires["a", "b", "c", "d", "r", "ab", "Gnd", "Vdd", "phiA", "phiB", "VRef"],
inputs: LIST [["a", inputDriver], ["b", inputDriver], ["c", inputDriver], ["d", inputDriver]],
outputs:
LIST [
["r", Decoder[], outputDriver, LIST [["Clock", "phiA"], ["VRef", "VRef"]]],
["ab", And[Var["a"], Var["b"]], outputDriver, LIST [["Clock", "phiB"], ["VRef", "VRef"]]]
],
props: CoreProperties.Props[[$ContactPolyMetal2, NEW [INT ← 3]]]
];
};
ExerciseRose:
PUBLIC
PROC = {
ct: CellType ← DecoderCellType[];
public: Wire ← ct.public;
data: CoreClasses.RecordCellType ← NARROW [ct.data];
sim: Rosemary.Simulation;
design: PW.Design;
a ← CoreOps.GetWireIndex[public, "a"];
b ← CoreOps.GetWireIndex[public, "b"];
c ← CoreOps.GetWireIndex[public, "c"];
d ← CoreOps.GetWireIndex[public, "d"];
r ← CoreOps.GetWireIndex[public, "r"];
ab ← CoreOps.GetWireIndex[public, "ab"];
Gnd ← CoreOps.GetWireIndex[public, "Gnd"];
Vdd ← CoreOps.GetWireIndex[public, "Vdd"];
phiA ← CoreOps.GetWireIndex[public, "phiA"];
phiB ← CoreOps.GetWireIndex[public, "phiB"];
VRef ← CoreOps.GetWireIndex[public, "VRef"];
[] ← Rosemary.SetFixedWire[public[Vdd], H];
[] ← Rosemary.SetFixedWire[public[Gnd], L];
[] ← Rosemary.SetFixedWire[public[phiA], H];
[] ← Rosemary.SetFixedWire[public[phiB], H];
[] ← Rosemary.SetFixedWire[public[VRef], H];
FOR i:
NAT
IN [0..ct.public.size)
DO
[] ← Ports.InitPort[wire: ct.public[i], levelType: l];
ENDLOOP;
[] ← Ports.InitTesterDrive[wire: ct.public[a], initDrive: force];
[] ← Ports.InitTesterDrive[wire: ct.public[b], initDrive: force];
[] ← Ports.InitTesterDrive[wire: ct.public[c], initDrive: force];
[] ← Ports.InitTesterDrive[wire: ct.public[d], initDrive: force];
[] ← Ports.InitTesterDrive[wire: ct.public[r], initDrive: expect];
[] ← Ports.InitTesterDrive[wire: ct.public[ab], initDrive: expect];
sim ← RosemaryUser.TestProcedureViewer[name: "Alps Transistor Tester", cellType: ct, testButtons: LIST["AlpsTest"], displayWires: RosemaryUser.DisplayCellTypePortLeafWires[ct], flatten: TRUE];
design ← PW.Draw[PWCore.Layout[ct]];
CDProperties.PutDesignProp[design, $Simulation, sim];
[] ← RosemaryUser.TestProcedureViewer[name: "Alps Alps Tester", cellType: ct, testButtons: LIST["AlpsTest"], displayWires: RosemaryUser.DisplayCellTypePortLeafWires[ct], flatten: TRUE, cutSets: LIST["AlpsCell"]];
};