-
Notifications
You must be signed in to change notification settings - Fork 76
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
User mode support #187
User mode support #187
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit
design/dec/el2_dec_decode_ctl.sv
Outdated
assign dec_csr_rdaddr_d[11:0] = {12{dec_csr_any_unq_d}} & i0[31:20]; | ||
assign dec_csr_wraddr_r[11:0] = {12{r_d.csrwen & r_d.i0valid}} & r_d.csrwaddr[11:0]; | ||
assign dec_csr_rdaddr_r[11:0] = {12{~r_d.csrwen & r_d.i0valid}} & r_d.csraddr[11:0]; | ||
assign dec_csr_wraddr_r[11:0] = {12{ r_d.csrwen & r_d.i0valid}} & r_d.csraddr[11:0]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[verible-verilog-format] reported by reviewdog 🐶
assign dec_csr_rdaddr_d[11:0] = {12{dec_csr_any_unq_d}} & i0[31:20]; | |
assign dec_csr_wraddr_r[11:0] = {12{r_d.csrwen & r_d.i0valid}} & r_d.csrwaddr[11:0]; | |
assign dec_csr_rdaddr_r[11:0] = {12{~r_d.csrwen & r_d.i0valid}} & r_d.csraddr[11:0]; | |
assign dec_csr_wraddr_r[11:0] = {12{ r_d.csrwen & r_d.i0valid}} & r_d.csraddr[11:0]; | |
assign dec_csr_rdaddr_d[11:0] = {12{dec_csr_any_unq_d}} & i0[31:20]; | |
assign dec_csr_rdaddr_r[11:0] = {12{~r_d.csrwen & r_d.i0valid}} & r_d.csraddr[11:0]; | |
assign dec_csr_wraddr_r[11:0] = {12{r_d.csrwen & r_d.i0valid}} & r_d.csraddr[11:0]; |
// If we are writing MIE or MSTATUS, hold off the external interrupt for a cycle on the write. | ||
assign dec_csr_stall_int_ff = ((r_d.csrwaddr[11:0] == 12'h300) | (r_d.csrwaddr[11:0] == 12'h304)) & r_d.csrwen & r_d.i0valid & ~dec_tlu_i0_kill_writeb_wb; | ||
assign dec_csr_stall_int_ff = ((r_d.csraddr[11:0] == 12'h300) | (r_d.csraddr[11:0] == 12'h304)) & r_d.csrwen & r_d.i0valid & ~dec_tlu_i0_kill_writeb_wb; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[verible-verilog-format] reported by reviewdog 🐶
// If we are writing MIE or MSTATUS, hold off the external interrupt for a cycle on the write. | |
assign dec_csr_stall_int_ff = ((r_d.csrwaddr[11:0] == 12'h300) | (r_d.csrwaddr[11:0] == 12'h304)) & r_d.csrwen & r_d.i0valid & ~dec_tlu_i0_kill_writeb_wb; | |
assign dec_csr_stall_int_ff = ((r_d.csraddr[11:0] == 12'h300) | (r_d.csraddr[11:0] == 12'h304)) & r_d.csrwen & r_d.i0valid & ~dec_tlu_i0_kill_writeb_wb; | |
// If we are writing MIE or MSTATUS, hold off the external interrupt for a cycle on the write. | |
assign dec_csr_stall_int_ff = ((r_d.csraddr[11:0] == 12'h300) | (r_d.csraddr[11:0] == 12'h304)) & r_d.csrwen & r_d.i0valid & ~dec_tlu_i0_kill_writeb_wb; |
design/dec/el2_dec_decode_ctl.sv
Outdated
assign d_d.csrwen = dec_csr_wen_unq_d & i0_legal_decode_d; | ||
assign d_d.csrwonly = i0_csr_write_only_d & dec_i0_decode_d; | ||
assign d_d.csrwaddr[11:0] = (d_d.csrwen) ? i0[31:20] : '0; // csr write address for rd==0 case | ||
assign d_d.csraddr[11:0] = i0[31:20]; // csr read/write address |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[verible-verilog-format] reported by reviewdog 🐶
assign d_d.csrwen = dec_csr_wen_unq_d & i0_legal_decode_d; | |
assign d_d.csrwonly = i0_csr_write_only_d & dec_i0_decode_d; | |
assign d_d.csrwaddr[11:0] = (d_d.csrwen) ? i0[31:20] : '0; // csr write address for rd==0 case | |
assign d_d.csraddr[11:0] = i0[31:20]; // csr read/write address | |
assign d_d.csrwen = dec_csr_wen_unq_d & i0_legal_decode_d; | |
assign d_d.csrwonly = i0_csr_write_only_d & dec_i0_decode_d; | |
assign d_d.csraddr[11:0] = i0[31:20]; // csr read/write address |
@@ -1309,7 +1311,7 @@ end : cam_array | |||
|
|||
assign d_d.csrwen = dec_csr_wen_unq_d & i0_legal_decode_d; | |||
assign d_d.csrwonly = i0_csr_write_only_d & dec_i0_decode_d; | |||
assign d_d.csrwaddr[11:0] = (d_d.csrwen) ? i0[31:20] : '0; // csr write address for rd==0 case | |||
assign d_d.csraddr[11:0] = i0[31:20]; // csr read/write address | |||
|
|||
|
|||
rvdff #(3) i0cgff (.*, .clk(active_clk), .din(i0_pipe_en[3:1]), .dout(i0_pipe_en[2:0])); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[verible-verilog-format] reported by reviewdog 🐶
rvdff #(3) i0cgff (.*, .clk(active_clk), .din(i0_pipe_en[3:1]), .dout(i0_pipe_en[2:0])); | |
rvdff #(3) i0cgff ( | |
.*, | |
.clk (active_clk), | |
.din (i0_pipe_en[3:1]), | |
.dout(i0_pipe_en[2:0]) | |
); |
design/dec/el2_dec_pmp_ctl.sv
Outdated
@@ -23,7 +23,6 @@ | |||
// | |||
//******************************************************************************** | |||
|
|||
|
|||
module el2_dec_pmp_ctl | |||
import el2_pkg::*; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[verible-verilog-format] reported by reviewdog 🐶
import el2_pkg::*; | |
import el2_pkg::*; |
(pmp_req_type == READ) | | ||
(pmp_req_type == WRITE); | ||
// Execute only on M/U | ||
2'b10: result = (pmp_req_type == EXEC); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[verible-verilog-format] reported by reviewdog 🐶
2'b10: result = (pmp_req_type == EXEC); | |
2'b10: result = (pmp_req_type == EXEC); |
2'b11: result = | ||
(pmp_req_type == EXEC) | | ||
((pmp_req_type == READ) & ~priv_mode); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[verible-verilog-format] reported by reviewdog 🐶
2'b11: result = | |
(pmp_req_type == EXEC) | | |
((pmp_req_type == READ) & ~priv_mode); | |
2'b11: result = (pmp_req_type == EXEC) | ((pmp_req_type == READ) & ~priv_mode); |
function automatic logic orig_perm_check(logic pmp_cfg_lock, | ||
logic priv_mode, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[verible-verilog-format] reported by reviewdog 🐶
function automatic logic orig_perm_check(logic pmp_cfg_lock, | |
logic priv_mode, | |
function automatic logic orig_perm_check(logic pmp_cfg_lock, logic priv_mode, |
function automatic logic access_fault_check(el2_mseccfg_pkt_t csr_pmp_mseccfg, | ||
el2_pmp_type_pkt_t req_type, | ||
logic [pt.PMP_ENTRIES-1:0] match_all, | ||
logic any_region_enabled, | ||
logic priv_mode, | ||
logic [pt.PMP_ENTRIES-1:0] final_perm_check); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[verible-verilog-format] reported by reviewdog 🐶
function automatic logic access_fault_check(el2_mseccfg_pkt_t csr_pmp_mseccfg, | |
el2_pmp_type_pkt_t req_type, | |
logic [pt.PMP_ENTRIES-1:0] match_all, | |
logic any_region_enabled, | |
logic priv_mode, | |
logic [pt.PMP_ENTRIES-1:0] final_perm_check); | |
function automatic logic access_fault_check( | |
el2_mseccfg_pkt_t csr_pmp_mseccfg, el2_pmp_type_pkt_t req_type, | |
logic [pt.PMP_ENTRIES-1:0] match_all, logic any_region_enabled, logic priv_mode, | |
logic [pt.PMP_ENTRIES-1:0] final_perm_check); |
logic [pt.PMP_ENTRIES-1:0] final_perm_check); | ||
|
||
|
||
`ifdef RV_USER_MODE | ||
`ifdef RV_SMEPMP |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[verible-verilog-format] reported by reviewdog 🐶
`ifdef RV_SMEPMP | |
`ifdef RV_SMEPMP |
design/dec/el2_dec_tlu_ctl.sv
Outdated
@@ -557,6 +540,12 @@ import el2_pkg::*; | |||
|
|||
|
|||
localparam MSTATUS_MIE = 0; | |||
localparam MSTATUS_MPIE = 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Explicitly define a storage type for every parameter and localparam, (MSTATUS_MPIE). [Style: constants] [explicit-parameter-storage-type]
design/dec/el2_dec_tlu_ctl.sv
Outdated
@@ -1229,6 +1352,7 @@ end | |||
// [31:0] : Lower Cycle count | |||
|
|||
localparam MCYCLEL = 12'hb00; | |||
localparam CYCLEL = 12'hc00; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Explicitly define a storage type for every parameter and localparam, (CYCLEL). [Style: constants] [explicit-parameter-storage-type]
design/dec/el2_dec_tlu_ctl.sv
Outdated
@@ -1251,6 +1375,7 @@ end | |||
// Chained with mcyclel. Note: mcyclel overflow due to a mcycleh write gets ignored. | |||
|
|||
localparam MCYCLEH = 12'hb80; | |||
localparam CYCLEH = 12'hc80; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Explicitly define a storage type for every parameter and localparam, (CYCLEH). [Style: constants] [explicit-parameter-storage-type]
design/dec/el2_dec_tlu_ctl.sv
Outdated
@@ -1269,6 +1394,7 @@ end | |||
// one instruction will be the value read by the following instruction (i.e., the increment of instret | |||
// caused by the first instruction retiring happens before the write of the new value)." | |||
localparam MINSTRETL = 12'hb02; | |||
localparam INSTRETL = 12'hc02; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Explicitly define a storage type for every parameter and localparam, (INSTRETL). [Style: constants] [explicit-parameter-storage-type]
design/dec/el2_dec_tlu_ctl.sv
Outdated
@@ -1295,6 +1421,7 @@ end | |||
// Chained with minstretl. Note: minstretl overflow due to a minstreth write gets ignored. | |||
|
|||
localparam MINSTRETH = 12'hb82; | |||
localparam INSTRETH = 12'hc82; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Explicitly define a storage type for every parameter and localparam, (INSTRETH). [Style: constants] [explicit-parameter-storage-type]
design/dec/el2_dec_pmp_ctl.sv
Outdated
// ---------------------------------------------------------------------- | ||
|
||
logic [pt.PMP_ENTRIES-1:0] entry_lock_eff; // Effective entry lock | ||
for (genvar r = 0; r < pt.PMP_ENTRIES; r++) begin : pmpcfg_lock |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All generate block labels must start with g_ or gen_ [Style: generate-constructs] [generate-label-prefix]
design/dec/el2_dec_pmp_ctl.sv
Outdated
// PMPCFG fields are WARL. Mask out bits 6:5 during write. | ||
// When Smepmp is disabled R=0 and W=1 combination is illegal mask out W |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove trailing spaces. [Style: trailing-spaces] [no-trailing-spaces]
// PMPCFG fields are WARL. Mask out bits 6:5 during write. | |
// When Smepmp is disabled R=0 and W=1 combination is illegal mask out W | |
// PMPCFG fields are WARL. Mask out bits 6:5 during write. // PMPCFG fields are WARL. Mask out bits 6:5 during write. | |
// When Smepmp is disabled R=0 and W=1 combination is illegal mask out W |
design/el2_veer.sv
Outdated
`ifdef RV_USER_MODE | ||
|
||
logic priv_mode; // Operating privilege mode, 0 - machine, 1 - user | ||
logic priv_mode_eff; // Effective privilege mode, 0 - machine, 1 - user (driven in el2_dec_tlu_ctl.sv) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line length exceeds max: 100; is: 109 [Style: line-length] [line-length]
// modes. Also deny unmatched for M-mode when MSECCFG.MML is set and request type is EXEC. | ||
logic access_fail = csr_pmp_mseccfg.MMWP | priv_mode | | ||
(csr_pmp_mseccfg.MML && (req_type == EXEC)); | ||
`else |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[verible-verilog-format] reported by reviewdog 🐶
`else | |
`else |
`else | ||
// When in user mode and at least one PMP region is enabled deny access by default. | ||
logic access_fail = any_region_enabled & priv_mode; | ||
`endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[verible-verilog-format] reported by reviewdog 🐶
`endif | |
`endif |
1'b0, | ||
1'b0, | ||
`endif | ||
region_perm_check[c]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[verible-verilog-format] reported by reviewdog 🐶
region_perm_check[c]); | |
region_perm_check[c] | |
); |
@@ -884,6 +884,16 @@ import el2_pkg::*; | |||
|
|||
assign core_rst_l = rst_l & (dbg_core_rst_l | scan_mode); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[verible-verilog-format] reported by reviewdog 🐶
assign core_rst_l = rst_l & (dbg_core_rst_l | scan_mode); | |
assign core_rst_l = rst_l & (dbg_core_rst_l | scan_mode); |
design/el2_veer.sv
Outdated
logic priv_mode; // Operating privilege mode, 0 - machine, 1 - user | ||
logic priv_mode_eff; // Effective privilege mode, 0 - machine, 1 - user (driven in el2_dec_tlu_ctl.sv) | ||
logic priv_mode_ns; // Next privilege mode |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[verible-verilog-format] reported by reviewdog 🐶
logic priv_mode; // Operating privilege mode, 0 - machine, 1 - user | |
logic priv_mode_eff; // Effective privilege mode, 0 - machine, 1 - user (driven in el2_dec_tlu_ctl.sv) | |
logic priv_mode_ns; // Next privilege mode | |
logic priv_mode; // Operating privilege mode, 0 - machine, 1 - user | |
logic priv_mode_eff; // Effective privilege mode, 0 - machine, 1 - user (driven in el2_dec_tlu_ctl.sv) | |
logic priv_mode_ns; // Next privilege mode |
logic priv_mode_eff; // Effective privilege mode, 0 - machine, 1 - user (driven in el2_dec_tlu_ctl.sv) | ||
logic priv_mode_ns; // Next privilege mode | ||
|
||
el2_mseccfg_pkt_t mseccfg; // mseccfg CSR for PMP |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[verible-verilog-format] reported by reviewdog 🐶
el2_mseccfg_pkt_t mseccfg; // mseccfg CSR for PMP | |
el2_mseccfg_pkt_t mseccfg; // mseccfg CSR for PMP |
logic MMWP; | ||
logic MML; | ||
} el2_mseccfg_pkt_t; | ||
|
||
//`endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[verible-verilog-format] reported by reviewdog 🐶
//`endif | |
//`endif |
logic MMWP; | ||
logic MML; | ||
} el2_mseccfg_pkt_t; | ||
|
||
//`endif | ||
|
||
endpackage // el2_pkg |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[verible-verilog-format] reported by reviewdog 🐶
endpackage // el2_pkg | |
endpackage // el2_pkg |
Links to coverage and verification reports for this PR (#187) are available at https://chipsalliance.github.io/Cores-VeeR-EL2/ |
414f696
to
4c8dacb
Compare
@@ -557,6 +540,12 @@ import el2_pkg::*; | |||
|
|||
|
|||
localparam MSTATUS_MIE = 0; | |||
localparam int MSTATUS_MPIE = 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Non-type localparam names must be styled with CamelCase [Style: constants] [parameter-name-style]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We've added the int
type following the fixes from Verible.
However, the case used here is consistent with other localparams in the codebase and we don't aim to reformat them in the scope on this PR.
@@ -920,16 +921,17 @@ end : cam_array | |||
assign dec_csr_any_unq_d = any_csr_d & i0_valid_d; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[verible-verilog-format] reported by reviewdog 🐶
assign dec_csr_any_unq_d = any_csr_d & i0_valid_d; | |
assign dec_csr_any_unq_d = any_csr_d & i0_valid_d; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The indentation level suggestions do not match the indentation of the rest of the file. Let's not apply them for now as formatting of the whole file is out of scope of this PR.
assign dec_csr_rdaddr_d[11:0] = {12{dec_csr_any_unq_d}} & i0[31:20]; | ||
assign dec_csr_rdaddr_r[11:0] = {12{~r_d.csrwen & r_d.i0valid}} & r_d.csraddr[11:0]; | ||
assign dec_csr_wraddr_r[11:0] = {12{r_d.csrwen & r_d.i0valid}} & r_d.csraddr[11:0]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[verible-verilog-format] reported by reviewdog 🐶
assign dec_csr_rdaddr_d[11:0] = {12{dec_csr_any_unq_d}} & i0[31:20]; | |
assign dec_csr_rdaddr_r[11:0] = {12{~r_d.csrwen & r_d.i0valid}} & r_d.csraddr[11:0]; | |
assign dec_csr_wraddr_r[11:0] = {12{r_d.csrwen & r_d.i0valid}} & r_d.csraddr[11:0]; | |
assign dec_csr_rdaddr_d[11:0] = {12{dec_csr_any_unq_d}} & i0[31:20]; | |
assign dec_csr_rdaddr_r[11:0] = {12{~r_d.csrwen & r_d.i0valid}} & r_d.csraddr[11:0]; | |
assign dec_csr_wraddr_r[11:0] = {12{r_d.csrwen & r_d.i0valid}} & r_d.csraddr[11:0]; |
assign d_d.csrwen = dec_csr_wen_unq_d & i0_legal_decode_d; | ||
assign d_d.csrwonly = i0_csr_write_only_d & dec_i0_decode_d; | ||
assign d_d.csraddr[11:0] = i0[31:20]; // csr read/write address |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[verible-verilog-format] reported by reviewdog 🐶
assign d_d.csrwen = dec_csr_wen_unq_d & i0_legal_decode_d; | |
assign d_d.csrwonly = i0_csr_write_only_d & dec_i0_decode_d; | |
assign d_d.csraddr[11:0] = i0[31:20]; // csr read/write address | |
assign d_d.csrwen = dec_csr_wen_unq_d & i0_legal_decode_d; | |
assign d_d.csrwonly = i0_csr_write_only_d & dec_i0_decode_d; | |
assign d_d.csraddr[11:0] = i0[31:20]; // csr read/write address |
output logic [31:0] dec_pmp_rddata_d, // pmp CSR read data | ||
output logic dec_pmp_read_d, // pmp CSR address match |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[verible-verilog-format] reported by reviewdog 🐶
output logic [31:0] dec_pmp_rddata_d, // pmp CSR read data | |
output logic dec_pmp_read_d, // pmp CSR address match | |
output logic [31:0] dec_pmp_rddata_d, // pmp CSR read data | |
output logic dec_pmp_read_d, // pmp CSR address match |
output el2_pmp_cfg_pkt_t pmp_pmpcfg [pt.PMP_ENTRIES], | ||
output logic [31:0] pmp_pmpaddr [pt.PMP_ENTRIES], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[verible-verilog-format] reported by reviewdog 🐶
output el2_pmp_cfg_pkt_t pmp_pmpcfg [pt.PMP_ENTRIES], | |
output logic [31:0] pmp_pmpaddr [pt.PMP_ENTRIES], | |
output el2_pmp_cfg_pkt_t pmp_pmpcfg [pt.PMP_ENTRIES], | |
output logic [31:0] pmp_pmpaddr[pt.PMP_ENTRIES], |
logic [pt.PMP_ENTRIES-1:0] entry_lock_eff; // Effective entry lock | ||
for (genvar r = 0; r < pt.PMP_ENTRIES; r++) begin : g_pmpcfg_lock |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[verible-verilog-format] reported by reviewdog 🐶
logic [pt.PMP_ENTRIES-1:0] entry_lock_eff; // Effective entry lock | |
for (genvar r = 0; r < pt.PMP_ENTRIES; r++) begin : g_pmpcfg_lock | |
logic [pt.PMP_ENTRIES-1:0] entry_lock_eff; // Effective entry lock | |
for (genvar r = 0; r < pt.PMP_ENTRIES; r++) begin : g_pmpcfg_lock |
// Smepmp allow modifying locked entries when mseccfg.RLB is set | ||
assign entry_lock_eff[r] = pmp_pmpcfg[r].lock & ~mseccfg.RLB; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[verible-verilog-format] reported by reviewdog 🐶
// Smepmp allow modifying locked entries when mseccfg.RLB is set | |
assign entry_lock_eff[r] = pmp_pmpcfg[r].lock & ~mseccfg.RLB; | |
// Smepmp allow modifying locked entries when mseccfg.RLB is set | |
assign entry_lock_eff[r] = pmp_pmpcfg[r].lock & ~mseccfg.RLB; |
// Smepmp allow modifying locked entries when mseccfg.RLB is set | ||
assign entry_lock_eff[r] = pmp_pmpcfg[r].lock & ~mseccfg.RLB; | ||
`else | ||
assign entry_lock_eff[r] = pmp_pmpcfg[r].lock; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[verible-verilog-format] reported by reviewdog 🐶
assign entry_lock_eff[r] = pmp_pmpcfg[r].lock; | |
assign entry_lock_eff[r] = pmp_pmpcfg[r].lock; |
// PMPCFG fields are WARL. Mask out bits 6:5 during write. | ||
// When Smepmp is disabled R=0 and W=1 combination is illegal mask out W | ||
// when R is cleared. | ||
assign raw_wdata = dec_csr_wrdata_r[(entry_idx[1:0]*8)+7:(entry_idx[1:0]*8)+0]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[verible-verilog-format] reported by reviewdog 🐶
// PMPCFG fields are WARL. Mask out bits 6:5 during write. | |
// When Smepmp is disabled R=0 and W=1 combination is illegal mask out W | |
// when R is cleared. | |
assign raw_wdata = dec_csr_wrdata_r[(entry_idx[1:0]*8)+7:(entry_idx[1:0]*8)+0]; | |
// PMPCFG fields are WARL. Mask out bits 6:5 during write. | |
// When Smepmp is disabled R=0 and W=1 combination is illegal mask out W | |
// when R is cleared. | |
assign raw_wdata = dec_csr_wrdata_r[(entry_idx[1:0]*8)+7:(entry_idx[1:0]*8)+0]; |
// Operating privilege mode, 0 - machine, 1 - user | ||
logic priv_mode; | ||
// Effective privilege mode, 0 - machine, 1 - user (driven in el2_dec_tlu_ctl.sv) | ||
logic priv_mode_eff; | ||
// Next privilege mode | ||
logic priv_mode_ns; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[verible-verilog-format] reported by reviewdog 🐶
// Operating privilege mode, 0 - machine, 1 - user | |
logic priv_mode; | |
// Effective privilege mode, 0 - machine, 1 - user (driven in el2_dec_tlu_ctl.sv) | |
logic priv_mode_eff; | |
// Next privilege mode | |
logic priv_mode_ns; | |
// Operating privilege mode, 0 - machine, 1 - user | |
logic priv_mode; | |
// Effective privilege mode, 0 - machine, 1 - user (driven in el2_dec_tlu_ctl.sv) | |
logic priv_mode_eff; | |
// Next privilege mode | |
logic priv_mode_ns; |
Links to coverage and verification reports for this PR (#187) are available at https://chipsalliance.github.io/Cores-VeeR-EL2/ |
Internal-tag: [#57661] Signed-off-by: Maciej Kurc <[email protected]>
Internal-tag: [#57661] Signed-off-by: Maciej Kurc <[email protected]>
Internal-tag: [#57674] Signed-off-by: Maciej Kurc <[email protected]>
Internal-tag: [#57674] Signed-off-by: Maciej Kurc <[email protected]>
Internal-tag: [#57674] Signed-off-by: Maciej Kurc <[email protected]>
Internal-tag: [#57674] Signed-off-by: Maciej Kurc <[email protected]>
Internal-tag: [#57674] Signed-off-by: Maciej Kurc <[email protected]>
Internal-tag: [#57674] Signed-off-by: Maciej Kurc <[email protected]>
Internal-tag: [#57788] Signed-off-by: Maciej Kurc <[email protected]>
Internal-tag: [#57788] Signed-off-by: Maciej Kurc <[email protected]>
Internal-tag: [#57788] Signed-off-by: Maciej Kurc <[email protected]>
Internal-tag: [#57788] Signed-off-by: Maciej Kurc <[email protected]>
Internal-tag: [#57788] Signed-off-by: Maciej Kurc <[email protected]>
Internal-tag: [#57788] Signed-off-by: Maciej Kurc <[email protected]>
Internal-tag: [#57785] Signed-off-by: Maciej Kurc <[email protected]>
Internal-tag: [#58029] Signed-off-by: Maciej Kurc <[email protected]>
…y sizes Internal-tag: [#58029] Signed-off-by: Maciej Kurc <[email protected]>
… fail) Internal-tag: [#58029] Signed-off-by: Maciej Kurc <[email protected]>
… checking Internal-tag: [#58029] Signed-off-by: Maciej Kurc <[email protected]>
…pening Internal-tag: [#58273] Signed-off-by: Maciej Kurc <[email protected]>
Internal-tag: [#58273] Signed-off-by: Maciej Kurc <[email protected]>
…ardware interrupts Internal-tag: [#58169] Signed-off-by: Maciej Kurc <[email protected]>
Internal-tag: [#58150] Signed-off-by: Maciej Kurc <[email protected]>
Internal-tag: [#58150] Signed-off-by: Maciej Kurc <[email protected]>
Internal-tag: [#58150] Signed-off-by: Maciej Kurc <[email protected]>
Internal-tag: [#58150] Signed-off-by: Maciej Kurc <[email protected]>
Internal-tag: [#58150] Signed-off-by: Maciej Kurc <[email protected]>
Internal-tag: [#58150] Signed-off-by: Maciej Kurc <[email protected]>
Internal-tag: [#58150] Signed-off-by: Maciej Kurc <[email protected]>
Internal-tag: [#59770] Signed-off-by: Maciej Kurc <[email protected]>
Internal-tag: [#59770] Signed-off-by: Maciej Kurc <[email protected]>
Internal-tag: [#59770] Signed-off-by: Maciej Kurc <[email protected]>
Internal-tag: [#59770] Signed-off-by: Maciej Kurc <[email protected]>
…ons. Internal-tag: [#59770] Signed-off-by: Maciej Kurc <[email protected]>
Internal-tag: [#59770] Signed-off-by: Maciej Kurc <[email protected]>
Internal-tag: [#59770] Signed-off-by: Maciej Kurc <[email protected]>
Internal-tag: [#59770] Signed-off-by: Maciej Kurc <[email protected]>
Internal-tag: [#59770] Signed-off-by: Maciej Kurc <[email protected]>
Internal-tag: [#59770] Signed-off-by: Maciej Kurc <[email protected]>
Internal-tag: [#59770] Signed-off-by: Maciej Kurc <[email protected]>
Internal-tag: [#59770] Signed-off-by: Maciej Kurc <[email protected]>
Internal-tag: [#59770] Signed-off-by: Maciej Kurc <[email protected]>
Internal-tag: [#59770] Signed-off-by: Maciej Kurc <[email protected]>
…f priv_mode Internal-tag: [#59827] Signed-off-by: Maciej Kurc <[email protected]>
…s rights) Internal-tag: [#59827] Signed-off-by: Maciej Kurc <[email protected]>
Signed-off-by: Maciej Kurc <[email protected]>
4c8dacb
to
e65644b
Compare
Links to coverage and verification reports for this PR (#187) are available at https://chipsalliance.github.io/Cores-VeeR-EL2/ |
LGTM |
This PR adds User mode support to VeeR EL2 core. This implies also:
U
bit inmisa
mstatus
CSRECALL.U
instruction.mcounteren
CSR that controls access to counter shadow CSRsAlong with user mode support there's also extended PMP (Smepmp) support added.
Both user mode and Smepmp are disabled by default. They need to be enabled via
veer.config
script. To enable user mode append:to its invocation. And to enable Smepmp append:
With the PR there are new tests added that exercise new features.