From 6ea387f744a3b01b1ed6d85c992f1c91d64e5a8f Mon Sep 17 00:00:00 2001 From: jon <> Date: Thu, 4 Mar 2021 14:40:57 +0000 Subject: [PATCH] Fix performance bug in PC compression where we execute across a page boundary. --- src_Core/RISCY_OOO/procs/RV64G_OOO/FetchStage.bsv | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src_Core/RISCY_OOO/procs/RV64G_OOO/FetchStage.bsv b/src_Core/RISCY_OOO/procs/RV64G_OOO/FetchStage.bsv index 428da4e..f576bfd 100644 --- a/src_Core/RISCY_OOO/procs/RV64G_OOO/FetchStage.bsv +++ b/src_Core/RISCY_OOO/procs/RV64G_OOO/FetchStage.bsv @@ -236,7 +236,10 @@ function InstrFromFetch3 fetch3_2_instC(Fetch3ToDecode in, Instruction inst, Bit `ifdef RVFI_DII dii_pid: in.dii_pid, `endif - ppc: fromMaybe(PcCompressed{lsb: in.pc.lsb + 2, idx: in.pc.idx}, in.ppc), // This assumes we will call this function on the last fragment of any instruction. + // This assumes we will call this function on the last fragment of any instruction. + ppc: fromMaybe(PcCompressed{lsb: in.pc.lsb + 2, + idx: in.pc.idx + ((in.pc.lsb == -2) ? 1:0)}, // If we move to a new page, we will move to the next index in the compressed PC table. + in.ppc), decode_epoch: in.decode_epoch, main_epoch: in.main_epoch, inst: inst,