Commit 6418433
committed
[rtl] Fix incrementing
According to the Specification Section 6.1 CSR Instructions:
Some CSRs, such as the instructions-retired counter, instret, may be
modified as side effects of instruction execution. In these cases, if a
CSR access instruction reads a CSR, it reads the value prior to the
execution of the instruction. If a CSR access instruction writes such a
CSR, the explicit write is done instead of the update from the side
effect. In particular, a value written to instret by one instruction
will be the value read by the following instruction.minstret after setting it1 parent b7d62a2 commit 6418433
1 file changed
Lines changed: 8 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1076 | 1076 | | |
1077 | 1077 | | |
1078 | 1078 | | |
1079 | | - | |
| 1079 | + | |
| 1080 | + | |
| 1081 | + | |
| 1082 | + | |
| 1083 | + | |
| 1084 | + | |
| 1085 | + | |
1080 | 1086 | | |
1081 | | - | |
| 1087 | + | |
1082 | 1088 | | |
1083 | 1089 | | |
1084 | 1090 | | |
| |||
0 commit comments