cva6
cva6 copied to clipboard
[Bug Report] Out of bound array access
Hi,
CVA6 RTL is returning unknown value ("xxxxxxxx") when reading the value of MHPMCOUNTER30. This is happening because the csr reg data (csr_rdata) is being read from perf_counter_d array in the perf_counters.sv module with an array index outside its range. The range of perf_counter_d is [riscv::CSR_MIF_EMPTY : riscv::CSR_ML1_ICACHE_MISS] (line:46 from perf_counter.sv file), but in line: 282 of csv_regfile.sv we are using the array to access array index riscv::CSR_MHPM_COUNTER_30, which is greater than the range of [riscv::CSR_MIF_EMPTY : riscv::CSR_ML1_ICACHE_MISS].
Please find attached the triggering input mem file, spike_trace_log, and cva6_trace_log. We can see from the line:83 of cva6 trace log that the read data is xxxxxxxx
