diff options
author | Krste Asanovic <krste@eecs.berkeley.edu> | 2018-08-26 16:51:28 -0700 |
---|---|---|
committer | Krste Asanovic <krste@eecs.berkeley.edu> | 2018-08-26 16:51:28 -0700 |
commit | cac9ad6fedf57a0cff22caa5e9b8252a7290cb5d (patch) | |
tree | e9d0ce1f262e9f2139786f8d37afac785f4d0710 | |
parent | 4cc3c1e5b4241b0fbbd36b85f54b6a02218ee421 (diff) | |
download | riscv-isa-manual-cac9ad6fedf57a0cff22caa5e9b8252a7290cb5d.zip riscv-isa-manual-cac9ad6fedf57a0cff22caa5e9b8252a7290cb5d.tar.gz riscv-isa-manual-cac9ad6fedf57a0cff22caa5e9b8252a7290cb5d.tar.bz2 |
Clarified description of CSR writes to counters per Nikhil's suggestion.
-rw-r--r-- | src/csr.tex | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/csr.tex b/src/csr.tex index 1d02710..932b450 100644 --- a/src/csr.tex +++ b/src/csr.tex @@ -93,14 +93,13 @@ CSRRWI, if {\em rd}={\tt x0}, then the instruction shall not read the CSR and shall not cause any of the side-effects that might occur on a CSR read. -Some CSRs, such as the instructions retired counter, {\tt 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 a CSR, the update occurs -after the execution of the instruction. In particular, a value written to -{\tt instret} by one instruction will be the value read by the following -instruction (i.e., the increment of {\tt instret} caused by the first -instruction retiring happens before the write of the new value). +Some CSRs, such as the instructions-retired counter, {\tt 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 write is done instead of the +increment. In particular, a value written to {\tt instret} by one +instruction will be the value read by the following instruction. The assembler pseudoinstruction to read a CSR, CSRR {\em rd, csr}, is encoded as CSRRS {\em rd, csr, x0}. The assembler pseudoinstruction |