Skip to content

Commit

Permalink
Allow invalid virtual addresses not to match at all
Browse files Browse the repository at this point in the history
  • Loading branch information
timsifive committed Nov 30, 2023
1 parent d497ba9 commit b138dee
Showing 1 changed file with 25 additions and 13 deletions.
38 changes: 25 additions & 13 deletions Sdtrig.tex
Original file line number Diff line number Diff line change
Expand Up @@ -321,23 +321,35 @@ \subsection{Cache Operations}

\subsection{Invalid Virtual Addresses}

For virtual address matches without a mask, \RcsrTdataTwo must be able to hold
all valid virtual addresses but it need not be capable of holding other values.
Implementations may convert an invalid virtual address to a different invalid
virtual address before comparing the address to \RcsrTdataTwo.
For address matches without a mask, \RcsrTdataTwo must be able to hold all valid
addresses in all supported translation modes. That means that after writing any
of these valid addresses, the exact same value is read back, including any high
bits.

\begin{commentary}
A straightforward trigger implementation would compare the effective address
to the contents of \RcsrTdataTwo. This is most intuitive to a user setting
triggers. However, the Privileged Spec makes various accommodations that
allow a shorter representation of invalid virtual addresses, and the Debug
Spec should do the same. If an implementation converts some invalid
addresses to other invalid addresses, then it is impossible to compare
against the original effective address. To simplify the spec and allow for
more implementations, we don't specify which version is compared for an
invalid virtual address.
If physical addresses are less than XLEN bits wide, they are zero-extended.
If virtual addresses are less than XLEN bits wide, they are sign-extended.
Be sure to have enough flops in \RcsrTdataTwo to hold all XLEN bits of the
full range of both physical and virtual addresses.
\end{commentary}

If \RcsrTdataTwo can hold any invalid addresses, then writes of an
invalid address that can not be represented as-is should be converted to
a different invalid address that can be represented.

For invalid instruction fetch and load and store effective addresses,
the compare value may be changed to a different invalid address.

\begin{commentary}
A straightforward trigger implementation would compare the instruction fetch
and load and store effective addresses to the contents of \RcsrTdataTwo.
This is most intuitive to a user setting triggers. Here we accommodate
implementations that internally shorten invalid addresses.
\end{commentary}

In addition, an implementation may choose to inhibit all trigger matching
against invalid addresses.

\section{Multiple State Change Instructions} \label{sec:multistate}

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

0 comments on commit b138dee

Please sign in to comment.