Skip to content

Commit f4381fe

Browse files
authored
Describe how CMO instructions match triggers. (#821)
* Add inst, reg, and field macros. To help consistently format instructions, register names, and field names. * Describe how CMO instructions match triggers. See e-mail subject:"Sdtrig and CMO". * Rephrasing again. * Refine language. * Triggers only match CMOs when size=0 and select=0. Address must be base address or the passed address, but should be the address of every address in the affected cache lines. * Rephrase CMO address comparison. Refer to "virtual address covered by any of the affected cache lines." * Rephrase CMO trigger compare values again. * Rephrase which addresses are compare values for CMOs. * Don't try to account for virtual address aliasing.
1 parent 92bf5c6 commit f4381fe

File tree

2 files changed

+46
-2
lines changed

2 files changed

+46
-2
lines changed

Sdtrig.tex

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,47 @@ \subsection{Combined Accesses}
280280
loads of size SEW (selected element width), and {\tt cm.push} should be treated
281281
as if it performed multiple stores of size XLEN.
282282

283+
\subsection{Cache Operations}
284+
285+
\begin{steps}{
286+
Cache operations are infrequently performed, and code that uses them can have
287+
hard-to-find bugs. For the purposes of debug triggers, two classes of cache
288+
operations must match as stores:}
289+
\item Cache operations that enable software to maintain coherence between
290+
otherwise non-coherent implicit and explicit memory accesses.
291+
\item Cache operations that perform block writes of constant data.
292+
\end{steps}
293+
294+
\begin{steps}{Only triggers with \FcsrMcontrolSixSize=0 and
295+
\FcsrMcontrolSixSelect=0 will match. Since cache operations affect multiple
296+
addresses, there are multiple possible values to compare against.
297+
Implementations must implement one of the following options. From most
298+
desirable to least desirable, they are:}
299+
\item Every address from the effective address rounded down to the
300+
nearest cache block boundary (inclusive) to the effective address rounded up to
301+
the nearest cache block boundary (exclusive) is a compare value.
302+
\item The effective address rounded down to the nearest cache block boundary is a
303+
compare value.
304+
\item The effective address of the instruction is a compare value.
305+
\end{steps}
306+
307+
Cache operations encoded as HINTs do not match debug triggers.
308+
309+
\begin{commentary}
310+
The above language intends to capture the trigger behavior with respect to
311+
the cache operations to be introduced in a forthcoming I/D consistency
312+
extension.
313+
314+
\begin{steps}{For RISC-V Base Cache Management Operation ISA Extensions
315+
1.0.1, this means the following:}
316+
\item \inst{cbo.clean}, \inst{cbo.flush}, and \inst{cbo.inval} match as
317+
if they are stores because they affect consistency.
318+
\item \inst{cbo.zero} matches as if it is a store because it performs a
319+
block write of constant data.
320+
\item The prefetch instructions don't match at all.
321+
\end{steps}
322+
\end{commentary}
323+
283324
\section{Trigger Registers}
284325

285326
These registers are CSRs, accessible using the RISC-V {\tt csr} opcodes and

riscv-debug-spec.tex

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,11 @@
1717
\makeindex
1818

1919
\usepackage{xspace}
20-
\newcommand{\defregname}[2]{\providecommand{#1}{{\tt #2}\xspace}}
21-
\newcommand{\deffieldname}[2]{\providecommand{#1}{{$|#2|$}\xspace}}
20+
\newcommand{\inst}[1]{{\tt #1}\xspace}
21+
\newcommand{\reg}[1]{{\tt #1}\xspace}
22+
\newcommand{\field}[1]{{$|#1|$}\xspace}
23+
\newcommand{\defregname}[2]{\providecommand{#1}{\reg{#2}}}
24+
\newcommand{\deffieldname}[2]{\providecommand{#1}{\field{#2}}}
2225
\deffieldname{\FcsrMstatusMprv}{MPRV}
2326
\deffieldname{\FcsrMstatusMie}{MIE}
2427
\deffieldname{\FcsrSstatusSie}{SIE}

0 commit comments

Comments
 (0)