IFUAsmControlPipe.mesa
Copyright c 1985 by Xerox Corporation. All rights reserved.
Last Edited by June 16, 1985 2:46:14 pm PDT
DIRECTORY
CD,
Commander,
IFUAsm,
IFUPW,
Rope;
IFUAsmControlPipe: CEDAR PROGRAM
IMPORTS Commander, IFUAsm, IFUPW, Rope =
BEGIN
GND: Rope.ROPE = IFUPW.GND;
VDD: Rope.ROPE = IFUPW.VDD;
cpSeq: BOOL ← IFUAsm.cpSequential;
ExtraIn1A: IFUPW.List = LIST[
"EUAluLeftSrc.0", "EUAluLeftSrc.1",
"EUAluRightSrc.0", "EUAluRightSrc.1",
"EUStore2ASrc.0", "EUStore2ASrc.1"];
ExtraOut1B: IFUPW.List = LIST[
"EUAluLeftSrc.0", "EUAluLeftSrc.1",
"EUAluRightSrc.0", "EUAluRightSrc.1",
"EUStore2ASrc.0", "EUStore2ASrc.1"];
In0B: IFUPW.List = LIST[
"Push",
"Pop",
"EPCmnd.0", "EPCmnd.1", "EPCmnd.2", "EPCmnd.3",
"DrXa2Lev",
"DrXa3Lev",
"FPCSUnAlu",
"FPCSUnMult",
"FPCheckStatus",
"FPCSLdAlu",
"FPCSLdMult",
"EUAluOp.0", "EUAluOp.1", "EUAluOp.2", "EUAluOp.3", "EUAluOp.4",
"EUCondSel.0", "EUCondSel.1", "EUCondSel.2", "EUCondSel.3",
"EUCondEffect.0", "EUCondEffect.1",
"EUCheckParity",
"EUWriteToPBus"];
In1A: IFUPW.List = LIST[
"EUSt3AisCBus",
"EURes3AisCBus",
"EURes3BisPBus"];
FullWd: IFUPW.List = CatList[In0B, In1A];
Out1B: IFUPW.List = LIST[
"Push",
"Pop",
"EPCmnd.1",
"DrXa2Lev"];
Out2A: IFUPW.List = LIST[
"EUAluOp.0", "EUAluOp.1", "EUAluOp.2", "EUAluOp.3", "EUAluOp.4",
"EUCondSel.0", "EUCondSel.1", "EUCondSel.2", "EUCondSel.3",
"FPCSUnAlu",
"FPCSUnMult"];
Out2B: IFUPW.List = LIST[
"Push",
"Pop",
"EPCmnd.1",
"EUSt3AisCBus",
"EURes3AisCBus",
"EUCondEffect.0", "EUCondEffect.1",
"DrXa3Lev"];
Out3A: IFUPW.List = LIST[
"EUCheckParity",
"EUWriteToPBus",
"EURes3BisPBus",
"FPCheckStatus",
"FPCSLdAlu",
"FPCSLdMult"];
Out3B: IFUPW.List = LIST[
"Push",
"Pop"];
CPx1ABWd:  LIST OF REF = Partition[cpSeq, AddRopeToRoot[ExtraIn1A, "1AB"]];
CPx1ABxWd:  LIST OF REF = Partition[cpSeq, AddRopeToRoot[ExtraIn1A, "1ABx"]];
CPx1BAWd:  LIST OF REF = Partition[cpSeq, AddRopeToRoot[ExtraIn1A, "1BA"]];
CP0BIn0BWd: LIST OF REF = Partition[cpSeq, AddRopeToRoot[In0B, "0BA"]];
CP0BIn1AWd: LIST OF REF = Partition[cpSeq, AddRopeToRoot[In0B, "1AB"]];
CP1ABWd:  LIST OF REF = Partition[cpSeq, AddRopeToRoot[FullWd, "1AB"]];
CP1ABxWd:  LIST OF REF = Partition[cpSeq, AddRopeToRoot[FullWd, "1ABx"]];
CP1BAWd:  LIST OF REF = Partition[cpSeq, AddRopeToRoot[FullWd, "1BA"]];
CP1BAxWd:  LIST OF REF = Partition[cpSeq, AddRopeToRoot[FullWd, "1BAx"]];
CP2ABWd:  LIST OF REF = Partition[cpSeq, AddRopeToRoot[FullWd, "2AB"]];
CP2BAWd:  LIST OF REF = Partition[cpSeq, AddRopeToRoot[FullWd, "2BA"]];
CP2BAxWd:  LIST OF REF = Partition[cpSeq, AddRopeToRoot[FullWd, "2BAx"]];
CP3ABWd:  LIST OF REF = Partition[cpSeq, AddRopeToRoot[FullWd, "3AB"]];
CP3BAWd:  LIST OF REF = Partition[cpSeq, AddRopeToRoot[FullWd, "3BA"]];
CPxSwitchIn1A: PROC[design: CD.Design] RETURNS[cell: IFUPW.ObjName] = {
cell ← IFUPW.SwitchBoxRow[
design: design,
name:  "CPxSwitchIn1A",
rowType: IFUPW.cmosMet2,
topSeq: cpSeq,
top:  LIST["XBus."],
left:  AddRopeToRoot[ExtraIn1A, "1AB"],
right:  NIL,
bot:  LIST["XBus.", CPx1ABWd],
botSeq: cpSeq,
fixGV: TRUE ]};
CPxMux1AB: PROC[design: CD.Design] RETURNS[cell: IFUPW.ObjName] = {
cell ← IFUPW.IFUMuxRow[
design: design,
name:  "CPxMux1AB",
top:  LIST["XBus.", CPx1ABWd],
ctl:  LIST["PipeCycle123AB", "PipeKill1AB", "PipeAdv1AB"],
in:   LIST[CPx1BAWd, GND, CPx1ABWd],
out:  LIST[CPx1ABxWd],
bot:  LIST["XBus.", CPx1BAWd, CPx1ABxWd],
seq:  cpSeq,
fixGV: TRUE ]};
CPxLatch1B: PROC[design: CD.Design] RETURNS[cell: IFUPW.ObjName] = {
cell ← IFUPW.IFUGPCellRow[
design: design,
name:  "CPxLatch1B",
type:   IFUPW.LISTn["GPLatch"],
ctl:  LIST["PhB"],
top:  LIST["XBus.", CPx1BAWd, CPx1ABxWd],
in:   LIST[CPx1ABxWd],
out:  LIST[CPx1BAWd],
bot:  LIST["XBus.", CPx1BAWd],
seq:  cpSeq ]};
CPxSwitchOut1B: PROC[design: CD.Design] RETURNS[cell: IFUPW.ObjName] = {
cell ← IFUPW.SwitchBoxRow[
design: design,
name:  "CPxSwitchOut1B",
rowType: IFUPW.cmosMet2,
topSeq: cpSeq,
top:  LIST["XBus.", CPx1BAWd],
left:  AddRopeToRoot[ExtraOut1B, "1BA"],
right:  NIL,
bot:  LIST["XBus."],
botSeq: cpSeq,
fixGV: TRUE ]};
CPSwitchIn0B: PROC[design: CD.Design] RETURNS[cell: IFUPW.ObjName] = {
cell ← IFUPW.SwitchBoxRow[
design: design,
name:  "CPSwitchIn0B",
rowType: IFUPW.cmosMet2,
topSeq: cpSeq,
top:  LIST["XBus."],
left:  AddRopeToRoot[In0B, "0BA"],
right:  NIL,
bot:  LIST["XBus.", CP0BIn0BWd],
botSeq: cpSeq,
fixGV: TRUE ]};
CPLatch1A: PROC[design: CD.Design] RETURNS[cell: IFUPW.ObjName] = {
cell ← IFUPW.IFUGPCellRow[
design: design,
name:  "CPLatch1A",
type:   IFUPW.LISTn["GPLatch"],
ctl:  LIST["PhA"],
top:  LIST["XBus.", CP0BIn0BWd],
in:   LIST[CP0BIn0BWd],
out:  LIST[CP0BIn1AWd],
bot:  LIST["XBus.", CP0BIn1AWd],
seq:  cpSeq ]};
CPSwitchIn1A: PROC[design: CD.Design] RETURNS[cell: IFUPW.ObjName] = {
cell ← IFUPW.SwitchBoxRow[
design: design,
name:  "CPSwitchIn1A",
rowType: IFUPW.cmosMet2,
topSeq: cpSeq,
top:  LIST["XBus.", CP0BIn1AWd],
left:  AddRopeToRoot[In1A, "1AB"],
right:  NIL,
bot:  LIST["XBus.", CP1ABWd],
botSeq: cpSeq,
fixGV: TRUE ]};
CPMux1AB: PROC[design: CD.Design] RETURNS[cell: IFUPW.ObjName] = {
cell ← IFUPW.IFUMuxRow[
design: design,
name:  "CPMux1AB",
top:  LIST["XBus.", CP1ABWd],
ctl:  LIST["PipeCycle123AB", "PipeKill1AB", "PipeAdv1AB"],
in:   LIST[CP1BAWd, GND, CP1ABWd],
out:  LIST[CP1ABxWd],
bot:  LIST["XBus.", CP1BAWd, CP1ABxWd],
seq:  cpSeq,
fixGV: TRUE ]};
CPLatch1B: PROC[design: CD.Design] RETURNS[cell: IFUPW.ObjName] = {
cell ← IFUPW.IFUGPCellRow[
design: design,
name:  "CPLatch1B",
type:   IFUPW.LISTn["GPLatch"],
ctl:  LIST["PhB"],
top:  LIST["XBus.", CP1BAWd, CP1ABxWd],
in:   LIST[CP1ABxWd],
out:  LIST[CP1BAWd],
bot:  LIST["XBus.", CP1BAWd],
seq:  cpSeq ]};
CPSwitchOut1B: PROC[design: CD.Design] RETURNS[cell: IFUPW.ObjName] = {
cell ← IFUPW.SwitchBoxRow[
design: design,
name:  "CPSwitchOut1B",
rowType: IFUPW.cmosMet2,
topSeq: cpSeq,
top:  LIST["XBus.", CP1BAWd],
left:  AddRopeToRoot[Out1B, "1BA"],
right:  NIL,
bot:  LIST["XBus.", CP1BAWd],
botSeq: cpSeq,
fixGV: TRUE ]};
CPMux1BA: PROC[design: CD.Design] RETURNS[cell: IFUPW.ObjName] = {
cell ← IFUPW.IFUMuxRow[
design: design,
name:  "CPMux1BA",
top:  LIST["XBus.", CP1BAWd],
ctl:  LIST["PipeCycle123AB", "PipeKill2AB", "PipeAdv2AB"],
in:   LIST[CP2BAWd, GND, CP1BAWd],
out:  LIST[CP1BAxWd],
bot:  LIST["XBus.", CP2BAWd, CP1BAxWd],
seq:  cpSeq,
fixGV: TRUE ]};
CPLatch2A: PROC[design: CD.Design] RETURNS[cell: IFUPW.ObjName] = {
cell ← IFUPW.IFUGPCellRow[
design: design,
name:  "CPLatch2A",
type:   IFUPW.LISTn["GPLatch"],
ctl:  LIST["PhA"],
top:  LIST["XBus.", CP2BAWd, CP1BAxWd],
in:   LIST[CP1BAxWd],
out:  LIST[CP2ABWd],
bot:  LIST["XBus.", CP2BAWd, CP2ABWd],
seq:  cpSeq ]};
CPSwitchOut2A: PROC[design: CD.Design] RETURNS[cell: IFUPW.ObjName] = {
cell ← IFUPW.SwitchBoxRow[
design: design,
name:  "CPSwitchOut2A",
rowType: IFUPW.cmosMet2,
topSeq: cpSeq,
top:  LIST["XBus.", CP2BAWd, CP2ABWd],
left:  AddRopeToRoot[Out2A, "2AB"],
right:  NIL,
bot:  LIST["XBus.", CP2BAWd, CP2ABWd],
botSeq: cpSeq,
fixGV: TRUE ]};
CPLatch2B: PROC[design: CD.Design] RETURNS[cell: IFUPW.ObjName] = {
cell ← IFUPW.IFUGPCellRow[
design: design,
name:  "CPLatch2B",
type:   IFUPW.LISTn["GPLatch"],
ctl:  LIST["PhA"],
top:  LIST["XBus.", CP2BAWd, CP2ABWd],
in:   LIST[CP2ABWd],
out:  LIST[CP2BAWd],
bot:  LIST["XBus.", CP2BAWd],
seq:  cpSeq ]};
CPSwitchOut2B: PROC[design: CD.Design] RETURNS[cell: IFUPW.ObjName] = {
cell ← IFUPW.SwitchBoxRow[
design: design,
name:  "CPSwitchOut2B",
rowType: IFUPW.cmosMet2,
topSeq: cpSeq,
top:  LIST["XBus.", CP2BAWd],
left:  AddRopeToRoot[Out2B, "2BA"],
right:  NIL,
bot:  LIST["XBus.", CP2BAWd],
botSeq: cpSeq,
fixGV: TRUE ]};
CPMux3A: PROC[design: CD.Design] RETURNS[cell: IFUPW.ObjName] = {
cell ← IFUPW.IFUMuxRow[
design: design,
name:  "CPMux3A",
top:  LIST["XBus.", CP2BAWd],
ctl:  LIST["PipeCycle123AB", "PipeCCTrapAB", "PipeFault3AB", "PipeAdv3AB"],
in:   LIST[CP3BAWd, GND, GND, CP2BAWd],
out:  LIST[CP2BAxWd],
bot:  LIST["XBus.", CP3BAWd, CP2BAxWd],
seq:  cpSeq,
fixGV: TRUE ]};
CPLatch3A: PROC[design: CD.Design] RETURNS[cell: IFUPW.ObjName] = {
cell ← IFUPW.IFUGPCellRow[
design: design,
name:  "CPLatch3A",
type:   IFUPW.LISTn["GPLatch"],
ctl:  LIST["PhA"],
top:  LIST["XBus.", CP3BAWd, CP2BAxWd],
in:   LIST[CP2BAxWd],
out:  LIST[CP3ABWd],
bot:  LIST["XBus.", CP3BAWd, CP3ABWd],
seq:  cpSeq ]};
CPSwitchOut3A: PROC[design: CD.Design] RETURNS[cell: IFUPW.ObjName] = {
cell ← IFUPW.SwitchBoxRow[
design: design,
name:  "CPSwitchOut3A",
rowType: IFUPW.cmosMet2,
topSeq: cpSeq,
top:  LIST["XBus.", CP3BAWd, CP3ABWd],
left:  AddRopeToRoot[Out3A, "3AB"],
right:  NIL,
bot:  LIST["XBus.", CP3BAWd, CP3ABWd],
botSeq: cpSeq,
fixGV: TRUE ]};
CPLatch3B: PROC[design: CD.Design] RETURNS[cell: IFUPW.ObjName] = {
cell ← IFUPW.IFUGPCellRow[
design: design,
name:  "CPLatch3B",
type:   IFUPW.LISTn["GPLatch"],
top:  LIST["XBus.", CP3BAWd, CP3ABWd],
ctl:  LIST["PhA"],
in:   LIST[CP3ABWd],
out:  LIST[CP3BAWd],
bot:  LIST["XBus.", CP3BAWd],
seq:  cpSeq ]};
CPSwitchOut3B: PROC[design: CD.Design] RETURNS[cell: IFUPW.ObjName] = {
cell ← IFUPW.SwitchBoxRow[
design: design,
name:  "CPSwitchOut3B",
rowType: IFUPW.cmosMet2,
topSeq: cpSeq,
top:  LIST["XBus.", CP3BAWd],
left:  AddRopeToRoot[Out3B, "3BA"],
right:  NIL,
bot:  LIST["XBus.", CP3BAWd],
botSeq: cpSeq,
fixGV: TRUE ]};
AddRopeToRoot: PROC[list: IFUPW.List, rope: Rope.ROPE]
RETURNS[new: IFUPW.List] = {
index: INT;
root, ext: Rope.ROPENIL;
IF list = NIL THEN RETURN[NIL];
new ← AddRopeToRoot[list.rest, rope];
index ← Rope.Index[list.first, 0, "."];
root ← Rope.Substr[list.first, 0, index];
ext ← Rope.Substr[list.first, index];
new ← CONS[ Rope.Cat[root, rope, ext], new]};
Partition: PROC[seq: BOOL, list: IFUPW.List] RETURNS[new: LIST OF REF] = {
byteList: ARRAY [0..4) OF LIST OF REF; -- IFUPW.rngByte
new ← NIL;
FOR ii: INT DECREASING IN [0..IFUPW.rngByte*IFUPW.rngBit) DO
index:  INT ← IF seq THEN ii MODIFUPW.rngBit ELSE ii / IFUPW.rngByte;
byte:  INT ← IF seq THEN ii / IFUPW.rngBit ELSE ii MODIFUPW.rngByte;
byteList[byte] ← CONS[ IFUPW.ListIndexItem[list, ii], byteList[byte]] ENDLOOP;
FOR byte: INT DECREASING IN [0..IFUPW.rngByte)
DO new ← CONS[byteList[byte], new] ENDLOOP };
CatList: PROC[list1, list2: IFUPW.List] RETURNS[new: IFUPW.List] = {
IF list1=NIL THEN RETURN[list2];
new ← CatList[list1.rest, list2];
new ← CONS[list1.first, new] };
newDesign:  Rope.ROPE ← IFUAsm.rootName.Cat["ControlPipe"];
dataColRows:  LIST OF IFUPW.UserProc ← LIST[
CPxSwitchIn1A,
CPxMux1AB,
CPxLatch1B,
CPxSwitchOut1B,
CPSwitchIn0B,
CPLatch1A,
CPSwitchIn1A,
CPMux1AB,
CPLatch1B,
CPSwitchOut1B,
CPMux1BA,
CPLatch2A,
CPSwitchOut2A,
CPLatch2B,
CPSwitchOut2B,
CPMux3A,
CPLatch3A,
CPSwitchOut3A,
CPLatch3B,
CPSwitchOut3B ];
CDAssemble: IFUPW.UserProc=
{RETURN[IFUPW.AssembleList[design,   dataColRows]]};
CTAssemble: Commander.CommandProc =
{[ ] ← IFUPW.AssembleList[IFUAsm.refDesign, dataColRows, newDesign, cmd]};
IFUAsm.RegDataColRows [procs:  dataColRows, name: newDesign.Cat["Cell"]];
Commander.Register   [proc:   CTAssemble, key: newDesign.Cat["Cell"]];
IFUPW.Register     [userProc: CDAssemble, name: newDesign.Cat["Cell"]];
END.