<> <> <> <<>> 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"], ["Vdd", "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.