diff --git a/doc/01_specification/index.rst b/doc/01_specification/index.rst index 36e38b6583..09db57e1bb 100644 --- a/doc/01_specification/index.rst +++ b/doc/01_specification/index.rst @@ -253,8 +253,8 @@ Operating modes (Privilege Levels) +--------+--------------------------------------------------------------+ | PVL-30 | CV32E20 shall export the CPU's operating mode as an address | | | phase attribute output signals on the Harvard memory | -| | interfaces (instruction fetch, data load/store) with machine | -| | mode defined as 1'b1 and user mode as 1'b0. | +| | interfaces (instruction fetch, data load/store) with mode | +| | encoded as per specification in [RVpriv]_. | +--------+--------------------------------------------------------------+ | PVL-40 | CV32E20 shall support the **bare** (addressing) mode, that | | | is, no support for address translation or protection. | diff --git a/rtl/cve2_core.sv b/rtl/cve2_core.sv index 4f79b67f9e..1cd1e7f945 100644 --- a/rtl/cve2_core.sv +++ b/rtl/cve2_core.sv @@ -103,7 +103,9 @@ module cve2_core import cve2_pkg::*; #( // CPU Control Signals input logic fetch_enable_i, - output logic core_busy_o + output logic core_busy_o, + priv_lvl_e priv_mode_o, + priv_lvl_e priv_eff_mode_o ); localparam int unsigned PMP_NUM_CHAN = 3; @@ -280,6 +282,9 @@ module cve2_core import cve2_pkg::*; #( // interfaces to finish ongoing operations. assign core_busy_o = ctrl_busy | if_busy | lsu_busy; + assign priv_mode_o = priv_mode_id; + assign priv_eff_mode_o = priv_mode_lsu; + ////////////// // IF stage // ////////////// diff --git a/rtl/cve2_top.sv b/rtl/cve2_top.sv index 34af60b7b3..69fdf2b641 100644 --- a/rtl/cve2_top.sv +++ b/rtl/cve2_top.sv @@ -95,7 +95,9 @@ module cve2_top import cve2_pkg::*; #( // CPU Control Signals input logic fetch_enable_i, - output logic core_sleep_o + output logic core_sleep_o, + priv_lvl_e priv_mode_o, + priv_lvl_e priv_eff_mode_o ); // Scrambling Parameter @@ -228,7 +230,9 @@ module cve2_top import cve2_pkg::*; #( `endif .fetch_enable_i (fetch_enable_q), - .core_busy_o (core_busy_d) + .core_busy_o (core_busy_d), + .priv_mode_o, + .priv_eff_mode_o ); ////////////////////////