Skip to content

[Bug Report] Out of bound array access #884

Closed
@chenc6

Description

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
image

outofrange.zip

Metadata

Assignees

Labels

Component:RTLFor issues in the RTL (e.g. for files in the rtl directory)PARAM:PERFCOUNTERPerformance counterStatus:NewNewly created issue, nobody has looked at it yet.Type:BugFor bugs in the RTL, Documentation, Verification environment or Tool and Build system

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions