From db608542d1c948e32092ca62efea3ed9c817ad45 Mon Sep 17 00:00:00 2001 From: ajalali Date: Fri, 26 Jan 2024 16:13:31 +0100 Subject: [PATCH 1/2] CSR TESTS : Remove MTVAL from csr embedded tests MTVAL isn't supported in embedded application Signed-off-by: ajalali --- verif/tests/custom/csr_embedded/csrcs_test.S | 48 ------------------- verif/tests/custom/csr_embedded/csrcsi_test.S | 38 --------------- .../custom/csr_embedded/csrrw_fields_test.S | 39 --------------- verif/tests/custom/csr_embedded/csrrw_test.S | 38 --------------- verif/tests/custom/csr_embedded/csrrwi_test.S | 33 ------------- 5 files changed, 196 deletions(-) diff --git a/verif/tests/custom/csr_embedded/csrcs_test.S b/verif/tests/custom/csr_embedded/csrcs_test.S index 6cef8c1192..3d26b2a492 100644 --- a/verif/tests/custom/csr_embedded/csrcs_test.S +++ b/verif/tests/custom/csr_embedded/csrcs_test.S @@ -1404,54 +1404,6 @@ csrcs: #MHPMCOUNTER13 read value csrr x14, 0xb0d - ########################## - #MTVAL testing W/R values '{'h1f, 'h0, 'h15, 'ha, 'h0} - ########################## - #MTVAL Write clear/set value 0x1f - li x3, 0xffffffe0 - csrrc x14, 0x343, x3 - li x3, 0x1f - csrrs x14, 0x343, x3 - - #MTVAL read value - csrr x14, 0x343 - - #MTVAL Write clear/set value 0x0 - li x3, 0xffffffff - csrrc x14, 0x343, x3 - li x3, 0x0 - csrrs x14, 0x343, x3 - - #MTVAL read value - csrr x14, 0x343 - - #MTVAL Write clear/set value 0x15 - li x3, 0xffffffea - csrrc x14, 0x343, x3 - li x3, 0x15 - csrrs x14, 0x343, x3 - - #MTVAL read value - csrr x14, 0x343 - - #MTVAL Write clear/set value 0xa - li x3, 0xfffffff5 - csrrc x14, 0x343, x3 - li x3, 0xa - csrrs x14, 0x343, x3 - - #MTVAL read value - csrr x14, 0x343 - - #MTVAL Write clear/set value 0x0 - li x3, 0xffffffff - csrrc x14, 0x343, x3 - li x3, 0x0 - csrrs x14, 0x343, x3 - - #MTVAL read value - csrr x14, 0x343 - ########################## #MHPMCOUNTER8 testing W/R values '{'h1f, 'h0, 'h15, 'ha, 'h1} ########################## diff --git a/verif/tests/custom/csr_embedded/csrcsi_test.S b/verif/tests/custom/csr_embedded/csrcsi_test.S index 5fd5fc3fbe..9c4775b1ad 100644 --- a/verif/tests/custom/csr_embedded/csrcsi_test.S +++ b/verif/tests/custom/csr_embedded/csrcsi_test.S @@ -2338,44 +2338,6 @@ csrcsi: #MHPMCOUNTER17 read value csrr x14, 0xb11 - ########################## - #MTVAL testing W/R values '{'h1f, 'h0, 'h15, 'ha, 'h1a} - ########################## - #MTVAL Write clear/set value 0x1f - csrrci x14, 0x343, 0x0 - csrrsi x14, 0x343, 0x1f - - #MTVAL read value - csrr x14, 0x343 - - #MTVAL Write clear/set value 0x0 - csrrci x14, 0x343, 0x1f - csrrsi x14, 0x343, 0x0 - - #MTVAL read value - csrr x14, 0x343 - - #MTVAL Write clear/set value 0x15 - csrrci x14, 0x343, 0xa - csrrsi x14, 0x343, 0x15 - - #MTVAL read value - csrr x14, 0x343 - - #MTVAL Write clear/set value 0xa - csrrci x14, 0x343, 0x15 - csrrsi x14, 0x343, 0xa - - #MTVAL read value - csrr x14, 0x343 - - #MTVAL Write clear/set value 0x1a - csrrci x14, 0x343, 0x5 - csrrsi x14, 0x343, 0x1a - - #MTVAL read value - csrr x14, 0x343 - ########################## #MHPMCOUNTERH6 testing W/R values '{'h1f, 'h0, 'h15, 'ha, 'h8} ########################## diff --git a/verif/tests/custom/csr_embedded/csrrw_fields_test.S b/verif/tests/custom/csr_embedded/csrrw_fields_test.S index da1316f3e9..90d899f705 100644 --- a/verif/tests/custom/csr_embedded/csrrw_fields_test.S +++ b/verif/tests/custom/csr_embedded/csrrw_fields_test.S @@ -5625,45 +5625,6 @@ csrrw_fields: #MHPMCOUNTERH5 read value csrr x14, 0xb85 - ########################## - #MTVAL fields testing W/R - ########################## - #MTVAL.MTVAL testing W/R values '{'hffffffff, 'h0, 'h55555555, 'haaaaaaaa, 'h4cdadc42} - #MTVAL Write value 0xffffffff - li x3, 0xffffffff - csrw 0x343, x3 - - #MTVAL read value - csrr x14, 0x343 - - #MTVAL Write value 0x0 - li x3, 0x0 - csrw 0x343, x3 - - #MTVAL read value - csrr x14, 0x343 - - #MTVAL Write value 0x55555555 - li x3, 0x55555555 - csrw 0x343, x3 - - #MTVAL read value - csrr x14, 0x343 - - #MTVAL Write value 0xaaaaaaaa - li x3, 0xaaaaaaaa - csrw 0x343, x3 - - #MTVAL read value - csrr x14, 0x343 - - #MTVAL Write value 0x4cdadc42 - li x3, 0x4cdadc42 - csrw 0x343, x3 - - #MTVAL read value - csrr x14, 0x343 - ########################## #MHPMEVENT14 fields testing W/R ########################## diff --git a/verif/tests/custom/csr_embedded/csrrw_test.S b/verif/tests/custom/csr_embedded/csrrw_test.S index aa6ab05987..e50aadfcc3 100644 --- a/verif/tests/custom/csr_embedded/csrrw_test.S +++ b/verif/tests/custom/csr_embedded/csrrw_test.S @@ -3488,44 +3488,6 @@ csrrw: #MHPMEVENT24 read value csrr x14, 0x338 - ########################## - #MTVAL testing W/R values '{'hffffffff, 'h0, 'h55555555, 'haaaaaaaa, 'hbec4a2c2} - ########################## - #MTVAL Write value 0xffffffff - li x3, 0xffffffff - csrw 0x343, x3 - - #MTVAL read value - csrr x14, 0x343 - - #MTVAL Write value 0x0 - li x3, 0x0 - csrw 0x343, x3 - - #MTVAL read value - csrr x14, 0x343 - - #MTVAL Write value 0x55555555 - li x3, 0x55555555 - csrw 0x343, x3 - - #MTVAL read value - csrr x14, 0x343 - - #MTVAL Write value 0xaaaaaaaa - li x3, 0xaaaaaaaa - csrw 0x343, x3 - - #MTVAL read value - csrr x14, 0x343 - - #MTVAL Write value 0xbec4a2c2 - li x3, 0xbec4a2c2 - csrw 0x343, x3 - - #MTVAL read value - csrr x14, 0x343 - ########################## #MHPMCOUNTERH29 testing W/R values '{'hffffffff, 'h0, 'h55555555, 'haaaaaaaa, 'h91d85d53} ########################## diff --git a/verif/tests/custom/csr_embedded/csrrwi_test.S b/verif/tests/custom/csr_embedded/csrrwi_test.S index aaaa5bd217..c8b46ff778 100644 --- a/verif/tests/custom/csr_embedded/csrrwi_test.S +++ b/verif/tests/custom/csr_embedded/csrrwi_test.S @@ -3359,39 +3359,6 @@ csrrwi: #MHPMEVENT9 read value csrr x14, 0x329 - ########################## - #MTVAL testing W/R values '{'h1f, 'h0, 'h15, 'ha, 'h4} - ########################## - #MTVAL Write immediate value 0x1f - csrrwi x14, 0x343, 0x1f - - #MTVAL read value - csrr x14, 0x343 - - #MTVAL Write immediate value 0x0 - csrrwi x14, 0x343, 0x0 - - #MTVAL read value - csrr x14, 0x343 - - #MTVAL Write immediate value 0x15 - csrrwi x14, 0x343, 0x15 - - #MTVAL read value - csrr x14, 0x343 - - #MTVAL Write immediate value 0xa - csrrwi x14, 0x343, 0xa - - #MTVAL read value - csrr x14, 0x343 - - #MTVAL Write immediate value 0x4 - csrrwi x14, 0x343, 0x4 - - #MTVAL read value - csrr x14, 0x343 - ########################## #MCYCLEH testing W/R values '{'h1f, 'h0, 'h15, 'ha, 'ha} ########################## From 252833648abbbf6d881517a94247e1273e4d2106 Mon Sep 17 00:00:00 2001 From: ajalali Date: Fri, 26 Jan 2024 16:14:11 +0100 Subject: [PATCH 2/2] CVA6 env : Remove MTVAL from CVA6 UVM env --- verif/env/uvme/reg/cva6_csr_reg_file.sv | 3 +-- verif/env/uvme/uvme_cva6_cfg.sv | 3 ++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/verif/env/uvme/reg/cva6_csr_reg_file.sv b/verif/env/uvme/reg/cva6_csr_reg_file.sv index 185b2f9d5f..94862a325a 100644 --- a/verif/env/uvme/reg/cva6_csr_reg_file.sv +++ b/verif/env/uvme/reg/cva6_csr_reg_file.sv @@ -2590,8 +2590,7 @@ class reg_mtval extends csr_reg; option.name = "csr_mtval__read_cg"; option.per_instance = 1; mtval: coverpoint data[31:0] { - bins ZERO[] = {0}; - bins other_values[3] = {[1:$]}; + bins reset_value = {0}; } endgroup diff --git a/verif/env/uvme/uvme_cva6_cfg.sv b/verif/env/uvme/uvme_cva6_cfg.sv index 08a60b4e7c..d17bf18f28 100644 --- a/verif/env/uvme/uvme_cva6_cfg.sv +++ b/verif/env/uvme/uvme_cva6_cfg.sv @@ -253,8 +253,9 @@ function void uvme_cva6_cfg_c::set_unsupported_csr_mask(); super.set_unsupported_csr_mask(); - // Remove unsupported CSRs for STEP1 configuration + // Remove unsupported CSRs for Embedded configuration unsupported_csr_mask[uvma_core_cntrl_pkg::MCOUNTINHIBIT] = 1; + unsupported_csr_mask[uvma_core_cntrl_pkg::MTVAL] = 1; endfunction : set_unsupported_csr_mask