<> <> 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.