SCTestCoreTiny.mesa
Copyright © 1985 by Xerox Corporation. All rights reserved.
Frank Bowers December 19, 1985 10:36:54 am PST
Bryan Preas March 24, 1986 5:11:33 pm PST
DIRECTORY
Core,
CoreClasses,
CoreProperties,
CoreOps,
IO,
SC,
SCTestUtil,
ViewerIO;
SCTestCoreTiny: CEDAR PROGRAM
IMPORTS CoreOps, CoreProperties, SCTestUtil, SC, ViewerIO
EXPORTS SCTestUtil =
BEGIN
debug: BOOLEANFALSE;
CreateCore: PUBLIC PROC [] RETURNS [Core.CellType] =
Create a Core design
BEGIN
nandWires: Core.Wire ← SCTestUtil.CreateWire[LIST["InA", "InB", "Out", "Vdd", "Gnd"]];
nand: Core.CellType ← SCTestUtil.CreateRecordCell["NAND", nandWires, nandWires, NIL];
invWires: Core.Wire ← SCTestUtil.CreateWire[LIST["In", "Out", "Vdd", "Gnd"]];
inverter: Core.CellType ← SCTestUtil.CreateRecordCell["Inverter", invWires, invWires, NIL];
pubWires: Core.Wire ← SCTestUtil.CreateWire[LIST["InA", "InB", "Out", "Vdd", "Gnd"]];
privateWires: Core.Wire ← SCTestUtil.CreateWire[LIST["NOut"]];
internWires: Core.Wire ← SCTestUtil.UnionWire[pubWires, privateWires];
nandInst: CoreClasses.CellInstance ← SCTestUtil.CreateInstance[LIST["InA", "InB", "NOut", "Vdd", "Gnd"], nand, "nandInst", internWires];
invInst: CoreClasses.CellInstance ← SCTestUtil.CreateInstance[LIST["NOut", "Out", "Vdd", "Gnd"], inverter, "invInst", internWires];
SCTest: Core.CellType ← SCTestUtil.CreateRecordCell["SCTest", pubWires, internWires, LIST[nandInst, invInst]];
index: INT ← CoreOps.GetWireIndex[privateWires, "NOut"];
privateWires.elements[index].properties ← CoreProperties.PutProp[privateWires.elements[index].properties, SC.unconnectedProp, NEW[ATOM ← SC.unconnectedProp]];
IF debug THEN {
out: IO.STREAM ← ViewerIO.CreateViewerStreams[
name: "Core: SCTest",
viewer: NIL,
editedStream: FALSE].out;
CoreOps.PrintCellType[SCTest, out]};
RETURN [SCTest];
END;
END.