SCTestCoreTiny.mesa
Copyright Ó 1985, 1987 by Xerox Corporation. All rights reserved.
Frank Bowers December 19, 1985 10:36:54 am PST
Bryan Preas September 24, 1987 2:47:55 pm PDT
DIRECTORY
CD, CDIO, Core, CoreClasses, CoreDirectory, CoreOps, CoreProperties, PWCore, Rope, SC, RTTestUtil;
SCTestCoreTiny: CEDAR PROGRAM
IMPORTS CDIO, CoreDirectory, CoreOps, CoreProperties, PWCore, RTTestUtil, SC
EXPORTS RTTestUtil = BEGIN
CreateCore: PUBLIC PROC [libName: Rope.ROPE] RETURNS [Core.CellType] =
Create a Core design
BEGIN
coreLibrary: CoreDirectory.Library ← CoreDirectory.CreateLibrary[];
libDesign: CD.Design ← CDIO.ReadDesign[libName, NIL, CDIO.GetWorkingDirectory[]];
feedthruWires: Core.Wire ← RTTestUtil.CreateWire[LIST["FeedIn", "Vdd", "Gnd"]];
feedthru: Core.CellType ← RTTestUtil.CreateRecordCell["feedthru", feedthruWires, feedthruWires, NIL];
vddWires: Core.Wire ← RTTestUtil.CreateWire[LIST["Vdd", "Gnd"]];
vdd: Core.CellType ← RTTestUtil.CreateRecordCell["vdd", vddWires, vddWires, NIL];
gndWires: Core.Wire ← RTTestUtil.CreateWire[LIST["Vdd", "Gnd"]];
gnd: Core.CellType ← RTTestUtil.CreateRecordCell["gnd", gndWires, gndWires, NIL];
nandWires: Core.Wire ← RTTestUtil.CreateWire[LIST["I-A", "I-B", "X", "Vdd", "Gnd"]];
nand: Core.CellType ← RTTestUtil.CreateRecordCell["nand2", nandWires, nandWires, NIL];
invWires: Core.Wire ← RTTestUtil.CreateWire[LIST["I", "X", "Vdd", "Gnd"]];
inverter: Core.CellType ← RTTestUtil.CreateRecordCell["inv", invWires, invWires, NIL];
pubWires: Core.Wire ← RTTestUtil.CreateWire[LIST["InA", "Out", "Vdd", "Gnd"]];
privateWires: Core.Wire ← RTTestUtil.CreateWire[LIST["NOut"]];
internWires: Core.Wire ← RTTestUtil.UnionWire[pubWires, privateWires];
nandInst: CoreClasses.CellInstance ← RTTestUtil.CreateInstance[LIST["InA", "Vdd", "NOut", "Vdd", "Gnd"], nand, "nandInst", internWires];
invInst: CoreClasses.CellInstance ← RTTestUtil.CreateInstance[LIST["NOut", "Out", "Vdd", "Gnd"], inverter, "invInst", internWires];
SCTest: Core.CellType ← RTTestUtil.CreateRecordCell["SCTest", pubWires, internWires, LIST[nandInst, invInst]];
CoreProperties.PutWireProp[CoreOps.FindWire[internWires, "InA"], SC.bottomSideProp, NEW[BOOLTRUE]];
CoreProperties.PutWireProp[CoreOps.FindWire[internWires, "Out"], SC.leftSideProp, NEW[BOOLTRUE]];
CoreProperties.PutCellInstanceProp[nandInst, SC.rowProp, NEW[INT ← 1]];
CoreProperties.PutCellInstanceProp[invInst, SC.rowProp, NEW[INT ← 2]];
[] ← CoreDirectory.RegisterLibrary[coreLibrary, libName];
[] ← CoreDirectory.Insert[coreLibrary, "nand2", nand, TRUE];
[] ← CoreDirectory.Insert[coreLibrary, "inv", inverter, TRUE];
[] ← CoreDirectory.Insert[coreLibrary, "feedthru", feedthru, TRUE];
[] ← CoreDirectory.Insert[coreLibrary, "vdd", vdd, TRUE];
[] ← CoreDirectory.Insert[coreLibrary, "gnd", gnd, TRUE];
PWCore.SetGet[nand, libDesign];
PWCore.SetGet[inverter, libDesign];
PWCore.SetGet[feedthru, libDesign];
PWCore.SetGet[vdd, libDesign];
PWCore.SetGet[gnd, libDesign];
RETURN [SCTest];
END;
END.