DIRECTORY Basics, BitOps, Core, CoreClasses, CoreCreate, CoreOps, CRProcs, CD, PWCore, Sisyph, SSI; CRProcsImpl: CEDAR PROGRAM IMPORTS Basics, BitOps, CoreCreate, CoreOps, PWCore, Sisyph, SSI EXPORTS CRProcs = BEGIN OPEN CoreCreate; InitContext: PUBLIC PROC [cx: Sisyph.Context] = { selectBits: INT = 8; log2SelectBits: INT = BitOps.Log2[selectBits]; addressDecoderBits: INT = CRProcs.addressBits-log2SelectBits; andPlaneBits: INT = addressDecoderBits-1; Sisyph.Store[cx, "dataBits", NEW[INT _ CRProcs.dataBits]]; Sisyph.Store[cx, "addressBits", NEW[INT _ CRProcs.addressBits]]; Sisyph.Store[cx, "selectBits", NEW[INT _ selectBits]]; Sisyph.Store[cx, "rowQuads", NEW[INT _ CRProcs.rowQuads]]; Sisyph.Store[cx, "log2SelectBits", NEW[INT _ log2SelectBits]]; Sisyph.Store[cx, "addressDecoderBits", NEW[INT _ addressDecoderBits]]; Sisyph.Store[cx, "andPlaneBits", NEW[INT _ andPlaneBits]]; }; DecoderLogicDriver: PUBLIC PROC [cx: Sisyph.Context] RETURNS [ct: CellType] = { select: NAT _ Sisyph.FetchInt[cx, "selectBits"].value; log2Select: NAT _ Sisyph.FetchInt[cx, "log2SelectBits"].value; invert8: CellType _ SSI.Inverter[]; and: CellType _ SSI.And[i: log2Select]; instances: CoreClasses.CellInstances _ NIL; FOR adrBit: INT IN [0 .. log2Select) DO instances _ CONS [ Instance[ invert8, ["Input", Index["LowAddressB", adrBit]], ["nOutput", Index["nLowAddressB", adrBit]] ], instances]; ENDLOOP; FOR sel: INT IN [0 .. select) DO bind: LIST OF WR _ NIL; FOR adrBit: INT DECREASING IN [0 .. log2Select) DO bind _ CONS [ Index[ IF Basics.BITAND[Basics.BITSHIFT[sel, adrBit-log2Select+1], 1]#0 THEN "LowAddressB" ELSE "nLowAddressB", adrBit], bind]; ENDLOOP; instances _ CONS [ Instance[ and, ["Input", WireList[bind]], ["Output", Index["Select", sel]] ], instances]; ENDLOOP; ct _ Cell[ name: "DecoderLogicDriver", public: Wires["Vdd", "Gnd", "AdrBit", "nAdrBit", Seq["LowAddressB", log2Select], Seq["Select", select]], onlyInternal: Wires[Seq["nLowAddressB", log2Select]], instances: instances ]; PWCore.SetGet[ct, Sisyph.GetDesign[cx]]; }; DecoderAndPlane: PUBLIC PROC [cx: Sisyph.Context] RETURNS [ct: CellType] = { DecoderRow: PROC [row: NAT] RETURNS [ct: CellType] = { AdrBit: Wire _ Seq["AdrBit", andPlaneBits]; nAdrBit: Wire _ Seq["nAdrBit", andPlaneBits]; nDecode: Wire _ CoreOps.CreateWire[name: "nDecode"]; Gnd: Wire _ CoreOps.CreateWire[name: "Gnd"]; SeriesInternal: Wire _ Seq["SeriesInternal", andPlaneBits-1]; instances: CoreClasses.CellInstances _ NIL; FOR adrBit: NAT DECREASING IN [0..andPlaneBits) DO instances _ CONS [ Instance[ IF BitOps.EBFW[row, adrBit, andPlaneBits] THEN dec1 ELSE dec0, ["AdrBit", AdrBit[adrBit]], ["nAdrBit", nAdrBit[adrBit]], ["SeriesTop", IF adrBit=andPlaneBits-1 THEN nDecode ELSE SeriesInternal[adrBit]], ["SeriesBottom", IF adrBit=0 THEN Gnd ELSE SeriesInternal[adrBit-1]]], instances]; ENDLOOP; ct _ Cell[ public: Wires["Vdd", Gnd, AdrBit, nAdrBit, nDecode], onlyInternal: Wires[SeriesInternal], instances: instances]; PWCore.SetAbutX[ct]; }; design: CD.Design _ Sisyph.GetDesign[cx]; rowQuads: NAT _ Sisyph.FetchInt[cx, "rowQuads"].value; andPlaneBits: NAT _ Sisyph.FetchInt[cx, "andPlaneBits"].value; dec0: Core.CellType _ Sisyph.ExtractSchematicByName[ "DecoderZero.sch", cx]; dec1: Core.CellType _ Sisyph.ExtractSchematicByName[ "DecoderOne.sch", cx]; instances: CoreClasses.CellInstances _ NIL; nDecode: Wire _ Seq["nDecode", 2*rowQuads]; PWCore.SetGet[dec0, design]; PWCore.SetGet[dec1, design]; FOR rowQ: NAT IN [0..rowQuads) DO instances _ CONS [ Instance[ DecoderRow[2*rowQ], ["nDecode", nDecode[2*rowQ]]], instances]; instances _ CONS [ Instance[ PWCore.RotateCellType[DecoderRow[2*rowQ+1], $FlipY], ["nDecode", nDecode[2*rowQ+1]]], instances]; ENDLOOP; ct _ Cell[ name: "DecoderAndPlane", public: Wires["Vdd", "Gnd", Seq["AdrBit", andPlaneBits], Seq["nAdrBit", andPlaneBits], nDecode], instances: instances]; PWCore.SetAbutY[ct]; }; DataBufferMux: PUBLIC PROC [cx: Sisyph.Context] RETURNS [ct: CellType] = { SelectRow: PROC [row: NAT] RETURNS [ct: CellType] = { Bit: Wire _ Seq["Bit", selectBits]; nBit: Wire _ Seq["nBit", selectBits]; Select: Wire _ CoreOps.CreateWire[name: "Select"]; VSelect: Wire _ Seq["VSelect", row]; instances: CoreClasses.CellInstances _ NIL; FOR col: NAT DECREASING IN [0..selectBits) DO subCell: CellType _ SELECT TRUE FROM row BitSelNoPoly, row=col => BitSelContact, row>col => BitSelPoly, ENDCASE => ERROR; instances _ CONS [ Instance[ subCell, ["Bit", Bit[col]], ["nBit", nBit[col]], ["Select", Select], IF subCell=BitSelPoly THEN ["VSelect", VSelect[col]] ELSE []], instances]; ENDLOOP; ct _ Cell[ public: Wires[Bit, nBit, Select, IF VSelect.size>0 THEN VSelect ELSE NIL], instances: instances]; PWCore.SetAbutX[ct]; }; selectBits: NAT _ Sisyph.FetchInt[cx, "selectBits"].value; design: CD.Design _ Sisyph.GetDesign[cx]; BitSelNoPoly: CellType _ Cell[ name: "BitSelNoPoly", public: Wires["Select", "nBit", "Bit"], instances: NIL]; BitSelContact: CellType _ Cell[ name: "BitSelContact", public: Wires["Select", "nBit", "Bit"], instances: NIL]; BitSelPoly: CellType _ Cell[ name: "BitSelPoly", public: Wires["VSelect", "Select", "nBit", "Bit"], instances: NIL]; Select: Wire _ Seq["Select", selectBits]; Bit: Wire _ Seq["Bit", selectBits]; nBit: Wire _ Seq["nBit", selectBits]; instances: CoreClasses.CellInstances _ NIL; PWCore.SetGet[BitSelNoPoly, design]; PWCore.SetGet[BitSelContact, design]; PWCore.SetGet[BitSelPoly, design]; FOR row: NAT DECREASING IN [0..selectBits) DO rowCell: CellType _ SelectRow[row]; publicV: Wire _ FindWire[rowCell.public, "VSelect"]; pas: LIST OF PA _ CONS[["Select", Select[row]], NIL]; FOR col: NAT IN [0..row) DO pas _ CONS[[publicV[col], Select[col]], pas]; ENDLOOP; instances _ CONS[InstanceList[rowCell, pas], instances]; ENDLOOP; ct _ Cell[ name: "DataBufferMux", public: Wires[Select, Bit, nBit], instances: instances]; PWCore.SetAbutY[ct]; }; END. |CRProcsImpl.mesa Copyright c 1985 by Xerox Corporation. All rights reserved. Barth, March 16, 1987 4:50:27 pm PST ΚP˜codešœ™Kšœ Οmœ1™Kšœ'žœžœ˜FKšœ!žœžœ˜:Kšœ˜K™—šΠbnœžœžœžœ˜OKšœžœ+˜6Kšœ žœ/˜>Kšœžœ ˜#Kšœžœ˜'Kšœ'žœ˜+šžœ žœžœžœ˜(šœ žœ˜šœ ˜ Kšœ ˜ Kšœ)˜)Kšœ*˜*Kšœ˜—Kšœ ˜ —Kšžœ˜—šžœžœžœž˜ Kš œžœžœžœžœ˜š žœ žœž œžœžœ˜3šœžœ˜ šœ˜Kš žœžœžœ!žœžœ˜iKšœ ˜ —Kšœ˜—Kšžœ˜—šœ žœ˜šœ ˜ Kšœ˜Kšœ˜Kšœ ˜ Kšœ˜—Kšœ ˜ —Kšžœ˜—šœ ˜ Kšœ˜Kšœh˜hKšœ5˜5Kšœ˜Kšœ˜—Jšœ(˜(Kšœ˜K˜—šŸœžœžœžœ˜LK˜šŸ œžœžœžœ˜6Kšœ+˜+Kšœ-˜-Kšœ4˜4Kšœ,˜,Kšœ=˜=J˜Kšœ'žœ˜+šžœ žœž œžœ˜3šœ žœ˜šœ ˜ Jšžœžœžœ˜3Jšžœ˜ Jšœ˜Jšœ˜Kšœžœžœ žœ˜RJšœžœ žœžœ˜G—Jšœ ˜ —Kšžœ˜—˜ Kšœ4˜4Kšœ$˜$Kšœ˜—Jšœ˜K˜K˜—Kšœžœ˜)Kšœ žœ)˜6Kšœžœ-˜>KšœL˜LKšœK˜KKšœ'žœ˜+Kšœ+˜+Jšœ˜Jšœ˜šžœžœžœž˜!šœ žœ˜šœ ˜ Jšœ˜Jšœ˜—Jšœ ˜ —šœ žœ˜šœ ˜ Jšœ4˜4Jšœ!˜!—Jšœ ˜ —Kšžœ˜—˜ K˜Kšœ`˜`Kšœ˜—Kšœ˜Kšœ˜K˜—šŸ œžœžœžœ˜JK˜šŸ œžœžœžœ˜5Kšœ#˜#Kšœ%˜%Kšœ2˜2Kšœ$˜$J˜Kšœ'žœ˜+šžœžœž œž˜-šœžœžœž˜$Kšœ˜Kšœ˜Kšœ˜Kšžœžœ˜—šœ žœ˜šœ ˜ Jšœ ˜ Jšœ˜Jšœ˜Jšœ˜Jšžœžœžœ˜?—Jšœ ˜ —Kšžœ˜—˜ Kš œ!žœžœ žœžœ˜JKšœ˜—Jšœ˜K˜K˜—Kšœ žœ+˜:Kšœžœ˜)šœ˜Kšœ˜Kšœ'˜'Kšœ žœ˜—šœ˜Kšœ˜Kšœ'˜'Kšœ žœ˜—šœ˜Kšœ˜Kšœ2˜2Kšœ žœ˜—Kšœ)˜)Kšœ#˜#Kšœ%˜%Kšœ'žœ˜+Jšœ$˜$Jšœ%˜%Jšœ"˜"šžœžœž œž˜-Kšœ#˜#K˜4Kš œžœžœžœžœžœ˜5šžœžœžœ ž˜Kšœžœ#˜-Kšžœ˜—Jšœ žœ(˜8Kšžœ˜—˜ Kšœ˜Kšœ!˜!Kšœ˜—Kšœ˜Kšœ˜K˜—Kšžœ˜—…—"ξ