Skip to content

Add JVT CSR #782

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 18 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions arch/csr/jvt.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# yaml-language-server: $schema=../../schemas/csr_schema.json

$schema: "csr_schema.json#"
kind: csr
name: jvt
long_name: Table Jump Base Vector and Control Register
address: 0x017
description:
- id: csr-jvt-purpose
normative: true
text: |
The `jvt` register is an XLEN-bit WARL read/write register that holds the jump table configuration,
consisting of the jump table base address (BASE) and the jump table mode (MODE).
- id: csr-jvt-architectural
normative: false
text: |
`jvt` CSR adds architectural state to the system software context (such as an OS process), therefore
must be saved/restored on context switches.
priv_mode: U
length: XLEN
definedBy: Zcmt
fields:
BASE:
location_rv64: 63-6
location_rv32: 31-6
description: |
The value in the BASE field must always be aligned on a 64-byte boundary. Note that the CSR contains only
bits XLEN-1 through 6 of the address base. When computing jump-table accesses, the lower six bits of base
are filled with zeroes to obtain an XLEN-bit jump-table base address `jvt.base` that is always aligned on a
64-byte boundary.

`jvt.base` is a virtual address, whenever virtual memory is enabled.

The memory pointed to by `jvt.base` is treated as instruction memory for the purpose of executing table
jump instructions, implying execute access permission.
type: RW
reset_value: UNDEFINED_LEGAL
MODE:
location_rv64: 5-0
location_rv32: 5-0
description: |
`jvt.mode` is a WARL field, so can only be programmed to modes which are implemented. Therefore the
discovery mechanism is to attempt to program different modes and read back the values to see which
are available. Jump table mode must be implemented.
type: RW
reset_value: UNDEFINED_LEGAL
Loading