From 5819f8eb7eb45f9d543641e4c957ff89a416cd75 Mon Sep 17 00:00:00 2001 From: Luke Wren Date: Mon, 8 Aug 2022 18:45:37 +0100 Subject: [PATCH] Remove wrong/useless mxr logic in PMP --- hdl/hazard3_core.v | 2 -- hdl/hazard3_pmp.v | 6 +----- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/hdl/hazard3_core.v b/hdl/hazard3_core.v index 08fd95d..78808c7 100644 --- a/hdl/hazard3_core.v +++ b/hdl/hazard3_core.v @@ -784,8 +784,6 @@ if (PMP_REGIONS > 0) begin: have_pmp .clk (clk), .rst_n (rst_n), - .mstatus_mxr (1'b0), // Only used when S mode present - .cfg_addr (x_pmp_cfg_addr), .cfg_wen (x_pmp_cfg_wen), .cfg_wdata (x_pmp_cfg_wdata), diff --git a/hdl/hazard3_pmp.v b/hdl/hazard3_pmp.v index 0ca91a1..6ad3610 100644 --- a/hdl/hazard3_pmp.v +++ b/hdl/hazard3_pmp.v @@ -12,7 +12,6 @@ module hazard3_pmp #( ) ( input wire clk, input wire rst_n, - input wire mstatus_mxr, // make executable readable // Config interface passed through CSR block input wire [11:0] cfg_addr, @@ -190,7 +189,6 @@ reg d_m; // Hazard3 extension (M-mode without locking) reg d_l; reg d_r; reg d_w; -reg d_x; // needed because of MXR always @ (*) begin: check_d_match integer i; @@ -199,7 +197,6 @@ always @ (*) begin: check_d_match d_l = 1'b0; d_r = 1'b0; d_w = 1'b0; - d_x = 1'b0; // Lowest-numbered match wins, so work down from the top. This should be // inferred as a priority mux structure (cascade mux). for (i = PMP_REGIONS - 1; i >= 0; i = i - 1) begin @@ -209,7 +206,6 @@ always @ (*) begin: check_d_match d_l = pmpcfg_l[i]; d_r = pmpcfg_r[i]; d_w = pmpcfg_w[i]; - d_x = pmpcfg_x[i]; end end end @@ -279,7 +275,7 @@ end // M-mode gets to ignore protections, unless the lock bit is set. assign d_kill = (!d_m_mode || d_l || d_m) && ( - (!d_write && !(d_r || (d_x && mstatus_mxr))) || + (!d_write && !d_r) || ( d_write && !d_w) );