Skip to content
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

[BUG] Inhibition of cycle counter #1742

Closed
1 task done
Tiago-R opened this issue Jan 2, 2024 · 1 comment · Fixed by #1743
Closed
1 task done

[BUG] Inhibition of cycle counter #1742

Tiago-R opened this issue Jan 2, 2024 · 1 comment · Fixed by #1743
Assignees
Labels
PARAM:CSR CSR Type:Bug For bugs in the RTL, Documentation, Verification environment or Tool and Build system

Comments

@Tiago-R
Copy link

Tiago-R commented Jan 2, 2024

Is there an existing CVA6 bug for this?

  • I have searched the existing bug issues

Bug Description

Hello!
I found that the current implementation of the performance counter inhibition for the cycle counter does not actually inhibit the mcycle CSR increment every cycle but simple writes to it the value of the instruction retired count.

There might be a reason for this behavior to be desirable but it does not seem to follow the RISC-V specification.

cva6/core/csr_regfile.sv

Lines 571 to 572 in 2708df9

if (!mcountinhibit_q[0]) cycle_d = cycle_q + 1'b1;
else cycle_d = instret;

@Tiago-R Tiago-R added the Type:Bug For bugs in the RTL, Documentation, Verification environment or Tool and Build system label Jan 2, 2024
@JeanRochCoulon
Copy link
Contributor

Thanks. You are right. I submitted a PR to fix it ( #1743 )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PARAM:CSR CSR Type:Bug For bugs in the RTL, Documentation, Verification environment or Tool and Build system
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants