OpenCores
URL https://opencores.org/ocsvn/neorv32/neorv32/trunk

Subversion Repositories neorv32

[/] [neorv32/] [trunk/] [docs/] [datasheet/] [cpu_csr.adoc] - Diff between revs 73 and 74

Show entire file | Details | Blame | View Log

Rev 73 Rev 74
Line 302... Line 302...
| 0x305 | **Machine trap-handler base address** | `mtvec`
| 0x305 | **Machine trap-handler base address** | `mtvec`
3+| Reset value: _UNDEFINED_
3+| Reset value: _UNDEFINED_
3+| The `mtvec` CSR is compatible to the RISC-V specifications. It stores the base address for ALL machine
3+| The `mtvec` CSR is compatible to the RISC-V specifications. It stores the base address for ALL machine
traps. Thus, it defines the main entry point for exception/interrupt handling regardless of the actual trap
traps. Thus, it defines the main entry point for exception/interrupt handling regardless of the actual trap
source. The lowest two bits of this register are always zero and cannot be modified (= address mode only).
source. The lowest two bits of this register are always zero and cannot be modified (= address mode only).
 
Hence, the trap handler's base address has to be aligned to a 4-byte boundary.
|=======================
|=======================
 
 
.Machine trap-handler base address
.Machine trap-handler base address
[cols="^1,^1,<8"]
[cols="^1,^1,<8"]
[options="header",grid="rows"]
[options="header",grid="rows"]
Line 420... Line 421...
[frame="topbot",grid="none"]
[frame="topbot",grid="none"]
|=======================
|=======================
| 0x343 | **Machine bad address or instruction** | `mtval`
| 0x343 | **Machine bad address or instruction** | `mtval`
3+| Reset value: _UNDEFINED_
3+| Reset value: _UNDEFINED_
3+| The `mtval` CSR is compatible to the RISC-V specifications. When a trap is triggered, the CSR shows either
3+| The `mtval` CSR is compatible to the RISC-V specifications. When a trap is triggered, the CSR shows either
the faulting address (for misaligned/faulting load/stores/fetch) or the faulting instruction itself (for illegal
the faulting address (for misaligned/faulting load/store/fetch) or the faulting (decompressed) instruction word itself (for illegal
instructions). For interrupts the CSR is set to zero.
instructions). For all other exceptions (including interrupts) the CSR is set to zero.
|=======================
|=======================
 
 
.Machine bad address or instruction register
.Machine bad address or instruction register
[cols="^5,^5"]
[cols="^5,^5"]
[options="header",grid="rows"]
[options="header",grid="rows"]
|=======================
|=======================
| Trap cause | `mtval` content
| Trap cause | `mtval` content
| misaligned instruction fetch address or instruction fetch access fault | address of faulting instruction fetch
| misaligned instruction fetch address or instruction fetch access fault | address of faulting instruction fetch
| breakpoint | program counter (= address) of faulting instruction itself
| misaligned load address, load access fault, misaligned store address or store access fault | program counter (= address) of faulting instruction
| misaligned load address, load access fault, misaligned store address or store access fault | program counter (= address) of faulting instruction itself
| illegal instruction | actual instruction word of faulting instruction (decoded 32-bit instruction word if caused by a compressed instruction)
| illegal instruction | actual instruction word of faulting instruction
 
| anything else including interrupts | _0x00000000_ (always zero)
| anything else including interrupts | _0x00000000_ (always zero)
|=======================
|=======================
 
 
[IMPORTAN]
[IMPORTANT]
The NEORV32 `mtval` CSR is read-only. However, a write access will _NOT_ raise an illegal instruction exception.
The NEORV32 `mtval` CSR is read-only. However, a write access will _NOT_ raise an illegal instruction exception.
 
 
 
[NOTE]
 
In case an invalid compressed instruction raised an illegal instruction exception, `mtval` will show the
 
according de-compressed instruction word. To get the "real" 16-bit instruction that caused the exception
 
perform a memory load using the address stored in <<_mepc>>.
 
 
:sectnums!:
:sectnums!:
===== **`mip`**
===== **`mip`**
 
 
[cols="4,27,>7"]
[cols="4,27,>7"]
[frame="topbot",grid="none"]
[frame="topbot",grid="none"]

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.