IFUSrcFetchControler.mesa
Copyright c 1986 by Xerox Corporation. All rights reserved.
Last Edited by Curry, October 14, 1986 6:49:53 pm PDT
Don Curry October 29, 1986 11:43:57 pm PST
DIRECTORY CCDUtils, CDOrient, Core, CoreBlock, CoreFrame, CoreGlue, CoreName, CoreXform, IFUSrc, IFUCoreCtl, IFUCoreData, IFUCoreDrive;
IFUSrcFetchControler: CEDAR PROGRAM
IMPORTS CCDUtils, CoreFrame, CoreGlue, CoreName, CoreXform, IFUCoreData, IFUCoreCtl, IFUCoreDrive
EXPORTS IFUSrc =
BEGIN
ROPE:    TYPE = Core.ROPE;
CellType:   TYPE = Core.CellType;
Signal:   SIGNAL = CODE;
xForm:   CoreXform.Xform ← CoreXform.GenXform[ LIST[ [5, 0] ] ];
GND:    ROPE ← CoreName.RopeNm["GND"];
VDD:    ROPE ← CoreName.RopeNm["VDD"];
pcBus:   ROPE = "(NIL NIL NIL PCBus.36 PCBus.37)";
opLength:  ROPE = "(NIL NIL OpLengthAB.0 OpLengthAB.1 OpLengthAB.2)";
fetchWtAB01: ROPE = "(NIL FetchWtAB.0 FetchWtAB.1 NIL NIL)";
fetchRdBA03: ROPE = "(NIL FetchRdBA.0 FetchRdBA.1 FetchRdBA.2 FetchRdBA.3)";
WtAdder: PROC RETURNS [cellType: CellType] = {
cellType ← IFUCoreData.CellProc[
subClass: "GPRow",
type:   "DpAdderSerial",
name:  "WtAdder",
top:  NIL,
in:   "(
WtAB.
(GND  GND  VDD  GND  GND)
(WtCry.1 WtCry.2 WtCry.3 WtCry.4 GND) )",
out:  "( WtSumB. NIL (NIL WtCry.1 WtCry.2 WtCry.3 WtCry.4) )",
bot:  WtMuxTop,
xform:  xForm ]};
WtMuxTop: LIST OF REF = LIST[
"WtAB.",
NIL,
NIL,
NIL,
"WtSumB." ];
WtMux: PROC RETURNS [cellType: CellType] = {
cellType ← IFUCoreData.CellProc[
subClass: "Mux",
name:  "WtMux",
top:  WtMuxTop,
right:  "(FetchWtIndexCtlClearBA FetchWtIndexCtlHoldBA FetchWtIndexCtlIncBA)",
in:   "(GND   WtAB.   WtSumB.)",
out:  "(WtB.)",
bot:  WtLatchBTop,
xform:  xForm ]};
WtLatchBTop: LIST OF REF = LIST[
"WtAB.",
NIL,
NIL,
NIL,
NIL,
"WtB." ];
WtLatchB: PROC RETURNS [cellType: CellType] = {
cellType ← IFUCoreData.CellProc[
subClass: "GPRow",
type:   "DpLatch",
name:  "WtLatchB",
top:  WtLatchBTop,
right:  "(PhB VBB)",
in:   "(WtB.)",
out:  "(WtBA.)",
bot:  WtLatchATop,
xform:  xForm ]};
WtLatchATop: LIST OF REF = LIST[
"WtAB.",
"WtBA."];
WtLatchA: PROC RETURNS [cellType: CellType] = {
cellType ← IFUCoreData.CellProc[
subClass: "GPRow",
type:   "DpLatch",
name:  "WtLatchA",
top:  WtLatchATop,
right:  "(PhA VBB)",
in:   "(WtBA.)",
out:  "(WtAB.)",
bot:  WtLatchABot,
xform:  xForm ]};
WtLatchABot: LIST OF REF = LIST[
"WtAB.",
"WtBA."];
FetchWtAB01 ← WtAB12
RdAdderTop: LIST OF REF = LIST[
fetchWtAB01,
"WtBA."];
RdAdder: PROC RETURNS [cellType: CellType] = {
cellType ← IFUCoreData.CellProc[
subClass: "GPRow",
type:   "DpAdderSerial",
name:  "RdAdder",
top:  RdAdderTop,
in:   "(
RdAB.
(GND  GND  OpLengthAB.0 OpLengthAB.1 OpLengthAB.2)
(RdCry.1 RdCry.2 RdCry.3 RdCry.4 GND) )",
out:  "( RdSumB. NIL (NIL RdCry.1 RdCry.2 RdCry.3 RdCry.4) )",
bot:  RdMuxTop,
xform:  xForm ]};
RdMuxTop: LIST OF REF = LIST[
fetchWtAB01,
"WtBA.",
opLength,
"RdSumB.",
NIL,
"RdAB."];
RdMux: PROC RETURNS [cellType: CellType] = {
cellType ← IFUCoreData.CellProc[
subClass: "Mux",
name:  "RdMux",
top:  RdMuxTop,
right:  "(
NextMacroJumpBA
NextMacroHoldBA
NextMacroGetBA)",
in:   "(
(GND GND GND PCBus.36 PCBus.37)
RdAB.
RdSumB. ) ",
out:  "(RdB.)",
bot:  RdLatchBTop,
xform:  xForm ]};
RdLatchBTop: LIST OF REF = LIST[
fetchWtAB01,
"WtBA.",
opLength,
pcBus,
"RdB.",
"RdAB."];
RdLatchB: PROC RETURNS [cellType: CellType] = {
cellType ← IFUCoreData.CellProc[
subClass: "GPRow",
type:   "DpLatch",
name:  "RdLatchB",
top:  RdLatchBTop,
right:  "(PhB VBB)",
in:   "(RdB.)",
out:  "(RdBA.)",
bot:  RdLatchATop,
xform:  xForm ]};
RdLatchATop: LIST OF REF = LIST[
fetchWtAB01,
"WtBA.",
opLength,
pcBus,
"RdBA.",
"RdAB."];
RdLatchA: PROC RETURNS [cellType: CellType] = {
cellType ← IFUCoreData.CellProc[
subClass: "GPRow",
type:   "DpLatch",
name:  "RdLatchA",
top:  RdLatchATop,
right:  "(PhA VBB)",
in:   "(RdBA.)",
out:  "(RdAB.)",
bot:  RdInvertTop,
xform:  xForm ]};
RdInvertTop: LIST OF REF = LIST[
fetchWtAB01,
"WtBA.",
opLength,
pcBus,
"RdBA." ];
RdInvert: PROC RETURNS [cellType: CellType] = {
cellType ← IFUCoreData.CellProc[
subClass: "GPRow",
type:   "DpInv",
name:  "RdInvert",
top:  RdInvertTop,
in:   "(RdBA.)",
out:  "(NotRdBA.)",
bot:  RdInvertBot,
xform:  xForm ]};
RdInvertBot: LIST OF REF = LIST[
fetchWtAB01,
"WtBA.",
opLength,
pcBus,
"RdBA.",
"NotRdBA." ];
FetchRdBA03 ← RdBA14
DiffAdderTop: LIST OF REF = LIST[
fetchWtAB01,
"WtBA.",
opLength,
pcBus,
fetchRdBA03,
"NotRdBA." ];
DiffAdder: PROC RETURNS [cellType: CellType] = {
cellType ← IFUCoreData.CellProc[
subClass: "GPRow",
type:   "DpAdderSerial",
name:  "DiffAdder",
top:  DiffAdderTop,
in:   "( WtBA. NotRdBA.
(FetchDiffCry.1 FetchDiffCry.2 FetchDiffCry.3 FetchDiffCry.4 GND) )",
out:  "( FetchBytesM1A. NIL
(NIL    FetchDiffCry.1 FetchDiffCry.2 FetchDiffCry.3 FetchDiffCry.4) )",
bot:  DiffLatchBTop,
xform:  xForm ]};
DiffLatchBTop: LIST OF REF = LIST[
fetchWtAB01,
NIL,
opLength,
pcBus,
fetchRdBA03,
"FetchBytesM1A." ];
DiffLatchA: PROC RETURNS [cellType: CellType] = {
cellType ← IFUCoreData.CellProc[
subClass: "GPRow",
type:   "DpLatch",
name:  "DiffLatchA",
top:  DiffLatchBTop,
right:  "(PhA VBB)",
in:   "(FetchBytesM1A.)",
out:  "(FetchBytesM1AB.)",
bot:  DiffLatchABot,
xform:  xForm ]};
DiffLatchABot: LIST OF REF = LIST[
fetchWtAB01,
NIL,
opLength,
pcBus,
fetchRdBA03,
"FetchBytesM1AB." ];
FetchIndexingData: PROC RETURNS[cellType: Core.CellType] = {
name: ROPE ← CoreName.RopeNm["IFUFetchIndexingData"];
IF (cellType ← CoreFrame.ReadFrameCache[name])=NIL THEN {
{
leftRouting: Core.CellType ← CoreGlue.ChanSideCell
[side: left, layer: CCDUtils.cmosMet, list: LIST["GND/25", "VDD/25"] ];
cellType ← CoreFrame.NewFrameCells[
name:  "FetchIndexingMain",
rec:  [first: top, orient: CDOrient.rotate270X], -- adder carry at bottom
cells: LIST[
WtAdder[],
WtMux[],
WtLatchB[],
WtLatchA[],
RdAdder[],
RdMux[],
RdLatchB[],
RdLatchA[],
RdInvert[],
DiffAdder[],
DiffLatchA[] ] ];
cellType ← CoreFrame.NewFrameCells[name: name, rec: [first: top], cells: LIST[
CoreGlue.CellProc[],
cellType,
CoreGlue.CellProc[l: chan, t: conn, r: sum, lCell: leftRouting] ]];
CoreFrame.WriteFrameCache[cellType]} };
} };
FetchIndexing: PUBLIC PROC RETURNS[cellType: Core.CellType] = {
cellType ← CoreFrame.NewFrameCells[name: "FetchIndexXFill", rec: [first: left], cells: LIST[
CoreGlue.CellProc[l: ext, r: conn], FetchIndexingData[] ]] };
FetchControler: PUBLIC PROC [sIn: ROPE, altOut: ROPENIL]
RETURNS [cellType: Core.CellType, sOut: ROPE] = {
name:   ROPE ← CoreName.RopeNm["IFUFetchControler"];
IF (cellType ← CoreFrame.ReadFrameCache[name])=NIL THEN {
{
PLAD:   TYPE = IFUCoreCtl.PLADescriptionRec;
FetchSection: TYPE = {ctl, wt, rd};
plaDscs:  ARRAY FetchSection OF IFUCoreCtl.PLADescription ← [
rd:  NEW[PLAD ← [name: "IFUPLAFetchRdDecode", plaPhs: [BA, B, BAA, B, Ac] ]],
wt: NEW[PLAD ← [name: "IFUPLAFetchWtDecode", plaPhs: [AB, A, ABB, A, Bc] ]],
ctl: NEW[PLAD ← [name: "IFUPLAFetchControl",  plaPhs: [BA, A, AB,  A, AB] ]] ];
pre: NEW[PLAD ← [name: "IFUPLAFetchPreDecode", plaPhs: [AB, A, ABB, A, AB] ]] ];
sOut ← sIn;
FOR p: FetchSection IN FetchSection DO
IF plaDscs[p]=NIL THEN LOOP;
plaDscs[p].inSh ← sOut;
plaDscs[p].plaType ← hot;
IFUCoreCtl.MakePLA1[plaDscs[p]];
IF p=wt THEN {
IFUCoreDrive.AdjustDriveInPhRef[A, plaDscs[p].inDrs, "
FetchingBA
FetchWtAB.0 FetchWtAB.1 "]};
IF p=ctl THEN {
IFUCoreDrive.AdjustDriveInPhRef[A, plaDscs[p].inDrs, "
OpAB.0 OpAB.1 OpAB.2
FetchingBA
FetchBytesM1AB.0
FetchBytesM1AB.1
FetchBytesM1AB.2
FetchBytesM1AB.3
FetchBytesM1AB.4 "];
IFUCoreDrive.AdjustDriveInPhRef[B, plaDscs[p].inDrs, "
NextMacroJumpBA
ResetBA
IPRejectBA
JumpPendingAB
IPFaultedAB
IPFaultingBA "];
IFUCoreDrive.AdjustDriveOutPh[plaDscs[p].outDrs, "
NewFetchBA
FetchWtIndexCtlHoldBA FetchWtIndexCtlIncBA FetchWtIndexCtlClearBA
OpLengthbBA.0 OpLengthbBA.1 OpLengthbBA.2
JumpPendingAB
FetchingBA
IPFaultedAB
InstReadyAB
JumpOffsetBetaAB JumpOffsetAlphaAB JumpOffsetAlphaBetaAB JumpOffsetXaAB
OpLengthAB.0 OpLengthAB.1 OpLengthAB.2
InstFault0BA "] };
IF altOut # NIL AND p=rd THEN {
list: IFUCoreDrive.Drives ← plaDscs[rd].outDrs;
FOR list ← list, list.rest WHILE list.rest#NIL DO ENDLOOP;
plaDscs[rd].outSh ← altOut; -- does this work?
list.first.outSh  ← altOut};
IFUCoreCtl.MakePLA2[plaDscs[p]];
sOut ← plaDscs[p].outSh;
ENDLOOP;
cellType ← CoreFrame.NewFrameCells[
name:  name,
rec:  [first: top],
cells:  LIST[
CoreFrame.NewFrameCells[name: "ExtendedFetchRdCtl", rec: [first: left], cells: LIST[
CoreGlue.CellProc[l: ext, r: conn],
IFUCoreCtl.CellProc[ complete, plaDscs[ rd ]] ]],
CoreFrame.NewFrameCells[name: "ExtendedFetchWtCtl", rec: [first: left], cells: LIST[
CoreGlue.CellProc[l: ext, r: conn],
IFUCoreCtl.CellProc[ complete, plaDscs[ wt ]] ]],
CoreFrame.NewFrameCells[name: "ExtendedFetchCtl",  rec: [first: left], cells: LIST[
CoreGlue.CellProc[l: ext, r: conn],
IFUCoreCtl.CellProc[ complete, plaDscs[ ctl ]] ]] ]];
IFUCoreDrive.SetDShiftIO[cellType, sIn, sOut];
CoreFrame.WriteFrameCache[cellType]};
};
[sIn, sOut] ← IFUCoreDrive.GetDShiftIO[cellType];
cellType ← CoreFrame.NewFrameCells[ name: "FetchControlerFillX", rec: [first: left], cells: LIST[ CoreGlue.CellProc[l: ext, r: conn], cellType ]]};
END.