Jump Via Table with Optional Link
Read an address from the Jump Vector Table and jump to it, linking to `ra`.
cm.jalt index
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | 0 | 1 | 000 | index | 1 | 0 | |||||||||
| Variable | Bits | Width |
|---|---|---|
index | [9:2] | 8 |
# Ensure JVT readable
check_zcmt_enabled($encoding);
if (CSR[jvt].MODE != 0) {
raise(ExceptionCode::IllegalInstruction, mode(), $encoding);
}
# Skip over _this_ 16-bit instruction
XReg return_addr = $pc + 2;
X[1] = return_addr;
XReg jump_table_base = { CSR[jvt].BASE, 6'b000000 };
XReg virtual_address = jump_table_base + index `* (xlen() / 8);
XReg addr;
TranslationResult result;
# TODO: Correct this check when we figure out what MISA can do
if (CSR[misa].S == 1) {
result = translate(virtual_address, MemoryOperation::Fetch, mode(), $encoding);
} else {
result.paddr = virtual_address;
}
# may raise an exception
access_check(result.paddr, xlen(), $pc, MemoryOperation::Fetch, ExceptionCode::InstructionAccessFault, mode());
if (xlen() == 32) {
addr = read_physical_memory(32, result.paddr);
} else {
addr = read_physical_memory(64, result.paddr);
} # Ensure low-order bit is clear
addr = addr & $signed(2'b10);
jump(addr);
Zcmt
| S | U | VS | VU |
|---|---|---|---|
| Always | Always | Always | Always |
Version af3eaf9+cheriot.f635218
Data from the RISC-V Unified Database, copyright RISC-V International and contributors.
CHERIoT extensions from the CHERIoT specification and Sail model, copyright Microsoft and the CHERIoT Platform contributors.
This site is provided as a community resource and is NOT affiliated with nor endorsed by RISC-V International.