IFUAsmFetchBuf.mesa
Copyright c 1985 by Xerox Corporation. All rights reserved.
Last Edited by Curry, November 25, 1985 10:10:53 pm PST
DIRECTORY
CD,
CDDirectory,
CDPinObjects,
Commander,
IFUAsm,
IFUPW,
IO,
PW,
Rope;
IFUAsmFetchBuf: CEDAR PROGRAM
IMPORTS CD, CDDirectory, CDPinObjects, Commander, IFUAsm, IFUPW, IO, PW, Rope
EXPORTS IFUAsm =
BEGIN
GND: Rope.ROPE = IFUPW.GND;
VDD: Rope.ROPE = IFUPW.VDD;
FetchBufferArrayCtl: LIST OF REF = LIST[
NIL,
NIL,
NIL,
"IPBus.",
NIL,
"PCBus."];
FetchBufferArrayTop: LIST OF REF = LIST[
NIL,
NIL,
NIL,
"IPBus.",
NIL,
"PCBus."];
FetchBufferArray: PROC[design: CD.Design] RETURNS[cell: CD.Object] = {
FetchBufAssignNames: IFUPW.PinNameProc = {
OPEN IFUPW;
oldPinName: Rope.ROPE ← CDPinObjects.GetName[pin];
SELECT side FROM
left  => {
IF oldPinName.Find[VDD]>=0 THEN RETURN[oldPinName];
IF oldPinName.Find[GND]>=0 THEN RETURN[oldPinName];
IF pin.location.y < botY
THEN name ← oldPinName
ELSE name ← IO.PutFR["FetchRd.%02g", IO.int[(pin.location.y-botY)/midY]]};
right  => name ← NIL;
top, bottom => {
list:  List;
byte, bit: INT;
column: INT ← ((pin.location.x MOD cellWidth)-leftTail)/metPitch;
[byte, bit]  ← ByteBitFromIndex
[pin.location.x/cellWidth, IFUPW.IFUDataColNSeq];
list    ← ExpandList[byte, bit, IF side=top
THEN FetchBufferArrayTop
ELSE FetchBufBot];
list    ← FixGVInList[list];
name    ← ListIndexItem[list, column];
IF name=NIL THEN ERROR};
ENDCASE   => ERROR};
botY, midY: INT ← 0;
row: CD.Object ← CDDirectory.Fetch[design, "FetchBufNyblTop"].object;
cell ← PW.ArrayX[design, row, 8];
FOR wd: INT DECREASING IN [0..3] DO
wdR: Rope.ROPEIO.PutFR["WtWd%g", IO.int[wd]];
FOR byte: INT DECREASING IN [0..3] DO
byteR: Rope.ROPEIO.PutFR["WtByte%g", IO.int[byte]];
row ← CDDirectory.Fetch[design, "FetchBufferBit"].object;
row ← PW.Inst[design, row, LIST[wdR, byteR], FALSE];
row ← PW.ArrayX[design, row, 8];
cell ← PW.AbutY[design, row, cell];
ENDLOOP;
ENDLOOP;
midY ← CD.InterestSize[row].y;
row ← CDDirectory.Fetch[design, "FetchBufNyblBot"].object;
botY ← CD.InterestSize[row].y;
row ← PW.ArrayX[design, row, 8];
cell ← PW.AbutY[design, row, cell];
cell ← IFUPW.RenameObjAndPins[design, cell, "FetchBuf", FetchBufAssignNames] };
FetchBufBot: LIST OF REF = IFUPW.LISTn[
"PCBus.",
LIST["AlphaAB.", "BetaAB.",  "GammaAB.", "DeltaAB."],
LIST["OpAB.",   NIL,   NIL,    NIL] ];
module: Rope.ROPE ← "IFUAsmFetchBuf";
FetchBuf: PUBLIC IFUPW.Frame ← IFUPW.NFSFUP[module, y, LIST[
FetchBufferArray ] ];
FetchBufCT: Commander.CommandProc =
{IFUPW.AssembleFrame[IFUAsm.RefDesign[], FetchBuf, cmd ] };
Commander.Register   [proc:   FetchBufCT, key: module];
END.