Commit 206094b
authored
Fix incorrect performance counter (#140)
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 #1391 parent bc07e87 commit 206094b
1 file changed
+2
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
123 | 123 | | |
124 | 124 | | |
125 | 125 | | |
126 | | - | |
| 126 | + | |
| 127 | + | |
127 | 128 | | |
128 | 129 | | |
129 | 130 | | |
| |||
0 commit comments