<> <> <> <<>> DIRECTORY Commander, Dragon, DragOpsCross, IFUPLA, IO, PLAOps; IFUPLAIFetchControl: CEDAR PROGRAM IMPORTS Commander, IO, PLAOps EXPORTS IFUPLA = BEGIN OPEN IFUPLA, PO: PLAOps; GenIFetchControlPLA: PUBLIC PROC = { pBusFaultIsSig: Dragon.PBusFaults _ LAST [Dragon.PBusFaults]; jump: PO.BoolExpr _ BE[m:[jump: TRUE], d:[jump: TRUE ]]; getNext: PO.BoolExpr _ BE[m:[getNext: TRUE], d:[getNext: TRUE ]]; hold: PO.BoolExpr _ BE[m:[hold: TRUE], d:[hold: TRUE ]]; reject: PO.BoolExpr _ BE[m:[reject: TRUE], d:[reject: TRUE ]]; jumping: PO.BoolExpr _ BE[m:[jumping: TRUE], d:[jumping: TRUE ]]; jumpPending: PO.BoolExpr _ BE[m:[jumpPending: TRUE], d:[jumpPending: TRUE ]]; fetching: PO.BoolExpr _ BE[m:[fetching: TRUE], d:[fetching: TRUE ]]; roomFor1: PO.BoolExpr _ BE[m:[roomFor1: TRUE], d:[roomFor1: TRUE ]]; roomFor2: PO.BoolExpr _ BE[m:[roomFor2: TRUE], d:[roomFor2: TRUE ]]; faulted: PO.BoolExpr _ BE[m:[faulted: TRUE], d:[faulted: TRUE ]]; noFault: PO.BoolExpr _ BE[m:[fault: pBusFaultIsSig], d:[fault: None ]]; offSet0: PO.BoolExpr _ BE[m:[offSet: 3], d:[offSet: 0 ]]; offSet1: PO.BoolExpr _ BE[m:[offSet: 3], d:[offSet: 1 ]]; offSet2: PO.BoolExpr _ BE[m:[offSet: 3], d:[offSet: 2 ]]; offSet3: PO.BoolExpr _ BE[m:[offSet: 3], d:[offSet: 3 ]]; opLen1: PO.BoolExpr _ BE[m:[opLen: 7], d:[opLen: 1 ]]; opLen2: PO.BoolExpr _ BE[m:[opLen: 7], d:[opLen: 2 ]]; opLen3: PO.BoolExpr _ BE[m:[opLen: 7], d:[opLen: 3 ]]; opLen5: PO.BoolExpr _ BE[m:[opLen: 7], d:[opLen: 5 ]]; Set[out:[jumpInProgress: TRUE], s:PO.Or[ jump, jumpPending, PO.And[jumping, reject] ] ]; Set[out:[jumpPending: TRUE], s:PO.Or[ PO.And[reject, jump], PO.And[reject, jumpPending] ] ]; Set[out:[newFetch: TRUE], s:PO.Or[ PO.And[PO.Not[reject], PO.Not[fetching], roomFor1], PO.And[PO.Not[reject], roomFor2], PO.And[PO.Not[reject], jump], PO.And[PO.Not[reject], jumpPending] ] ]; Set[out:[faulted: TRUE], s:PO.Or[ PO.And[faulted, PO.Not[jump], PO.Not[jumpPending] ], PO.And[PO.Not[noFault], PO.Not[jump], PO.Not[jumpPending] ] ] ]; Set[out:[incrPrefetch: TRUE], s:PO.And[fetching, PO.Not[jump], PO.Not[jumpPending] ] ]; Set[out:[wt:[set0: TRUE]], s:jump ]; Set[out:[wt:[inc0: TRUE]], s:PO.Or[ PO.And[PO.Not[jump], PO.Not[fetching]], PO.And[PO.Not[jump], reject] ] ]; Set[out:[wt:[inc1: TRUE]], s:PO.And[fetching, PO.Not[jump], PO.Not[reject]] ]; Set[out:[rd:[inc0: TRUE]], s:PO.And[PO.Not[jump], PO.Not[getNext]] ]; Set[out:[rd:[inc1: TRUE]], s:PO.And[getNext, opLen1 ]]; Set[out:[rd:[inc2: TRUE]], s:PO.And[getNext, opLen2 ]]; Set[out:[rd:[inc3: TRUE]], s:PO.And[getNext, opLen3 ]]; Set[out:[rd:[inc5: TRUE]], s:PO.And[getNext, opLen5 ]]; Set[out:[rd:[set0: TRUE]], s:PO.And[jump, offSet0 ]]; Set[out:[rd:[set1: TRUE]], s:PO.And[jump, offSet1 ]]; Set[out:[rd:[set2: TRUE]], s:PO.And[jump, offSet2 ]]; Set[out:[rd:[set3: TRUE]], s:PO.And[jump, offSet3 ]]; }; BE: PROC [m, d: IFetchControlIn] RETURNS[PO.BoolExpr] = { mRef: REF IFetchControlIn _ NARROW[IFetchControlPLA.mask]; dRef: REF IFetchControlIn _ NARROW[IFetchControlPLA.data]; mRef^ _ m; dRef^ _ d; RETURN[PO.GetBEForDataMask[IFetchControlPLA]]}; Set: PROC [s: PO.BoolExpr _ NIL, m, d: IFetchControlIn _ [ ], out: IFetchControlOut] = { res: REF IFetchControlOut _ NARROW[IFetchControlPLA.out]; IF s=NIL THEN s _ BE[m,d] ELSE s _ PO.And[s, BE[m,d] ]; res^ _ out; PO.SetOutForBE[IFetchControlPLA, s]}; IFetchControlProc: PUBLIC PROC[argRec: IFetchControlIn] RETURNS[resRec: IFetchControlOut] = { arg: REF IFetchControlIn _ NARROW[IFetchControlPLA.data]; res: REF IFetchControlOut _ NARROW[IFetchControlPLA.out]; arg^ _ argRec; PO.GetOutForData[IFetchControlPLA]; resRec _ res^}; IFetchControlPLA: PUBLIC PO.PLA; GenIFetchControl: Commander.CommandProc = { filename: IO.ROPE _ PO.DefaultCMDLine[cmd.commandLine, defaultFile]; IFetchControlPLA _ PO.NewPLA[inName: "IFUPLA.IFetchControlIn", outName: "IFUPLA.IFetchControlOut"]; GenIFetchControlPLA[]; PO.WritePLAFile[filename, cmd.out, IFetchControlPLA] }; ReadIFetchControl: Commander.CommandProc = { IFetchControlPLA _ PO.ReadPLAFile[PO.DefaultCMDLine[cmd.commandLine, defaultFile], cmd.out] }; WriteIFetchControl: Commander.CommandProc = {PO.WritePLAFile [PO.DefaultCMDLine[cmd.commandLine, defaultFile], cmd.out, IFetchControlPLA] }; defaultFile: IO.ROPE = "IFetchControl.pla"; doc: IO.ROPE = "Expects the name of a pla file"; Commander.Register[key:"GenIFetchControl", proc: GenIFetchControl, doc: doc]; Commander.Register[key:"ReadIFetchControl", proc: ReadIFetchControl, doc: doc]; Commander.Register[key:"WriteIFetchControl", proc: WriteIFetchControl, doc: doc]; END. <<>> <<>> <<>>