-
Notifications
You must be signed in to change notification settings - Fork 85
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
Incorrect performance counter #139
Comments
qwe661234
added a commit
to qwe661234/rv32emu
that referenced
this issue
Jun 2, 2023
The issue occurs when the variable csr undergoes sign-extension. Specifically, the values of CSR_CYCLE and CSR_CYCLEH are assigned as 0xC00 and 0xC80 respectively. During the decoding immediate stage, these values are unintentionally sign-extended to 0xFFFFFX00 and 0xFFFFFC80. To mitigate this problem, a solution is only the last 12 bits of csr are considered, disregarding the sign extension. Solve: sysprog21#139
qwe661234
added a commit
to qwe661234/rv32emu
that referenced
this issue
Jun 2, 2023
The issue occurs when the variable csr undergoes sign-extension. Specifically, the values of CSR_CYCLE and CSR_CYCLEH are assigned as 0xC00 and 0xC80 respectively. During the decoding immediate stage, these values are unintentionally sign-extended to 0xFFFFFC00 and 0xFFFFFC80. To mitigate this problem, a solution is only the last 12 bits of csr are considered, disregarding the sign extension. Solve: sysprog21#139
2011eric
pushed a commit
to 2011eric/rv32emu
that referenced
this issue
Jul 22, 2023
The issue occurs when the CSR undergoes sign-extension. Specifically, the values of CSR_CYCLE and CSR_CYCLEH are assigned as 0xC00 and 0xC80 respectively. During the decoding immediate stage, these values are unintentionally sign-extended to 0xFFFFFC00 and 0xFFFFFC80. To mitigate this problem, a solution is only the last 12 bits of CSR are considered, disregarding the sign extension. Close sysprog21#139
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@ypaskell implemented a number of 64-bit read-only user-level counters, including
CSR_CYCLE
andCSR_CYCLEH
(#33).The procedure to validate:
Output:
However, in recent commits, both
CSR_CYCLE
andCSR_CYCLEH
fail to deliver the expected values.There is no increment for both cycle count and instret.
The text was updated successfully, but these errors were encountered: