From 93b5651f0e6445843073bcbbd53a65d275a35373 Mon Sep 17 00:00:00 2001 From: Simone Manoni Date: Fri, 27 Sep 2024 15:29:12 +0200 Subject: [PATCH] linux boot stable, revert to original riscv_pkg with zicfiss added modifs --- core/compressed_decoder.sv | 2 +- core/ex_stage.sv | 3 ++- .../cv64a6_imafdch_sv39_wb_alsaqr_config_pkg.sv | 2 +- core/include/riscv_pkg.sv | 17 +++++++++++------ 4 files changed, 15 insertions(+), 9 deletions(-) diff --git a/core/compressed_decoder.sv b/core/compressed_decoder.sv index 926549f323..f82f4e1969 100644 --- a/core/compressed_decoder.sv +++ b/core/compressed_decoder.sv @@ -429,7 +429,7 @@ module compressed_decoder #( instr_o = { 12'b110011011100, 7'b00101, - 3'h100, + 3'b100, 5'b00000, riscv::OpcodeSystem }; diff --git a/core/ex_stage.sv b/core/ex_stage.sv index f795b17e08..564587d352 100644 --- a/core/ex_stage.sv +++ b/core/ex_stage.sv @@ -603,7 +603,8 @@ module ex_stage // Mux between load exception and shadow stack pop check ex // Check if swapping for the whole load_exception cycles is a problem - assign load_exception_o = ssv_loaded ? sspopchk_ex : ld_ex; + //assign load_exception_o = ssv_loaded ? sspopchk_ex : ld_ex; + assign load_exception_o = ld_ex; always_comb begin : sspopchk sspopchk_ex = '0; diff --git a/core/include/cv64a6_imafdch_sv39_wb_alsaqr_config_pkg.sv b/core/include/cv64a6_imafdch_sv39_wb_alsaqr_config_pkg.sv index b5e356006d..5dd6cab56d 100644 --- a/core/include/cv64a6_imafdch_sv39_wb_alsaqr_config_pkg.sv +++ b/core/include/cv64a6_imafdch_sv39_wb_alsaqr_config_pkg.sv @@ -27,7 +27,7 @@ package cva6_config_pkg; localparam CVA6ConfigVExtEn = 0; localparam CVA6ConfigHExtEn = 1; localparam CVA6ConfigZiCfiSSEn = 1; - localparam CVA6ConfigZiCfiLPEn = 1; + localparam CVA6ConfigZiCfiLPEn = 0; localparam CVA6ConfigZiCondExtEn = 1; localparam CVA6ConfigSclicExtEn = 0; diff --git a/core/include/riscv_pkg.sv b/core/include/riscv_pkg.sv index ea58f6de5b..0d10d5a007 100644 --- a/core/include/riscv_pkg.sv +++ b/core/include/riscv_pkg.sv @@ -83,10 +83,12 @@ package riscv; typedef struct packed { logic sd; // signal dirty state - read-only - logic [62:34] wpri7; // writes preserved reads ignored + //logic [62:34] wpri7; // writes preserved reads ignored + logic [62:34] wpri7; logic [62:34] wpri6; // writes preserved reads ignored xlen_e uxl; // variable user mode xlen - hardwired to zero - logic spelp; // hold previous ELP in S-mode + //logic spelp; // hold previous ELP in S-mode + logic spelp; logic [11:0] wpri5; // writes preserved reads ignored logic mxr; // make executable readable logic sum; // permit supervisor user memory access @@ -126,8 +128,10 @@ package riscv; typedef struct packed { logic sd; // signal dirty state - read-only logic [62:40] wpri4; // writes preserved reads ignored - logic [62:42] wpri5; // writes preserved reads ignored - logic mpelp; // hold previous ELP in M-mode + //logic [62:42] wpri5; // writes preserved reads ignored + //logic mpelp; // hold previous ELP in M-mode + logic [62:42] wpri5; + logic mpelp; logic mpv; // machine previous virtualization mode logic gva; // variable set when trap writes to stval logic mbe; // endianness memory accesses made from M-mode @@ -135,7 +139,8 @@ package riscv; xlen_e sxl; // variable supervisor mode xlen - hardwired to zero xlen_e uxl; // variable user mode xlen - hardwired to zero logic [8:0] wpri3; // writes preserved reads ignored - logic spelp; // hold previous ELP in S-mode + //logic spelp; // hold previous ELP in S-mode + logic spelp; logic tsr; // trap sret logic tw; // time wait logic tvm; // trap virtual memory @@ -175,9 +180,9 @@ typedef struct packed { logic cbze; // not implemented - requires Zicboz extension logic cbcfe; // not implemented - requires Zicbom extension logic [1:0] cbie; // not implemented - requires Zicbom extension + logic [2:0] wpri0; // writes preserved reads ignored logic sse; // enable Zicfiss in less priviledged modes logic lpe; // enable Zicfilp in less priviledged modes - logic wpri0; // writes preserved reads ignored logic fiom; // fence of I/O implies memory } envcfg_rv_t;