|
| 1 | +# yaml-language-server: $schema=../../schemas/csr_schema.json |
| 2 | + |
| 3 | +vstval: |
| 4 | + long_name: Virtual supervisor Trap Value |
| 5 | + address: 0x243 |
| 6 | + virtual_address: 0x143 |
| 7 | + description: Holds trap-specific information |
| 8 | + priv_mode: S |
| 9 | + length: VSXLEN |
| 10 | + definedBy: H |
| 11 | + fields: |
| 12 | + VALUE: |
| 13 | + location_rv32: 31-0 |
| 14 | + location_rv64: 63-0 |
| 15 | + description: | |
| 16 | + Written with trap-specific information when a trap is taken into VS-mode. |
| 17 | +
|
| 18 | + The values are: |
| 19 | +
|
| 20 | + !=== |
| 21 | + ! Exception type ! Value |
| 22 | +
|
| 23 | + ! [0] Instruction address misaligned ! The misaligned virtual PC (same as the value written to `mepc`). |
| 24 | + ! [1] Instruction access fault ! The <% if ext?(:C) %> portion of the <% end %> virtual PC causing the access fault <%- unless ext?(:C) -%>(same as the value written to `mepc`)<%- end -%>. |
| 25 | + ! [2] Illegal Instruction ! The encoding of the illegal instruction. |
| 26 | + ! [3] Breakpoint |
| 27 | + ! <%- if REPORT_VA_IN_STVAL_ON_BREAKPOINT -%> |
| 28 | + When caused by an EBREAK instruction, the virtual PC of the breakpoint instruction. |
| 29 | + <%- else -%> |
| 30 | + When caused by an EBREAK instruction, zero. |
| 31 | + <%- end -%> |
| 32 | +
|
| 33 | + When caused by a data address (_i.e._, watchpoint) breakpoint, the faulting virtual address. |
| 34 | + When caused by an instruction address breakpoint, the faulting virtual PC. |
| 35 | + ! [4] Load address misaligned ! The misaligned virtual load address. |
| 36 | + ! [5] Load access fault |
| 37 | + ! The part of virtual load address causing in the access fault. |
| 38 | +
|
| 39 | + When the load is misaligned, the reported value is the smallest address on the page causing a fault |
| 40 | + (_e.g._, if an 8-byte load is equally split across a page and the fault occurs on the second page, |
| 41 | + address + 4 is reported). |
| 42 | +
|
| 43 | + (Even though the access fault arises on a physical address, the virtual address is reported) |
| 44 | + ! [6] Store/AMO address misaligned ! The misaligned virtual store/AMO address. |
| 45 | + ! [7] Store/AMO access fault |
| 46 | + ! The virtual store/AMO address causing the access fault. |
| 47 | + |
| 48 | + When the store/AMO is misaligned, the reported value is the smallest address on the page causing a fault |
| 49 | + (_e.g._, if an 8-byte store is equally split across a page and the fault occurs on the second page, |
| 50 | + address + 4 is reported). |
| 51 | +
|
| 52 | + (Even though the access fault arises on a physical address, the virtual address is reported) |
| 53 | + ! [8] Environment call from U-mode <% if ext?(:H) %>or VU-mode<% end %> ! Zero |
| 54 | + ! [9] Environment call from (H)S-mode ! Zero |
| 55 | + <%- if ext?(:H) -%> |
| 56 | + ! [10] Environment call from VS-mode ! Zero |
| 57 | + <%- end -%> |
| 58 | + ! [12] Instruction page fault |
| 59 | + ! The <% if ext?(:C) %> portion of the <% end %> virtual PC causing the page fault |
| 60 | + <% unless ext?(:C) %>(same as the value written to `mepc`)<% end %>. |
| 61 | + ! [13] Load page fault |
| 62 | + ! The part of the virtual load address causing in the page fault. |
| 63 | + |
| 64 | + When the load is misaligned, the reported value is the smallest address on the page causing a fault |
| 65 | + (_e.g._, if an 8-byte load is equally split across a page and the fault occurs on the second page, address + 4 is reported). |
| 66 | + ! [15] Store/AMO page fault |
| 67 | + ! The virtual store/AMO address causing in the page fault. |
| 68 | + |
| 69 | + When the store/AMO is misaligned, the reported value is the smallest address on the page causing a fault |
| 70 | + (_e.g._, if an 8-byte store is equally split across a page and the fault occurs on the second page, address + 4 is reported). |
| 71 | + <%- if ext?(:H) -%> |
| 72 | + ! [20] Instruction guest-page fault |
| 73 | + ! The <% if ext?(:C) %> portion of the <% end %> virtual PC causing the fault <% unless ext?(:C) %>(same as the value written to `mepc`)<% end %>. |
| 74 | + |
| 75 | + The guest physical address is reported in `mtval2`. |
| 76 | + ! [21] Load guest-page fault |
| 77 | + ! The part of the virtual address causing the fault. |
| 78 | +
|
| 79 | + When the load is misaligned, the reported value is the smallest address on the page causing a fault |
| 80 | + (_e.g._, if an 8-byte load is equally split across a page and the fault occurs on the second page, address + 4 is reported). |
| 81 | + |
| 82 | + The guest physical address is reported in `mtval2`. |
| 83 | + ! [22] Virutal instruction |
| 84 | + ! The encoding of the faulting virtual instruction. |
| 85 | + ! [23] Store/AMO guest-page fault |
| 86 | + ! The part of the virtual address causing the fault. |
| 87 | + |
| 88 | + When the store/AMO is misaligned, the reported value is the smallest address on the page causing a fault |
| 89 | + (_e.g._, if an 8-byte store is equally split across a page and the fault occurs on the second page, address + 4 is reported). |
| 90 | + |
| 91 | + The guest physical address is reported in `htval`. |
| 92 | + <%- end -%> |
| 93 | + !=== |
| 94 | +
|
| 95 | + type: RW-H |
| 96 | + reset_value: 0 |
0 commit comments