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
Address mismatch when reading the performance counters #158
Comments
Mhm, I see - definitely problematic. I think your proposed solution, to adjust the address offset by 3, works well for the moment. I would welcome a merge request ;-) |
msfschaffner
added a commit
to msfschaffner/ariane
that referenced
this issue
Jan 7, 2019
Thanks for pointing this one out. I pushed a slightly more generic fix that removes some redundant defines. |
msfschaffner
added a commit
that referenced
this issue
Jan 12, 2019
Fix for address offset issue (fix #158)
OttG
pushed a commit
to OttG/cva6
that referenced
this issue
Jul 6, 2021
OttG
pushed a commit
to OttG/cva6
that referenced
this issue
Jul 6, 2021
Fix for address offset issue (fix openhwgroup#158)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The issue comes from the
csr_regfile
module. This module addresses the CSR registers using the enumsriscv::CSR_XXXXX
, but in theperf_counters
module, the performance counters are addressed using the enumsriscv::PERF_XXXXX
.The
csr_regfile
passes the address to theperf_counters
as is, without modifying the actual value (output port calledperf_addr_o
):So for example, if we want to read the
L1_DCM
, theriscv::CSR_L1_DCACHE_MISS
value is 12'hC04, while theriscv::PERF_L1_DCACHE_MISS
is 1. The way how Ariane handles the performance counters is the following:When we wanna read a counter, as we are chosing only the 3 last bits from
addr_i
, its value, which is 12'hC04 is going to be 3'h4, and instead of reading theL1_DCM
which are stored in the position 1, we will be reading the counter in the position number 4, which isriscv::PERF_LOAD
. Note that theaddr_i
value comes from theperf_addr_o
output port of thecsr_regfile
module.An easy solution is to decrease the address in the
perf_counters
module:Or set the correct address value in the
csr_regfile
module:The text was updated successfully, but these errors were encountered: