TestCoreIO.mesa
Copyright Ó 1986, 1987 by Xerox Corporation. All rights reserved.
Bertrand Serlet April 5, 1987 7:08:28 pm PDT
DIRECTORY CoreCreate, CoreOps;
TestCoreIO: CEDAR PROGRAM IMPORTS CoreCreate = BEGIN OPEN CoreCreate;
NAnd: PUBLIC PROC [i: NAT] RETURNS [ct: CellType] = {
instances: LIST OF CellInstance ← NIL;
pType: CellType ← Transistor[type: pE, width: 3];
nType: CellType ← Transistor[type: nE, width: 1];
FOR input: NAT IN [0..i) DO
instances ← CONS[Instance[pType,
["gate", Index["Input", input]], ["ch1", "Vdd"], ["ch2", "nOutput"], ["well", "Vdd"]],
instances];
instances ← CONS[Instance[nType,
["gate", Index["Input", input]],
["ch1", IF input=0 THEN "nOutput" ELSE Index["stack", input-1]],
["ch2", IF input=i-1 THEN "Gnd" ELSE Index["stack", input]]],
instances];
ENDLOOP;
ct ← Cell[
name: "NAnd",
public: Wires["Vdd", "Gnd", Seq["Input", i], "nOutput"],
onlyInternal: Wires[Seq["stack", i-1]],
instances: instances];
};
END.