Tamarin.mesa
Copyright © 1985 by Xerox Corporation. All rights reserved.
Louis Monier November 6, 1986 6:08:02 pm PST
Last Edited by: Ross February 17, 1987 12:27:39 pm PST
DIRECTORY
CD,
CDImports,
CoreCreate,
PW,
PWCore,
Sisyph,
TilingClass USING [CreateTiling, LayoutNeighborX, LayoutNeighborY,
TileArray, TileArrayRec, TileRec, TileRowRec];
Tamarin: CEDAR PROGRAM
IMPORTS CDImports, CoreCreate, PW, PWCore, Sisyph, TilingClass
=
BEGIN OPEN CoreCreate;
tamarinDesign: PUBLIC CD.Design;
tamarinCx: Sisyph.Context;
Extract: PROC [name: ROPE] RETURNS [cellType: CellType] ~ {
cellType ← Sisyph.ExtractSchematicByName[name: name, cx: tamarinCx];
};
CSeq: PROC [inX: BOOL, name: ROPE, ct: CellType, count: NAT, wrs: LIST OF WR] RETURNS [cellType: CellType] = {
cellType ← SequenceCell[name: name,
baseCell: ct, count: count,
sequencePorts: WireList[wrs]];
IF inX THEN PWCore.SetArrayX[cellType] ELSE PWCore.SetArrayY[cellType];
};
CSeqX: PROC [name: ROPE, ct: CellType, count: NAT, wrs: LIST OF WR] RETURNS [cellType: CellType] = {cellType ← CSeq[TRUE, name, ct, count, wrs]};
CSeqY: PROC [name: ROPE, ct: CellType, count: NAT, wrs: LIST OF WR] RETURNS [cellType: CellType] = {cellType ← CSeq[FALSE, name, ct, count, wrs]};
-- Shifter
CreateShifter: PROC [] RETURNS [cellType: CellType] ~ {
cellType ← CSeqX["Shifter", Extract["ShiftSlice.sch"], dpWidth,
LIST["D1", "D2", "R"]];
};
-- ShifterGuts
CreateShifterGuts: PROC [height: NAT] RETURNS [cellType: CellType] ~ {
cellType ← CSeqY["ShifterMiddle", Extract["ShiftBase.sch"], height,
LIST["Select"]];
};
CreateBarrelShifter: PUBLIC PROC RETURNS [cellType: CellType] = {
select: Wire ← Seq["Select", 16];
shResult: Wire ← Seq["shResult", 32];
D1Bus: Wire ← Seq["D1Bus", 32];
D2Bus: Wire ← Seq["D2Bus", 32];
shTopOut: Wire ← Seq["shTopOut", 32];
RBus: Wire ← Seq["RBus", 32];
spass: Wire ← Seq["spass", 16];
tileArray: TilingClass.TileArray ← NEW[TilingClass.TileArrayRec[18]];
-- 17 is the top and I'll start building there
tileArray[17] ← NEW[TilingClass.TileRowRec[32]];
FOR i: NAT IN [0..32) DO
tileArray[17][i] ← NEW[TilingClass.TileRec ← [
type: Sisyph.ES[".ShiftTop.sch", tamarinCx],
flatten: TRUE,
renaming: LIST[["Vdd", "Vdd"], ["Gnd", "Gnd"], ["D1", D1Bus[i]], ["D2", D2Bus[i]],
["R", RBus[i]], ["ShiftTopOut", shTopOut[i]]]
]];
ENDLOOP;
-- line n of shifter is tileArray[16-n]
FOR row: NAT DECREASING IN [1..16] DO
tileArray[row] ← NEW[TilingClass.TileRowRec[32]];
FOR i: NAT IN (0..32) DO
tileArray[row][i] ← NEW[TilingClass.TileRec ← [
type: Sisyph.ES["ShiftBase.sch", tamarinCx],
flatten: TRUE,
renaming: LIST[ ["Select", select[16-row]] ]
]];
ENDLOOP;
tileArray[row][0] ← NEW[TilingClass.TileRec ← [
type: Sisyph.ES["ShiftBase.sch", tamarinCx],
flatten: TRUE,
renaming: LIST[ ["Select", select[16-row]], ["ShiftPass", spass[row]] ]
]];
ENDLOOP;
-- 0 is the bottom
tileArray[0] ← NEW[TilingClass.TileRowRec[32]];
FOR i: NAT IN (0..32) DO
tileArray[0][i] ← NEW[TilingClass.TileRec ← [
type: Sisyph.ES["ShiftBottom.sch", tamarinCx],
flatten: TRUE,
renaming: LIST[ ["Vdd", "Vdd"], ["Gnd", "Gnd"],
["D1", D1Bus[i]], ["D2", D2Bus[i]], ["R", RBus[i]] ]
]];
ENDLOOP;
tileArray[0][0] ← NEW[TilingClass.TileRec ← [
type: Sisyph.ES["ShiftBottom.sch", tamarinCx],
flatten: TRUE,
renaming: LIST[ ["Vdd", "Vdd"], ["Gnd", "Gnd"],
["D1", D1Bus[0]], ["D2", D2Bus[0]], ["R", RBus[0]], ["RS1In", "RS1In"] ]
]];
cellType ← TilingClass.CreateTiling[
name: "BarrelShifter",
public: Wires[D1Bus, D2Bus, RBus, "Vdd", "Gnd", select, "ShiftBotCtl", spass, "RS1In"],
tileArray: tileArray,
neighborX: TilingClass.LayoutNeighborX,
neighborY: TilingClass.LayoutNeighborY
];
};
dpWidth: NAT ← 34;
numTagBits: NAT ← 2;
tamarinDesign ← PW.OpenDesign["EUCircuits"];
[] ← CDImports.Load[tamarinDesign, "SSI"];
[] ← CDImports.Load[tamarinDesign, "EE"];
[] ← CDImports.Load[tamarinDesign, "Logic"];
tamarinCx ← Sisyph.Create[design: tamarinDesign];
END.