<> <> <> <<>> DIRECTORY CoreCreate, CoreOps, TilingClass; TilingSize: CEDAR PROGRAM IMPORTS CoreCreate, CoreOps, TilingClass ~ BEGIN OPEN CoreCreate; zero: CellType = Cell[public: Wires["Gnd", "Line", "Input", "NotInput"], instances: NIL]; Row: PROC [n: NAT] RETURNS [CellType] = { instances: CellInstances _ NIL; FOR i: NAT IN [0 .. n) DO instances _ CONS [Instance[zero, ["Input", Index["Input", i]], ["NotInput", Index["NotInput", i]]], instances]; ENDLOOP; RETURN [Cell[ public: Wires["Gnd", "Line", Seq["Input", n], Seq["NotInput", n]], instances: instances ]]; }; Rows: PROC [n, p: NAT] RETURNS [CellType] = { instances: CellInstances _ NIL; FOR j: NAT IN [0 .. p) DO instances _ CONS [Instance[Row[n], ["Line", Index["Line", j]]], instances]; ENDLOOP; RETURN [Cell[ public: Wires["Gnd", Seq["Line", p], Seq["Input", n], Seq["NotInput", n]], instances: instances ]]; }; Record: PROC [n, p: NAT] RETURNS [CellType] = { instances: CellInstances _ NIL; FOR j: NAT IN [0 .. p) DO FOR i: NAT IN [0 .. n) DO instances _ CONS [Instance[zero, ["Input", Index["Input", i]], ["NotInput", Index["NotInput", i]], ["Line", Index["Line", j]]], instances]; ENDLOOP; ENDLOOP; RETURN [Cell[ public: Wires["Gnd", Seq["Line", p], Seq["Input", n], Seq["NotInput", n]], instances: instances ]]; }; NeighborX: TilingClass.NeighborProc = { publicPairs _ LIST[[CoreOps.FindWire[ct1.public, "Line"], CoreOps.FindWire[ct2.public, "Line"]]]; }; NeighborY: TilingClass.NeighborProc = { publicPairs _ LIST[[CoreOps.FindWire[ct1.public, "Input"], CoreOps.FindWire[ct2.public, "Input"]], [CoreOps.FindWire[ct1.public, "Input"], CoreOps.FindWire[ct2.public, "Input"]]]; }; Tiles: PROC [n, p: NAT] RETURNS [CellType] = { tileArray: TilingClass.TileArray _ NEW [TilingClass.TileArrayRec[p]]; FOR j: NAT IN [0 .. p) DO tileRow: TilingClass.TileRow _ NEW [TilingClass.TileRowRec[n]]; FOR i: NAT IN [0 .. n) DO tileRow[i] _ NEW [TilingClass.TileRec _ [zero, LIST [["Gnd", "Gnd"]]]]; ENDLOOP; tileArray[j] _ tileRow; ENDLOOP; RETURN [TilingClass.CreateTiling[ public: Wires["Gnd", Seq["Line", p], Seq["Input", n], Seq["NotInput", n]], tileArray: tileArray, neighborX: NeighborX, neighborY: NeighborY ]]; }; END.