DIRECTORY Basics, Commander, DragOpsCross, IFUPLAFetchPreDecode, IO, PLAOps; IFUPLAFetchPreDecodeImpl: CEDAR PROGRAM IMPORTS Basics, Commander, IO, PLAOps = BEGIN OPEN IFUPLAFetchPreDecode, PO: PLAOps; FetchPreDecodePLA: PLAOps.PLA; GenFetchPreDecodePLA: PUBLIC PROC = { op0: PO.BoolExpr _ BE[m:[op: 4], d:[op: 4]]; op1: PO.BoolExpr _ BE[m:[op: 2], d:[op: 2]]; op2: PO.BoolExpr _ BE[m:[op: 1], d:[op: 1]]; oneByter: PO.BoolExpr _ PO.Or[ PO.And[ PO.Not[op0], PO.Not[op1], PO.Not[op2] ], PO.And[ PO.Not[op0], op1 ] ]; twoByter: PO.BoolExpr _ PO.And[ op0, PO.Not[op1] ]; threeByter: PO.BoolExpr _ PO.And[ op0, op1 ]; fiveByter: PO.BoolExpr _ PO.And[ PO.Not[op0], PO.Not[op1], op2 ]; bytesAvail0: PO.BoolExpr _ BE[m:[fetchBytesM1: 16], d:[fetchBytesM1: 16 ]]; bytesAvail1: PO.BoolExpr _ BE[m:[fetchBytesM1: 31], d:[fetchBytesM1: 0 ]]; bytesAvail2: PO.BoolExpr _ BE[m:[fetchBytesM1: 31], d:[fetchBytesM1: 1 ]]; bytesAvail3: PO.BoolExpr _ BE[m:[fetchBytesM1: 31], d:[fetchBytesM1: 2 ]]; bytesAvail4: PO.BoolExpr _ BE[m:[fetchBytesM1: 31], d:[fetchBytesM1: 3 ]]; notReady: PO.BoolExpr _ PO.Or[ bytesAvail0, PO.And[ bytesAvail1, PO.Or[ twoByter, threeByter, fiveByter ] ], PO.And[ bytesAvail2, PO.Or[ threeByter, fiveByter ] ], PO.And[ PO.Or[ bytesAvail3, bytesAvail4 ], fiveByter ] ]; Set[out:[notInstReady: TRUE], s: notReady]; Set[out:[instFault0:TRUE], s:PO.And[notReady, BE[m:[iPFaulting:TRUE], d:[iPFaulting:TRUE]]]]; Set[out:[opLength: 5, opLengthb: 5], s: fiveByter ]; Set[out:[opLength: 1, opLengthb: 1], s: oneByter ]; Set[out:[opLength: 2, opLengthb: 2], s: twoByter ]; Set[out:[opLength: 3, opLengthb: 3], s: threeByter ]; Set[out:[jumpOffset: alpha], s: BE[m:[op: 7], d:[op: 4]]]; CheckInstRange[0, dJB, 7, 4]; Set[out:[jumpOffset: beta], s: BE[m:[op: 7], d:[op: 7]]]; FOR inst: DragOpsCross.Inst IN [dRJEB..dRJLEBJ] DO CheckInstRange[1, inst, 7, 7]; ENDLOOP; FOR inst: DragOpsCross.Inst IN [dJEBB..dJNEBBJ] DO CheckInstRange[1, inst, 7, 7]; ENDLOOP; Set[out:[jumpOffset: alphaBeta], s: BE[m:[op: 7], d:[op: 6]]]; CheckInstRange[2, dJDB, 7, 6]; CheckInstRange[2, dLFC, 7, 6]; Set[out:[jumpOffset: xa], s: BE[m:[op: 7], d:[op: 2]]]; CheckInstRange[3, dJSR, 7, 2]; }; reservations: ARRAY [0..25) OF RECORD [ mask, val: WORD ]; CheckInstRange: PROC [group: [0..25), inst: DragOpsCross.Inst, mask, val: WORD] = { Matches: PROC [g: [0..25)] RETURNS [BOOL] = { diffs: WORD = Basics.BITXOR[val, reservations[g].val]; RETURN [Basics.BITAND[reservations[g].mask, diffs] = 0] }; reservations[group] _ [mask: mask, val: val]; FOR g: [0..25) DECREASING IN [0..group) DO IF Matches[g] THEN ERROR ENDLOOP; IF NOT Matches[group] THEN ERROR; IF Basics.BITAND[mask, Basics.BITXOR[val, Basics.BITSHIFT[LOOPHOLE[inst], -5] ] ] # 0 THEN ERROR}; BE: PROC [m, d: FetchPreDecodeIn] RETURNS[PO.BoolExpr] = { mRef: REF FetchPreDecodeIn _ NARROW[FetchPreDecodePLA.mask]; dRef: REF FetchPreDecodeIn _ NARROW[FetchPreDecodePLA.data]; mRef^ _ m; dRef^ _ d; RETURN[PO.GetBEForDataMask[FetchPreDecodePLA]]}; Set: PROC [s: PO.BoolExpr _ NIL, m, d: FetchPreDecodeIn _ [ ], out: FetchPreDecodeOut] = { res: REF FetchPreDecodeOut _ NARROW[FetchPreDecodePLA.out]; IF s=NIL THEN s _ BE[m,d] ELSE s _ PO.And[s, BE[m,d] ]; res^ _ out; PO.SetOutForBE[FetchPreDecodePLA, s]}; GenFetchPreDecode: Commander.CommandProc = { filename: IO.ROPE _ PO.DefaultCMDLine[cmd.commandLine, defaultFile]; FetchPreDecodePLA _ PO.NewPLA["IFUPLAFetchPreDecode.FetchPreDecodeIn", "IFUPLAFetchPreDecode.FetchPreDecodeOut"]; GenFetchPreDecodePLA[]; [ ] _ PO.ConvertTermListToCompleteSum[FetchPreDecodePLA.termList, FALSE, FALSE, cmd.out]; [ ] _ PO.FindAMinimalCover[FetchPreDecodePLA.termList, 120, cmd.out]; PO.WritePLAFile[filename, cmd.out, FetchPreDecodePLA] }; defaultFile: IO.ROPE = "IFUPLAFetchPreDecode.ttt"; doc: IO.ROPE = "Expects the name of a ttt file"; Commander.Register[key:"GenFetchPreDecode", proc: GenFetchPreDecode, doc: doc]; END. `IFUPLAFetchPreDecodeImpl.mesa Copyright c 1984 by Xerox Corporation. All rights reserved. Last edited by Curry, September 11, 1986 0:18:56 am PDT McCreight, March 20, 1986 7:03:39 pm PST FetchPreDecodeProc: PROC[args: FetchPreDecodeIn] RETURNS[result: FetchPreDecodeOut]; Now select the offset to be used in the jump target address adder. Κ˜šΠbl™Jšœ<™