IFUAsmStatusControl:
CEDAR
PROGRAM
IMPORTS CD, CDFrame, Commander, IFUAsm, IFUPW, IFUPWControl
EXPORTS IFUAsm =
BEGIN
GND: Rope.ROPE = IFUPW.GND;
VDD: Rope.ROPE = IFUPW.VDD;
xBus: LIST OF LIST OF Rope.ROPE = LIST[ LIST["XBus.33", "XBus.35", "XBus.37"]];
keep: LIST OF LIST OF Rope.ROPE = LIST[ LIST["XBus.32", "XBus.34", "XBus.36"]];
statusControlRP:
IFUPW.RowParams ←
NEW[
IFUPW.RowParamsRec ←
[seq: TRUE, rngByte: 1, rngBit: 3]];
SwitchIn: PROC[design: CD.Design] RETURNS[cell: CD.Object] = {
cell ← IFUPW.SwitchBoxRow[
design: design,
name: "IFUAsmStatusControl.SwitchIn",
rowType: IFUPW.cmosMet2,
topRP: statusControlRP,
top: NIL,
left: NIL,
right: LIST[
"NotClearUserModeBA", "NotClearTrapsEnbledBA", "RescheduleBA",
"XBus.32", "XBus.33", "XBus.34", "XBus.35", "XBus.36", "XBus.37"],
bot: SelectFromXBusTop,
botRP: statusControlRP ]};
SelectFromXBusTop:
LIST
OF
REF =
IFUPW.LISTn[
xBus,
keep,
NIL,
NIL,
NIL,
LIST["NotClearUserModeBA", "NotClearTrapsEnbledBA", "RescheduleBA"] ];
SelectFromXBus:
PROC[design:
CD.Design]
RETURNS[cell:
CD.Object] = {
cell ←
IFUPW.IFUGPCellRow[
design: design,
name: "IFUAsmStatusControl.SelectFromXBus",
type: IFUPW.LISTn["GPSelect"],
top: SelectFromXBusTop,
in:
LIST[
keep,
LIST["UserMode0BA", "TrapsEnbled0BA", "RschWaiting0BA"],
xBus ],
out: LIST[LIST["SeltdUserMode", "SeltdTrapsEnbled", "SeltdRschWaiting"]],
bot: Mux0ATop,
rp: statusControlRP ]};
Mux0ATop:
LIST
OF
REF =
IFUPW.LISTn[
xBus,
keep,
NIL,
LIST["SeltdUserMode", "SeltdTrapsEnbled", "SeltdRschWaiting"],
LIST["UserMode0BA", "TrapsEnbled0BA", "RschWaiting0BA"],
LIST["NotClearUserModeBA", "NotClearTrapsEnbledBA", "RescheduleBA"] ];
Mux0A:
PROC[design:
CD.Design]
RETURNS[cell:
CD.Object] = {
cell ←
IFUPW.IFUMuxRow[
design: design,
name: "IFUAsmStatusControl.Mux0A",
top: Mux0ATop,
rightCtl: LIST["SetStatusFrom3LevBA", "ResetBA", "HoldStatusBA", "X1ADstStatusBA"],
in:
LIST[
LIST["UserMode3BA", "TrapsEnbled3BA", "RschWaiting0BA"],
GND,
LIST["UserMode0BA", "TrapsEnbled0BA", "RschWaiting0BA"],
LIST["SeltdUserMode", "SeltdTrapsEnbled", "SeltdRschWaiting"]],
out: LIST[LIST["UserMode0A", "TrapsEnbled0A", "RschWaiting0A"]],
bot: Latch0ATop,
rp: statusControlRP ]};
Latch0ATop:
LIST
OF
REF =
IFUPW.LISTn[
xBus,
keep,
LIST["UserMode0A", "TrapsEnbled0A", "RschWaiting0A"],
LIST["UserMode3BA", "TrapsEnbled3BA"],
LIST["UserMode0BA", "TrapsEnbled0BA", "RschWaiting0BA"],
LIST["NotClearUserModeBA", "NotClearTrapsEnbledBA", "RescheduleBA"]];
Latch0A:
PROC[design:
CD.Design]
RETURNS[cell:
CD.Object] = {
cell ←
IFUPW.IFUGPCellRow[
design: design,
name: "IFUAsmStatusControl.Latch0A",
type: IFUPW.LISTn["GPLatch"],
top: Latch0ATop,
leftCtl: LIST["PhA", "VBB"],
in: LIST[LIST["UserMode0A", "TrapsEnbled0A", "RschWaiting0A"]],
out: LIST[LIST["UserMode0AB", "TrapsEnbled0AB", "RschWaiting0AB"]],
bot: InsertNew0BTop,
rp: statusControlRP ]};
InsertNew0BTop:
LIST
OF
REF =
IFUPW.LISTn[
xBus,
keep,
LIST["UserMode0AB", "TrapsEnbled0AB", "RschWaiting0AB"],
LIST["UserMode3BA", "TrapsEnbled3BA"],
LIST["UserMode0BA", "TrapsEnbled0BA", "RschWaiting0BA"],
LIST["NotClearUserModeBA", "NotClearTrapsEnbledBA", "RescheduleBA"]];
InsertNew0B:
PROC[design:
CD.Design]
RETURNS[cell:
CD.Object] = {
cell ←
IFUPW.IFUGPCellRow[
design: design,
name: "IFUAsmStatusControl.InsertNew0B",
type: IFUPW.LISTn[LIST["GPAnd", "GPAnd", "GPOr"]],
top: InsertNew0BTop,
in:
LIST[
LIST["UserMode0AB", "TrapsEnbled0AB", "RschWaiting0AB"],
LIST["NotClearUserModeBA", "NotClearTrapsEnbledBA", "RescheduleBA"]],
out: LIST[LIST["UserMode0B", "TrapsEnbled0B", "RschWaiting0B"]],
bot: Latch0BTop,
rp: statusControlRP ]};
Latch0BTop:
LIST
OF
REF =
IFUPW.LISTn[
xBus,
keep,
LIST["UserMode0B", "TrapsEnbled0B", "RschWaiting0B"],
LIST["UserMode3BA", "TrapsEnbled3BA"],
LIST["UserMode0BA", "TrapsEnbled0BA", "RschWaiting0BA"],
LIST["NotClearUserModeBA", "NotClearTrapsEnbledBA", "RescheduleBA"]];
Latch0B:
PROC[design:
CD.Design]
RETURNS[cell:
CD.Object] = {
cell ←
IFUPW.IFUGPCellRow[
design: design,
name: "IFUAsmStatusControl.Latch0B",
type: IFUPW.LISTn["GPLatch"],
top: Latch0BTop,
leftCtl: LIST["PhB", "VBB"],
in: LIST[LIST["UserMode0B", "TrapsEnbled0B", "RschWaiting0B"]],
out: LIST[LIST["UserMode0BA", "TrapsEnbled0BA", "RschWaiting0BA"]],
bot: XBusDrTop,
rp: statusControlRP ]};
XBusDrTop:
LIST
OF
REF =
IFUPW.LISTn[
xBus,
keep,
NIL,
LIST["UserMode3BA", "TrapsEnbled3BA"],
LIST["UserMode0BA", "TrapsEnbled0BA", "RschWaiting0BA"],
LIST["NotClearUserModeBA", "NotClearTrapsEnbledBA", "RescheduleBA"]];
XBusDr:
PROC[design:
CD.Design]
RETURNS[cell:
CD.Object] = {
cell ←
IFUPW.IFUGPCellRow[
design: design,
name: "IFUAsmStatusControl.XBusDr",
type: IFUPW.LISTn["GPTriDr"],
top: XBusDrTop,
rightCtl: LIST["X1ASrcStatusAc", "NotX1ASrcStatusAc"],
in: LIST[LIST["UserMode0BA", "TrapsEnbled0BA", "RschWaiting0BA"]],
out: LIST[xBus],
bot: KeepDrTop,
rp: statusControlRP ]};
KeepDrTop:
LIST
OF
REF =
IFUPW.LISTn[
xBus,
keep,
NIL,
LIST["UserMode3BA", "TrapsEnbled3BA"],
LIST["UserMode0BA", "TrapsEnbled0BA", "RschWaiting0BA"],
LIST["NotClearUserModeBA", "NotClearTrapsEnbledBA", "RescheduleBA"]];
KeepDr:
PROC[design:
CD.Design]
RETURNS[cell:
CD.Object] = {
cell ←
IFUPW.IFUGPCellRow[
design: design,
name: "IFUAsmStatusControl.KeepDr",
type: IFUPW.LISTn["GPTriDr"],
top: KeepDrTop,
rightCtl: LIST["X1ASrcStatusAc", "NotX1ASrcStatusAc"],
in: LIST[GND],
out: LIST[keep],
bot: Latch1ATop,
rp: statusControlRP ]};
Latch1ATop:
LIST
OF
REF =
IFUPW.LISTn[
xBus,
keep,
NIL,
LIST["UserMode3BA", "TrapsEnbled3BA"],
LIST["UserMode0BA", "TrapsEnbled0BA"],
LIST["NotClearUserModeBA", "NotClearTrapsEnbledBA", "RescheduleBA"]];
Latch1A:
PROC[design:
CD.Design]
RETURNS[cell:
CD.Object] = {
cell ←
IFUPW.IFUGPCellRow[
design: design,
name: "IFUAsmStatusControl.Latch1A",
type: IFUPW.LISTn["GPLatch"],
top: Latch1ATop,
leftCtl: LIST["LoadStage1Ac", "VBB"],
in: LIST[LIST["UserMode0BA", "TrapsEnbled0BA"]],
out: LIST[LIST["UserMode1AB", "TrapsEnbled1AB"]],
bot: Latch1BTop,
rp: statusControlRP ]};
Latch1BTop:
LIST
OF
REF =
IFUPW.LISTn[
xBus,
keep,
NIL,
LIST["UserMode3BA", "TrapsEnbled3BA"],
LIST["UserMode1AB", "TrapsEnbled1AB"],
LIST["NotClearUserModeBA", "NotClearTrapsEnbledBA", "RescheduleBA"]];
Latch1B:
PROC[design:
CD.Design]
RETURNS[cell:
CD.Object] = {
cell ←
IFUPW.IFUGPCellRow[
design: design,
name: "IFUAsmStatusControl.Latch1B",
type: IFUPW.LISTn["GPLatch"],
top: Latch1BTop,
leftCtl: LIST["LoadStage1Bc", "VBB"],
in: LIST[LIST["UserMode1AB", "TrapsEnbled1AB"]],
out: LIST[LIST["UserMode1BA", "TrapsEnbled1BA"]],
bot: PassBoxTop,
rp: statusControlRP ]};
PassBoxTop:
LIST
OF
REF =
IFUPW.LISTn[
xBus,
keep,
NIL,
LIST["UserMode3BA", "TrapsEnbled3BA"],
LIST["UserMode1BA", "TrapsEnbled1BA"],
LIST["NotClearUserModeBA", "NotClearTrapsEnbledBA", "RescheduleBA"]];
PassBox:
PROC[design:
CD.Design]
RETURNS[cell:
CD.Object] = {
cell ←
IFUPW.SwitchBoxRow[
design: design,
name: "IFUAsmStatusControl.PassBox",
rowType: IFUPW.cmosMet2,
topRP: statusControlRP,
top: PassBoxTop,
left: LIST["NotDrShData", "DrShA", "DrShB", "DrShWt", "DrShRd", "DrA", "DrB"],
right: LIST["NotDrShData", "DrShA", "DrShB", "DrShWt", "DrShRd", "DrA", "DrB"],
bot: Latch2ATop,
botRP: statusControlRP ]};
Latch2ATop:
LIST
OF
REF =
IFUPW.LISTn[
xBus,
keep,
NIL,
LIST["UserMode3BA", "TrapsEnbled3BA"],
LIST["UserMode1BA", "TrapsEnbled1BA"],
LIST["NotClearUserModeBA", "NotClearTrapsEnbledBA", "RescheduleBA"]];
Latch2A:
PROC[design:
CD.Design]
RETURNS[cell:
CD.Object] = {
cell ←
IFUPW.IFUGPCellRow[
design: design,
name: "IFUAsmStatusControl.Latch2A",
type: IFUPW.LISTn["GPLatch"],
top: Latch2ATop,
leftCtl: LIST["LoadStage2Ac", "VBB"],
in: LIST[LIST["UserMode1BA", "TrapsEnbled1BA"]],
out: LIST[LIST["UserMode2AB", "TrapsEnbled2AB"]],
bot: Latch2BTop,
rp: statusControlRP ]};
Latch2BTop:
LIST
OF
REF =
IFUPW.LISTn[
xBus,
keep,
NIL,
LIST["UserMode3BA", "TrapsEnbled3BA"],
LIST["UserMode2AB", "TrapsEnbled2AB"],
LIST["NotClearUserModeBA", "NotClearTrapsEnbledBA", "RescheduleBA"]];
Latch2B:
PROC[design:
CD.Design]
RETURNS[cell:
CD.Object] = {
cell ←
IFUPW.IFUGPCellRow[
design: design,
name: "IFUAsmStatusControl.Latch2B",
type: IFUPW.LISTn["GPLatch"],
top: Latch2BTop,
leftCtl: LIST["LoadStage2Bc", "VBB"],
in: LIST[LIST["UserMode2AB", "TrapsEnbled2AB"]],
out: LIST[LIST["UserMode2BA", "TrapsEnbled2BA"]],
bot: Latch3ATop,
rp: statusControlRP ]};
Latch3ATop:
LIST
OF
REF =
IFUPW.LISTn[
xBus,
keep,
NIL,
LIST["UserMode3BA", "TrapsEnbled3BA"],
LIST["UserMode2BA", "TrapsEnbled2BA"],
LIST["NotClearUserModeBA", "NotClearTrapsEnbledBA", "RescheduleBA"]];
Latch3A:
PROC[design:
CD.Design]
RETURNS[cell:
CD.Object] = {
cell ←
IFUPW.IFUGPCellRow[
design: design,
name: "IFUAsmStatusControl.Latch3A",
type: IFUPW.LISTn["GPLatch"],
top: Latch3ATop,
leftCtl: LIST["LoadStage3Ac", "VBB"],
in: LIST[LIST["UserMode2BA", "TrapsEnbled2BA"]],
out: LIST[LIST["UserMode3AB", "TrapsEnbled3AB"]],
bot: Latch3BTop,
rp: statusControlRP ]};
Latch3BTop:
LIST
OF
REF =
IFUPW.LISTn[
xBus,
keep,
NIL,
LIST["UserMode3BA", "TrapsEnbled3BA"],
LIST["UserMode3AB", "TrapsEnbled3AB"],
LIST["NotClearUserModeBA", "NotClearTrapsEnbledBA", "RescheduleBA"]];
Latch3B:
PROC[design:
CD.Design]
RETURNS[cell:
CD.Object] = {
cell ←
IFUPW.IFUGPCellRow[
design: design,
name: "IFUAsmStatusControl.Latch3B",
type: IFUPW.LISTn["GPLatch"],
top: Latch3BTop,
leftCtl: LIST["PhB", "VBB"],
in: LIST[LIST["UserMode3AB", "TrapsEnbled3AB"]],
out: LIST[LIST["UserMode3BA", "TrapsEnbled3BA"]],
bot: StatusBot,
rp: statusControlRP ]};
StatusBot:
LIST
OF
REF =
IFUPW.LISTn[
xBus,
keep,
NIL,
NIL,
NIL,
LIST["NotClearUserModeBA", "NotClearTrapsEnbledBA", "RescheduleBA"] ];
StatusControlSBProc: CDFrame.ExpandProc = {
driver: CD.Object ← IFUPWControl.DriverCell[static, header, NIL, NIL];
glue: REF CDFrame.GlueSpec;
new ← CDFrame.Glue[l: conn, r: ext, b: conn, t: ext];
new.shell.size.x ← CD.InterestSize[driver].x;
glue ← NARROW[new.data];
glue.obj[bottom] ← driver};
StatusControlSB:
IFUPW.Frame ←
CDFrame.NewExpandFrame["IFUAsmStatusControlSB", StatusControlSBProc];
module: Rope.ROPE ← "IFUAsmStatusControl";
StatusControlData:
IFUPW.Frame ←
IFUPW.
NFSFUP[module, y,
LIST[
SwitchIn,
SelectFromXBus,
Mux0A,
Latch0A,
InsertNew0B,
Latch0B,
XBusDr,
KeepDr,
Latch1A,
Latch1B,
PassBox,
Latch2A,
Latch2B,
Latch3A,
Latch3B ],
CDOrient.rotate90 ];
StatusControl:
PUBLIC
IFUPW.Frame ←
IFUPW.
NFS["StatusFillx", x,
LIST[
CDFrame.Glue[l: ext, r: conn],
IFUPW.
NFS["Status", y,
LIST[
IFUPWControl.DriverFill[],
CDFrame.Glue[b: conn, t: conn, r:diff],
StatusControlData,
CDFrame.Glue[b: conn, t: conn, r:diff],
IFUPWControl.DriverFill[] ]] ]];
StatusControlCT: Commander.CommandProc =
{IFUPW.AssembleFrame[IFUAsm.RefDesign[], StatusControl, cmd ] };
Commander.Register [proc: StatusControlCT, key: module];
END.