Skip to content

Commit 6c257cd

Browse files
committed
Added more details on exception, debug, bus error handling and added err signal on result interface
Signed-off-by: Arjan Bink <[email protected]>
1 parent a3bcdd7 commit 6c257cd

File tree

1 file changed

+21
-2
lines changed

1 file changed

+21
-2
lines changed

docs/source/x_ext.rst

+21-2
Original file line numberDiff line numberDiff line change
@@ -673,6 +673,11 @@ In case of a synchronous exception or debug trigger match with *before* timing n
673673
A synchronous exception will lead to a trap in |processor| unless the corresponding instruction is killed. ``exccode`` provides the least significant bits of the exception
674674
code bitfield of the ``mcause`` CSR. Similarly a debug trigger match with *before* timing will lead to debug mode entry in |processor| unless the corresponding instruction is killed.
675675

676+
A |coprocessor| shall take care that an instruction that causes ``exc`` = 1 or ``dbg`` = 1 does not cause (|coprocessor| local) side effects that are prohibited in the context of synchronous
677+
exceptions or debug trigger match with * before* timing. Furthermore, if a result interface handshake will occur for this same instruction, then the ``exc``, ``exccode`` and ``dbg`` information shall be passed onto that handshake as well. It is the responsibility of the |processor| to make sure that (precise) synchronous exception entry and debug entry with *before* timing
678+
is achieved (possibly by killing following instructions that either are already offloaded or are in its own pipeline). A |coprocessor| shall not itself use the ``exc`` or ``dbg`` information to
679+
kill following instructions in its pipeline.
680+
676681
The signals in ``mem_resp`` are valid when ``mem_valid`` and ``mem_ready`` are both 1. There are no stability requirements.
677682

678683
If ``mem_resp`` relates to an instruction that has been killed, then the |processor| is allowed to signal any value in ``mem_resp`` and the |coprocessor| shall ignore the value received via ``mem_resp``.
@@ -724,9 +729,15 @@ No memory result transaction is performed for instructions that led to a synchro
724729
Otherwise, one memory result transaction is performed per memory (request/response) transaction (even for killed instructions).
725730

726731
Memory result transactions are provided by the |processor| in the same order (with matching ``id``) as the memory (request/response) transactions are received. The ``err`` signal
727-
signals whether a bus error occurred. If so, then an NMI is signaled, just like for bus errors caused by non-offloaded loads and stores. The ``dbg`` signal
732+
signals whether a bus error occurred. The ``dbg`` signal
728733
signals whether a debug trigger match with *before* timing occurred ``rdata`` (for a read transaction only).
729734

735+
A |coprocessor| shall take care that an instruction that causes ``dbg`` = 1 does not cause (|coprocessor| local) side effects that are prohibited in the context of
736+
debug trigger match with * before* timing. A |coprocessor| is allowed to treat ``err`` = 1 as an imprecise exception (i.e. it is not mandatory to prevent (|coprocessor| local)
737+
side effects based on the ``err`` signal).
738+
Furthermore, if a result interface handshake will occur for this same instruction, then the ``err`` and ``dbg`` information shall be passed onto that handshake as well. It is the responsibility of the |processor| to make sure that (precise) debug entry with *before* timing is achieved (possibly by killing following instructions that either are already offloaded or are in its own pipeline). Upon receiving ``err`` = 1 via the result interface handshake the |processor| shall signal an (imprecise) NMI.
739+
A |coprocessor| shall not itself use the ``err`` or ``dbg`` information to kill following instructions in its pipeline.
740+
730741
If ``mem_result`` relates to an instruction that has been killed, then the |processor| is allowed to signal any value in ``mem_result`` and the |coprocessor| shall ignore the value received via ``mem_result``.
731742

732743
From a |processor|'s point of view each memory request transaction has an associated memory result transaction (except if a synchronous exception or debug trigger match with *before* timing
@@ -795,17 +806,25 @@ for instructions that have been killed.
795806
+---------------+---------------------------------+-----------------------------------------------------------------------------------------------------------------+
796807
| ``dbg`` | logic | Did the instruction cause a debug trigger match with ``mcontrol.timing`` = 0? |
797808
+---------------+---------------------------------+-----------------------------------------------------------------------------------------------------------------+
809+
| ``err`` | logic | Did the instruction cause a bus error? |
810+
+---------------+---------------------------------+-----------------------------------------------------------------------------------------------------------------+
798811

799812
A result transaction starts in the cycle that ``result_valid`` = 1 and ends in the cycle that both ``result_valid`` = 1 and ``result_ready`` = 1. The signals in ``result`` are
800813
valid when ``result_valid`` is 1. The signals in ``result`` shall remain stable during a result transaction, except that ``data`` is only required to remain stable during
801814
result transactions in which ``we`` is not 0.
802815

803816
The ``exc`` is used to signal synchronous exceptions.
804-
A synchronous exception will lead to a trap in |processor|. ``exccode`` provides the least significant bits of the exception
817+
A synchronous exception shall lead to a trap in the |processor| (unless ``dbg`` = 1 at the same time). ``exccode`` provides the least significant bits of the exception
805818
code bitfield of the ``mcause`` CSR. ``we`` shall be driven to 0 by the |coprocessor| for synchronous exceptions.
819+
The |processor| shall kill potentially already offloaded instructions to guarantee precise exception behavior.
820+
821+
The ``err`` is used to signal a bus error.
822+
A bus error shall lead to an (imprecise) NMI in the |processor|.
806823

807824
The ``dbg`` is used to signal a debug trigger match with ``mcontrol.timing`` = 0. This signal is only used to signal debug trigger matches received earlier via
808825
a corresponding memory (request/response) transaction or memory request transaction.
826+
The trigger match shall lead to a debug entry in the |processor|.
827+
The |processor| shall kill potentially already offloaded instructions to guarantee precise debug entry behavior.
809828

810829
``we`` is 2 bits wide when ``XLEN`` = 32 and ``X_RFW_WIDTH`` = 64, and 1 bit wide otherwise. If ``we`` is 2 bits wide, then ``we[1]`` is only allowed to be 1 if ``we[0]`` is 1 as well (i.e. for
811830
dual writeback).

0 commit comments

Comments
 (0)