IFUPLAIFetchPreDecode.mesa
Copyright c 1984 by Xerox Corporation. All rights reserved.
Last edited by Curry, November 21, 1984 9:06:52 am PST
DIRECTORY
Commander,
Dragon,
DragOpsCross,
IFUPLA,
IO,
PLAOps;
IFUPLAIFetchPreDecode:
CEDAR
PROGRAM
IMPORTS Commander, IO, PLAOps EXPORTS IFUPLA =
BEGIN OPEN IFUPLA, PO: PLAOps;
GenIFetchPreDecodePLA:
PUBLIC
PROC = {
iBit0: DragOpsCross.Inst ← LOOPHOLE[200B];
iBit1: DragOpsCross.Inst ← LOOPHOLE[100B];
iBit2: DragOpsCross.Inst ← LOOPHOLE[040B];
op0: PO.BoolExpr ← BE[m:[preOp: iBit0], d:[preOp: iBit0 ]];
op1: PO.BoolExpr ← BE[m:[preOp: iBit1], d:[preOp: iBit1 ]];
op2: PO.BoolExpr ← BE[m:[preOp: iBit2], d:[preOp: iBit2 ]];
atLeast1: PO.BoolExpr ← BE[m:[atLeast1: TRUE], d:[atLeast1: TRUE ]];
atLeast2: PO.BoolExpr ← BE[m:[atLeast2: TRUE], d:[atLeast2: TRUE ]];
atLeast3: PO.BoolExpr ← BE[m:[atLeast3: TRUE], d:[atLeast3: TRUE ]];
atLeast5: PO.BoolExpr ← BE[m:[atLeast5: TRUE], d:[atLeast5: TRUE ]];
Set[out:[instNotReady:
TRUE],
s:
PO.Or[
PO.And[PO.Not[op0], PO.Not[op1], op2, PO.Not[atLeast5]],
PO.And[PO.Not[op0], PO.Not[op1], PO.Not[op2], PO.Not[atLeast1]],
PO.And[PO.Not[op0], op1, PO.Not[atLeast1]],
PO.And[ op0, PO.Not[op1], PO.Not[atLeast2]],
PO.And[ op0, op1, PO.Not[atLeast3]] ] ];
Set[out:[opLength: 5], s:PO.And[PO.Not[op0], PO.Not[op1], op2 ] ];
Set[out:[opLength: 1], s:PO.And[PO.Not[op0], PO.Not[op1], PO.Not[op2] ] ];
Set[out:[opLength: 1], s:PO.And[PO.Not[op0], op1 ] ];
Set[out:[opLength: 2], s:PO.And[ op0, PO.Not[op1] ] ];
Set[out:[opLength: 3], s:PO.And[ op0, op1 ] ];
BE:
PROC [m, d: IFetchPreDecodeIn]
RETURNS[
PO.BoolExpr] = {
mRef: REF IFetchPreDecodeIn ← NARROW[IFetchPreDecodePLA.mask];
dRef: REF IFetchPreDecodeIn ← NARROW[IFetchPreDecodePLA.data];
mRef^ ← m; dRef^ ← d; RETURN[PO.GetBEForDataMask[IFetchPreDecodePLA]]};
Set:
PROC [s:
PO.BoolExpr ←
NIL, m, d: IFetchPreDecodeIn ← [ ], out: IFetchPreDecodeOut] = {
res: REF IFetchPreDecodeOut ← NARROW[IFetchPreDecodePLA.out];
IF s=
NIL
THEN s ← BE[m,d]
ELSE s ← PO.And[s, BE[m,d] ];
res^ ← out; PO.SetOutForBE[IFetchPreDecodePLA, s]};
IFetchPreDecodeProc:
PUBLIC
PROC[argRec: IFetchPreDecodeIn]
RETURNS[resRec: IFetchPreDecodeOut] = {
arg: REF IFetchPreDecodeIn ← NARROW[IFetchPreDecodePLA.data];
res: REF IFetchPreDecodeOut ← NARROW[IFetchPreDecodePLA.out];
arg^ ← argRec; PO.GetOutForData[IFetchPreDecodePLA]; resRec ← res^};
IFetchPreDecodePLA: PUBLIC PO.PLA;
GenIFetchPreDecode: Commander.CommandProc = {
filename: IO.ROPE ← PO.DefaultCMDLine[cmd.commandLine, defaultFile];
IFetchPreDecodePLA ← PO.NewPLA[inName: "IFUPLA.IFetchPreDecodeIn", outName: "IFUPLA.IFetchPreDecodeOut"];
GenIFetchPreDecodePLA[];
PO.WritePLAFile[filename, cmd.out, IFetchPreDecodePLA] };
ReadIFetchPreDecode: Commander.CommandProc = {
IFetchPreDecodePLA ← PO.ReadPLAFile[PO.DefaultCMDLine[cmd.commandLine, defaultFile], cmd.out] };
WriteIFetchPreDecode: Commander.CommandProc = {
PO.WritePLAFile
[PO.DefaultCMDLine[cmd.commandLine, defaultFile], cmd.out, IFetchPreDecodePLA] };
defaultFile: IO.ROPE = "IFetchPreDecode.pla";
doc: IO.ROPE = "Expects the name of a pla file";
Commander.Register[key:"GenIFetchPreDecode", proc: GenIFetchPreDecode, doc: doc];
Commander.Register[key:"ReadIFetchPreDecode", proc: ReadIFetchPreDecode, doc: doc];
Commander.Register[key:"WriteIFetchPreDecode", proc: WriteIFetchPreDecode, doc: doc];
END.