aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKrste Asanovic <krste@eecs.berkeley.edu>2018-08-26 16:51:28 -0700
committerKrste Asanovic <krste@eecs.berkeley.edu>2018-08-26 16:51:28 -0700
commitcac9ad6fedf57a0cff22caa5e9b8252a7290cb5d (patch)
treee9d0ce1f262e9f2139786f8d37afac785f4d0710 /src
parent4cc3c1e5b4241b0fbbd36b85f54b6a02218ee421 (diff)
downloadriscv-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.
Diffstat (limited to 'src')
-rw-r--r--src/csr.tex15
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