PEDecoder.mesa
Copyright Ó 1988 by Xerox Corporation. All rights reserved.
Last Edited by: Gasbarro April 22, 1988 2:44:45 pm PDT
DIRECTORY BitOps, CoreCreate, Sisyph, TilingClass;
PEDecoder: CEDAR PROGRAM
IMPORTS BitOps, CoreCreate, Sisyph, TilingClass
= BEGIN OPEN CoreCreate;
RowDecoder
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]];
-- from the bottom up: rows 0, ... rows-1
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.