Skip to content

Commit 359bedc

Browse files
authored
Invalid addresses might not match. (#911)
* Clarify matching on invalid virtual addresses behavior See: * https://lists.riscv.org/g/tech-debug/message/1407 * https://lists.riscv.org/g/tech-debug/files/meetings%202023/2023-01-10%20Debug%20Task%20Group%20Call%20Notes.pdf * https://lists.riscv.org/g/tech-debug/files/meetings%202023/2023-01-10%20Debug%20Task%20Group%20Call%20Slides.pdf * Allow invalid addresses not to match at all. Also clarify tdata2 requirements for triggers that are only used for address matches.
1 parent 40b9a05 commit 359bedc

File tree

2 files changed

+29
-12
lines changed

2 files changed

+29
-12
lines changed

Sdtrig.tex

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,35 @@ \subsection{Cache Operations}
319319
\end{steps}
320320
\end{commentary}
321321

322+
\subsection{Address Matches}
323+
324+
For address matches without a mask, \RcsrTdataTwo must be able to hold all valid
325+
addresses in all supported translation modes. That means that after writing any
326+
of these valid addresses, the exact same value XLEN-wide value is read back,
327+
including any high bits. An implementation may be able to optimize the storage
328+
required, depending on the widest addresses it supports.
329+
330+
\begin{commentary}
331+
If physical addresses are less than XLEN bits wide, they are zero-extended.
332+
If virtual addresses are less than XLEN bits wide, they are sign-extended.
333+
\RcsrTdataTwo must be implemented with enough bits of storage to represent
334+
the full range of supported physical and virtual address values when read by
335+
software and used by hardware.
336+
\end{commentary}
337+
338+
\subsubsection{Invalid Addresses}
339+
340+
If \RcsrTdataTwo can hold any invalid addresses, then writes of an
341+
invalid address that can not be represented as-is should be converted to
342+
a different invalid address that can be represented.
343+
344+
For invalid instruction fetch addresses and load and store effective addresses,
345+
the compare value may be changed to a different invalid address.
346+
347+
In addition, an implementation may choose to inhibit all trigger matching
348+
against invalid addresses, especially if there is no support for storage of any
349+
invalid address values in tdata2.
350+
322351
\section{Multiple State Change Instructions} \label{sec:multistate}
323352

324353
An instruction that performs multiple architectural state changes (e.g.,

xml/hwbp_registers.xml

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -325,12 +325,6 @@
325325
Table~\ref{tab:hwbp_timing}, both timings should be supported on load
326326
address triggers.
327327

328-
This trigger type may be limited to address comparisons (\FcsrMcontrolSelect is
329-
always 0) only. If that is the case and masking is not supported (match
330-
values 4, 5, 12, 13), then \RcsrTdataTwo must be able to
331-
hold all valid virtual addresses but it need not be capable of holding
332-
other values.
333-
334328
The Privileged Spec says that breakpoint exceptions that occur on
335329
instruction fetches, loads, or stores update the {\tt tval} CSR
336330
with either zero or the faulting virtual address. The faulting
@@ -685,12 +679,6 @@
685679
A chain of triggers must only fire if every trigger in the chain was
686680
matched by the same instruction.
687681

688-
This trigger type may be limited to address comparisons (\FcsrMcontrolSixSelect is
689-
always 0) only. If that is the case and masking is not supported (match
690-
values 4, 5, 12, 13), then \RcsrTdataTwo must be able to
691-
hold all valid virtual addresses but it need not be capable of holding
692-
other values.
693-
694682
The Privileged Spec says that breakpoint exceptions that occur on
695683
instruction fetches, loads, or stores update the {\tt tval} CSR
696684
with either zero or the faulting virtual address. The faulting

0 commit comments

Comments
 (0)