DIRECTORY BitOps, CoreCreate, Sisyph, TilingClass; PEDecoder: CEDAR PROGRAM IMPORTS BitOps, CoreCreate, Sisyph, TilingClass = BEGIN OPEN CoreCreate; addBits: CARDINAL = 6; subRows: CARDINAL = 7; decodeTiles: CARDINAL = 8; DecoderArray: PROC [chan: NAT, cx: Sisyph.Context] RETURNS [ct: CellType] ~ { decLatch: CellType _ Sisyph.ES["RDLatch.sch", cx]; decBus: CellType _ Sisyph.ES["RDBus.sch", cx]; nCBus: Wire _ Seq["nCBus", addBits]; CBus: Wire _ Seq["CBus", addBits]; ForceData: Wire _ Seq["ForceData", chan]; InhibitData: Wire _ Seq["InhibitData", chan]; AcquireData: Wire _ Seq["AcquireData", chan]; SelD: Wire _ Seq["SelD", chan]; SelW: Wire _ Seq["SelW", chan]; SelS: Wire _ Seq["SelS", chan]; rows: NAT _ subRows*chan; tileArray: TilingClass.TileArray _ NEW[TilingClass.TileArrayRec[rows]]; IF rows=0 THEN ERROR; --Please specify the number of rows FOR row: NAT IN [0..rows) DO chan: NAT _ row/7; SELECT row MOD subRows FROM 0, 3, 5 => { addr: NAT _ (row/subRows)*3 + (SELECT (row MOD subRows) FROM 0=>0, 3=>1, 5=>2, ENDCASE=>ERROR); tileArray[row] _ NEW[TilingClass.TileRowRec[1]]; tileArray[row][0] _ NEW[TilingClass.TileRec _ [ --left side type: Decode[addr, cx], renaming: LIST[["Vdd", "Vdd"], ["Gnd", "Gnd"]] ]]; }; 1, 4, 6 => { wire: Wire _ SELECT (row MOD subRows) FROM 1=> SelS, 4=> SelW, 6=>SelD, ENDCASE=>ERROR; tileArray[row] _ NEW[TilingClass.TileRowRec[1]]; --latch tileArray[row][0] _ NEW[TilingClass.TileRec _ [ type: decLatch, renaming: LIST[["Sel", wire[chan]], ["Vdd", "Vdd"], ["Gnd", "Gnd"]] ]]; }; 2 => { tileArray[row] _ NEW[TilingClass.TileRowRec[1]]; --data bus tileArray[row][0] _ NEW[TilingClass.TileRec _ [ type: decBus, renaming: LIST[["ForceData", ForceData[chan]], ["InhibitData", InhibitData[chan]], ["AcquireData", AcquireData[chan]], ["nCBus", nCBus], ["CBus", CBus], ["AS", "AS"], ["nSelEnb", "nSelEnb"]] ]]; }; ENDCASE => ERROR; ENDLOOP; ct _ TilingClass.CreateTiling[ name: "DecoderArray", public: Wires["AS", nCBus, CBus, "nSelEnb", ForceData, InhibitData, AcquireData, SelD, SelW, SelS, "Vdd", "Gnd"], tileArray: tileArray, neighborX: TilingClass.LayoutNeighborX, neighborY: TilingClass.LayoutNeighborY ]; }; Decode: PROC [addr: NAT, cx: Sisyph.Context] RETURNS [ct: CellType] ~ { dec0: CellType _ Sisyph.ES["RD0.sch", cx]; dec1: CellType _ Sisyph.ES["RD1.sch", cx]; decL: CellType _ Sisyph.ES["RDLeft.sch", cx]; decR: CellType _ Sisyph.ES["RDRight.sch", cx]; nCBus: Wire _ Seq["nCBus", addBits]; CBus: Wire _ Seq["CBus", addBits]; tileArray: TilingClass.TileArray _ NEW[TilingClass.TileArrayRec[1]]; tileArray[0] _ NEW[TilingClass.TileRowRec[decodeTiles]]; --addr decode FOR i: NAT IN [0..decodeTiles) DO SELECT i FROM 0 => tileArray[0][i] _ NEW[TilingClass.TileRec _ [ --left side type: decL, renaming: LIST[["AS", "AS"], ["Vdd", "Vdd"], ["Gnd", "Gnd"]] ]]; IN [1..6] => tileArray[0][i] _ NEW[TilingClass.TileRec _ [ --middle type: IF BitOps.EBFW[addr, i-1, addBits] THEN dec1 ELSE dec0, renaming: LIST[["nA", nCBus[i-1]], ["A", CBus[i-1]], ["Vdd", "Vdd"]] ]]; 7 => tileArray[0][i] _ NEW[TilingClass.TileRec _ [ --right side type: decR, renaming: LIST[["nSelEnb", "nSelEnb"], ["nDecode", "nDecode"]] ]]; ENDCASE => ERROR; ENDLOOP; ct _ TilingClass.CreateTiling[ name: "Decode", public: Wires["AS", nCBus, CBus, "nSelEnb", "nDecode", "Vdd", "Gnd"], tileArray: tileArray, neighborX: TilingClass.LayoutNeighborX, neighborY: TilingClass.LayoutNeighborY ]; }; END. ΎPEDecoder.mesa Copyright Σ 1988 by Xerox Corporation. All rights reserved. Last Edited by: Gasbarro April 22, 1988 2:44:45 pm PDT RowDecoder -- from the bottom up: rows 0, ... rows-1 Κη˜šœ™Icode™