DIRECTORY BitOps, CD, CoreCreate, EUInner, EUUtils, PWCore, Rope, TilingClass; EUFUImpl: CEDAR PROGRAM IMPORTS BitOps, CoreCreate, EUUtils, PWCore, Rope, TilingClass EXPORTS EUInner = BEGIN OPEN CoreCreate, EUInner; CreateFieldUnit: PUBLIC PROC RETURNS [cellType: CellType] = { cellType _ EUUtils.Extract["FieldUnit.sch"]; }; CreateBarrelShifter: PUBLIC PROC RETURNS [cellType: CellType] = { sh: Wire _ Seq["sh", 32+1]; shOut: Wire _ Seq["shOut", 32]; left: Wire _ Seq["left", 32]; st2A: Wire _ Seq["st2A", 32]; r2B: Wire _ Seq["r2B", 32]; cBus: Wire _ Seq["cBus", 32]; fuOut: Wire _ Seq["fuOut", 32]; tileArray: TilingClass.TileArray _ NEW[TilingClass.TileArrayRec[35]]; tileArray[0] _ NEW[TilingClass.TileRowRec[32]]; FOR i: NAT IN [0..32) DO tileArray[0][i] _ NEW[TilingClass.TileRec _ [ type: EUUtils.Extract["shRightConnect.sch"], flatten: TRUE, renaming: LIST[["Vdd", "Vdd"], ["Gnd", "Gnd"], ["st2A", st2A[i]], ["r2B", r2B[i]], ["cBus", cBus[i]], ["fuOut", fuOut[i]], ["shOut", shOut[i]] ] ]]; ENDLOOP; FOR row: NAT IN [1..33] DO tileArray[row] _ NEW[TilingClass.TileRowRec[32]]; FOR i: NAT IN [0..32) DO tileArray[row][i] _ NEW[TilingClass.TileRec _ [ type: EUUtils.Extract["ShifterCell.sch"], flatten: TRUE, renaming: LIST[["sh", sh[33-row]]] ]]; ENDLOOP; ENDLOOP; tileArray[34] _ NEW[TilingClass.TileRowRec[32]]; FOR i: NAT IN [0..32) DO tileArray[34][i] _ NEW[TilingClass.TileRec _ [ type: EUUtils.Extract["shLeftConnect.sch"], flatten: TRUE, renaming: LIST[ ["left", left[i]] ] ]]; ENDLOOP; cellType _ TilingClass.CreateTiling[ name: "BarrelShifter", public: Wires[shOut, sh, "Vdd", "Gnd", left, st2A, r2B, cBus, fuOut], tileArray: tileArray, neighborX: TilingClass.LayoutNeighborX, neighborY: TilingClass.LayoutNeighborY ]; }; CreateMask: PUBLIC PROC RETURNS [cellType: CellType] = { instances: CellInstances _ NIL; FOR i: [0..32) DECREASING IN [0..32) DO instances _ CONS[ Instance[CreateMasksCell[i], ["m1", Index["m1", i]], ["m2", Index["m2", i]], ["st2A", Index["st2A", i]], ["r2B", Index["r2B", i]], ["cBus", Index["cBus", i]], ["fuOut", Index["fuOut", i]]], instances]; ENDLOOP; cellType _ Cell[ name: "Mask", public: Wires["Vdd", "Gnd", Seq["mask", 6], Seq["shift", 6], Seq["m1", 32], Seq["m2", 32], Seq["st2A", 32], Seq["r2B", 32], Seq["cBus", 32], Seq["fuOut", 32]], instances: instances]; PWCore.SetAbutX[cellType]; }; CreateMasksCell: PROC [pos: [0..32)] RETURNS [cellType: CellType] = { m1: CellType _ CreateMaskCell["mask", "m1", 31-pos]; m2: CellType _ CreateMaskCell["shift", "m2", 31-pos]; cellType _ Cell[ name: "Masks", public: Wires["Vdd", "Gnd", Seq["mask", 6], Seq["shift", 6], "m1", "m2", "st2A", "r2B", "cBus", "fuOut" ], instances: LIST[Instance[m2], Instance[m1]]]; PWCore.SetAbutY[cellType]; }; Trits: TYPE = {P, S, F, X}; Pat: TYPE = ARRAY [0..6) OF Trits; Pattern: PROC [k: NAT] RETURNS [lowToHi: Pat] ~ { isOne: BOOL _ BitOps.EBFD[k, 31]; -- low-order bit I believe lowToHi[0] _ IF isOne THEN X ELSE F; FOR bit: NAT IN [1..6) DO isOne _ BitOps.EBFD[k, 31-bit]; lowToHi[bit] _ SELECT TRUE FROM isOne AND lowToHi[bit-1]=X => X, isOne => S, ~isOne AND lowToHi[bit-1]=X => F, ~isOne => P, ENDCASE => ERROR; ENDLOOP; }; CreateMaskCell: PROC [selName, outName: ROPE, pos: [0..32)] RETURNS [cellType: CellType] = { pas: LIST OF CoreCreate.PA _ LIST[["Vdd", "Vdd"], ["m1", "m1"], ["m2", "m2"], ["Gnd", "Gnd"], ["st2A", "st2A"], ["r2B", "r2B"], ["cBus", "cBus"], ["fuOut", "fuOut"]]; POb: CD.Object _ PWCore.Layout[EUUtils.Extract["maskP.sch"]]; SOb: CD.Object _ PWCore.Layout[EUUtils.Extract["maskS.sch"]]; FOb: CD.Object _ PWCore.Layout[EUUtils.Extract["maskF.sch"]]; XOb: CD.Object _ PWCore.Layout[EUUtils.Extract["maskX.sch"]]; botOb: CD.Object _ PWCore.Layout[EUUtils.Extract["maskBot.sch"]]; public: Wire _ Wires["Vdd", "Gnd", Seq[selName, 6], "m1", "m2", "st2A", "r2B", "cBus", "fuOut"]; abutInstances: LIST OF PWCore.AbutInstance _ LIST [ [PWCore.Layout[EUUtils.Extract[Rope.Cat[outName, "top.sch"]]], pas]]; lowToHi: Pat _ Pattern[pos]; FOR bit: NAT DECREASING IN [0..6) DO ob: CD.Object _ SELECT lowToHi[bit] FROM X => XOb, F => FOb, S => SOb, P => POb, ENDCASE => ERROR; abutInstances _ CONS [[ob, CONS[["sel", Index[selName, 5-bit]], pas]], -- check!!! abutInstances]; ENDLOOP; abutInstances _ CONS [[botOb, pas], abutInstances]; cellType _ PWCore.AbutCell[ name: "Mask", public: public, abutInstances: abutInstances, inX: FALSE]; }; CreateCompose: PUBLIC PROC RETURNS [cellType: CellType] = { cellType _ EUUtils.CSeqX["Compose", EUUtils.Extract["ComposeCell.sch"], 32, LIST["st2A", "r2B", "cBus", "m1", "m2", "shOut", "fuOut"]]; }; END. ΔEUFUImpl.mesa Copyright c 1985, 1986 by Xerox Corporation. All rights reserved. Louis Monier June 9, 1986 5:19:45 pm PDT Bertrand Serlet September 5, 1986 12:45:24 pm PDT Last Edited by: Louis Monier November 17, 1986 10:46:43 pm PST -- (left, st2A, r2B, cBus, fuOut)[0..32), insert, (mask, shift)[0..6), sh[0..33) -- A barrel shifter; two inputs (left and st2A), one output (fuOut) -- sh=0 => out_left; sh=32 => out_st2A; shift by zero is on top; -- shOut[0..32), sh[0..33), pass, (left, st2A, r2B, cBus, fuOut)[0..32), Vdd, Gnd -- 0 is the bottom -- line n of shifter is tileArray[n+1] -- 34 is the top -- The field unit uses a mask generator which takes two 6-bit quantities ("shift" and "mask") and a boolean (insert), and produces a mask of the form: if ~insert: 0001111 with exactly "mask" ones on the low-order side if insert: 00011000 with exactly "mask-shift" ones followed by "shift" zeros on the low-order side So the slice "i" has output (ii. By recurring on the high-order bit, we find that F[n, k, i]=k[n].~i[n]+(k[n]=i[n]).F[n-1, k, i], and for 1-bit numbers F[0, k, i]=k[0].~i[0] In every slice, i is a constant and k an input. Let's decompose according to the value of i[n]: i[n]=0: F[0, k, i]=k[0] (use k[0]) F[n, k, i]=k[n] + F[n-1, k, i]=Nand [~k[n], ~F[n-1, k, i]] (NOR to Gnd) i[n]=1: F[0, k, i]=0 (no transistor) F[n, k, i]=k[n] . F[n-1, k, i]=Nor [~k[n], ~F[n-1, k, i]] (NAND branch) -- Note: a NAND branch starting with no tr. still has no tr., i.e. if i=xx0111 then the three bottom transistors are missing! -- mask[0..6), shift[0..6), (m1, m2, st2A, r2B, cBus, fuOut)[0..32), Vdd, Gnd, -- "Vdd", "Gnd", "shift[0..6)", "mask[0..6)", "m1", "m2", "st2A", "r2B", "cBus", "fuOut" isOne: BOOL _ BitHacks.XthBitOfN[0, k]; isOne _ BitHacks.XthBitOfN[bit, k]; -- Using a generator of static gates, program maskOut=F(a, pos) -- "Vdd", "Gnd", "selName[0..6)", "maskOut" -- (selName, outName) can be (mask, m1) or (shift, m2); -- The composition cell: two masks, two words, insert, and an output -- Vdd, Gnd, insert, (st2A, r2B, cBus, fuOut, shOut, m1, m2)[0..32) Κd– "cedar" style˜codešœ ™ Kšœ Οmœ7™BK™(K™1K™>—K˜KšΟk œ žœ:˜NK˜•StartOfExpansion[]šΠbnœžœž˜Kšžœ7˜>Kšžœ ˜Kšžœžœ˜—K˜KšœP™PšΟnœžœžœžœ˜=Kšœ,˜,Kšœ˜—K™KšœC™CKšœA™AKšœQ™Qš œž œžœ˜AKšœ˜Kšœ˜Kšœ˜Kšœ˜Kšœ˜Kšœ˜Kšœ˜Kšœ#žœ˜EK™Kšœžœ˜/šžœžœžœ ž˜šœžœ˜-Kšœ,˜,Kšœ žœ˜Kšœ žœ‚˜—Kšœ˜Kšžœ˜—Kšœ&™&šžœžœžœ ž˜Kšœžœ˜1šžœžœžœ ž˜šœžœ˜/Kšœ)˜)Kšœ žœ˜Kšœ žœ˜"—Kšœ˜Kšžœ˜—Kšžœ˜—K™Kšœžœ˜0šžœžœžœ ž˜šœžœ˜.Kšœ+˜+Kšœ žœ˜Kšœ žœ˜#—Kšœ˜Kšžœ˜—K˜šœ$˜$Kšœ˜KšœF˜FKšœ˜Kšœ'˜'Kšœ&˜&Kšœ˜—Kšœ˜—K™šœ–™–KšœB™BKšœb™bKšœN™N—™K™[™_K™%K™HK™(K™H—K™~K™KšœO™Oš  œž œžœ˜8Kšœžœ˜šžœ ž œžœ ž˜'šœ žœ˜šœ˜KšœL˜LKšœW˜W—Kšœ ˜ —Kšžœ˜—šœ˜Kšœ ˜ šœ=˜=Kšœb˜b—Kšœ˜—Kšœ˜Kšœ˜K˜—KšœX™Xš œžœžœ˜EKšœ4˜4Kšœ5˜5šœ˜Kšœ˜Kšœj˜jKšœ žœ˜-—Kšœ˜Kšœ˜K˜—Kšœžœ˜Kšœžœžœžœ˜"š œžœžœžœ˜1Kšœžœ™'Kšœžœ žœ Οc˜