IFUPLAFetchRdDecodeImpl.mesa
Last edited by Curry, November 8, 1985 5:15:03 pm PST
DIRECTORY Commander, IFUPLAFetchRdDecode, IO, PLAOps;
IFUPLAFetchRdDecodeImpl: CEDAR PROGRAM
IMPORTS Commander, IFUPLAFetchRdDecode, IO, PLAOps ~
BEGIN OPEN IFUPLAFetchRdDecode;
GenFetchRdDecodePla: PROC = {
FOR rdIndex: CARDINAL IN [0..16) DO
val: CARDINAL ← 1;
THROUGH [0..rdIndex) DO val ← val*2 ENDLOOP;
Set[m:[rdIndex: 15], d:[rdIndex: rdIndex], out:[rdEnable: val]];
ENDLOOP};
BE: PROC [m, d: FetchRdDecodeIn] RETURNS[PLAOps.BoolExpr] = {
mRef:  REF FetchRdDecodeIn ← NARROW[FetchRdDecodePLA.mask];
dRef:  REF FetchRdDecodeIn ← NARROW[FetchRdDecodePLA.data];
mRef^ ← m; dRef^ ← d; RETURN[PLAOps.GetBEForDataMask[FetchRdDecodePLA]]};
Set: PROC [s: PLAOps.BoolExpr ← NIL, m, d: FetchRdDecodeIn ← [ ], out: FetchRdDecodeOut] = {
res: REF FetchRdDecodeOut ← NARROW[FetchRdDecodePLA.out];
IF s=NIL
THEN s ←       BE[m,d]
ELSE s ←  PLAOps.And[s, BE[m,d] ];
res^ ← out; PLAOps.SetOutForBE[FetchRdDecodePLA, s]};
GenFetchRdDecode: Commander.CommandProc = {
filename: IO.ROPE ← PLAOps.DefaultCMDLine[cmd.commandLine, defaultFile];
FetchRdDecodePLA ← PLAOps.NewPLA["IFUPLAFetchRdDecode.FetchRdDecodeIn", "IFUPLAFetchRdDecode.FetchRdDecodeOut"];
GenFetchRdDecodePla[];
[ ] ← PLAOps.ConvertTermListToCompleteSum[FetchRdDecodePLA.termList, FALSE, FALSE, cmd.out];
[ ] ← PLAOps.FindAMinimalCover[FetchRdDecodePLA.termList, 120, cmd.out];
PLAOps.WritePLAFile[filename, cmd.out, FetchRdDecodePLA] };
defaultFile: IO.ROPE = "IFUPLAFetchRdDecode.ttt";
doc:   IO.ROPE = "Expects the name of a ttt file";
Commander.Register[key:"GenFetchRdDecode",  proc: GenFetchRdDecode, doc: doc];
END.