Skip to content

Commit 2bc2ed4

Browse files
Fixes Entry0 of interrupt vector table
1 parent 2a9f3c6 commit 2bc2ed4

File tree

1 file changed

+19
-3
lines changed

1 file changed

+19
-3
lines changed

doc/03_reference/exception_interrupts.rst

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Exceptions and Interrupts
44
=========================
55

6-
Ibex implements trap handling for interrupts and exceptions according to the `RISC-V Privileged Specification, version 20211203 <https://drive.google.com/file/d/1EMip5dZlnypTk7pt4WWUKmtjUKTOkBqh/view>`.
6+
Ibex implements trap handling for interrupts and exceptions according to the `RISC-V Privileged Specification, version 20211203 <https://drive.google.com/file/d/1EMip5dZlnypTk7pt4WWUKmtjUKTOkBqh/view>`_.
77

88
When entering an interrupt/exception handler, the core sets the ``mepc`` CSR to the current program counter and saves ``mstatus``.MIE to ``mstatus``.MPIE.
99
All exceptions cause the core to jump to the base address of the vector table in the ``mtvec`` CSR.
@@ -171,13 +171,29 @@ Interrupt vector table
171171
----------------------
172172

173173
The interrupt vector table is located at ``mtvec``, and each entry can contain the code for
174-
the interrupt/exception handling. The following table indicates the offset of the entry and
174+
the interrupt/exception handling.
175+
176+
177+
When MODE=Direct, all traps into machine mode cause the pc to be set to the address in the BASE field.
178+
179+
When MODE=Vectored,
180+
181+
all synchronous exceptions into machine mode cause the pc to be set to the address in the BASE
182+
field,
183+
184+
whereas interrupts cause the pc to be set to the address in the BASE field plus four times the
185+
interrupt cause number.
186+
187+
188+
From `RISC-V Privileged Specification, version 20211203, page 30 <https://drive.google.com/file/d/1EMip5dZlnypTk7pt4WWUKmtjUKTOkBqh/view>`_.
189+
190+
The following table indicates the offset of the entry and
175191
its description.
176192

177193
+-------------------------+------------------------------------------------------------+
178194
| offset in bytes | Description |
179195
+=========================+============================================================+
180-
| 0x00 | Boot |
196+
| 0x00 | Exception |
181197
+-------------------------+------------------------------------------------------------+
182198
| 0x04 | reserved |
183199
+-------------------------+------------------------------------------------------------+

0 commit comments

Comments
 (0)