Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Machine mode indicator #174

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions doc/01_specification/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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. |
Expand Down
5 changes: 4 additions & 1 deletion rtl/cve2_core.sv
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ 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
);

localparam int unsigned PMP_NUM_CHAN = 3;
Expand Down Expand Up @@ -280,6 +281,8 @@ 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;

//////////////
// IF stage //
//////////////
Expand Down
6 changes: 4 additions & 2 deletions rtl/cve2_top.sv
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ 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
szbieg marked this conversation as resolved.
Show resolved Hide resolved
);

// Scrambling Parameter
Expand Down Expand Up @@ -228,7 +229,8 @@ 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
);

////////////////////////
Expand Down
Loading