Virtual Supervisor Control Transfer Records Control Register
The `vsctrctl` register is a VS-mode's version of supervisor register `sctrctl` that configures the Control Transfer Records capability. When `V=1`, vsctrctl substitutes for the usual `sctrctl`, so instructions that normally read or modify `sctrctl` actually access `vsctrctl` instead.
| 63:56 | 55:48 | 47:40 | 39:32 | 31:24 | 23:16 | 15:8 | 7:0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| CUSTOM | — | DIRLJMPINH | INDLJMPINH | RETINH | CORSWAPINH | DIRJMPINH | INDJMPINH | DIRCALLINH | INDCALLINH | — | TKBRINH | NTBREN | TRETINH | INTRINH | EXCINH | — | LCOFIFRZ | BPFRZ | — | STE | RASEMU | — | S | U | |||||||||||||||||||||||||||||||||||||||
| Bits | Field | Alias | Description | Type | Reset |
|---|---|---|---|---|---|
| [0] | U | sctrctl.U | Enable transfer recording in the VU mode. | RW | UNDEFINED_LEGAL |
| [1] | S | sctrctl.S | Enable transfer recording in the VS mode. | RW | UNDEFINED_LEGAL |
| [7] | RASEMU | mctrctl.RASEMU | When set, it enables RAS (Return Address Stack) Emulation Mode. | RW | UNDEFINED_LEGAL |
| [8] | STE | mctrctl.STE | Enables recording of traps to VS-mode when S=0. | RW | UNDEFINED_LEGAL |
| [11] | BPFRZ | mctrctl.BPFRZ | Set `sctrstatus.FROZEN` on a breakpoint exception that traps to VS mode. | RW | UNDEFINED_LEGAL |
| [12] | LCOFIFRZ | mctrctl.LCOFIFRZ | Set `sctrstatus.FROZEN` on local-counter-overflow interrupt (LCOFI) that traps to VS mode. | RW | UNDEFINED_LEGAL |
| [33] | EXCINH | mctrctl.EXCINH | When set, it inhibits recording of exceptions. | RW | UNDEFINED_LEGAL |
| [34] | INTRINH | mctrctl.INTRINH | When set, it inhibits recording of interrupts. | RW | UNDEFINED_LEGAL |
| [35] | TRETINH | mctrctl.TRETINH | When set, it inhibits recording of trap returns. | RW | UNDEFINED_LEGAL |
| [36] | NTBREN | mctrctl.NTBREN | When set, it enables recording of not-taken branches. | RW | UNDEFINED_LEGAL |
| [37] | TKBRINH | mctrctl.TKBRINH | When set, it inhibits recording of taken branches. | RW | UNDEFINED_LEGAL |
| [40] | INDCALLINH | mctrctl.INDCALLINH | When set, it inhibits recording of indirect calls. | RW | UNDEFINED_LEGAL |
| [41] | DIRCALLINH | mctrctl.DIRCALLINH | When set, it inhibits recording of direct calls. | RW | UNDEFINED_LEGAL |
| [42] | INDJMPINH | mctrctl.INDJMPINH | When set, it inhibits recording of indirect jumps (without linkage). | RW | UNDEFINED_LEGAL |
| [43] | DIRJMPINH | mctrctl.DIRJMPINH | When set, it inhibits recording of direct jumps (without linkage). | RW | UNDEFINED_LEGAL |
| [44] | CORSWAPINH | mctrctl.CORSWAPINH | When set, it inhibits recording of co-routine swaps. | RW | UNDEFINED_LEGAL |
| [45] | RETINH | mctrctl.RETINH | When set, it inhibits recording of function returns. | RW | UNDEFINED_LEGAL |
| [46] | INDLJMPINH | mctrctl.INDLJMPINH | When set, it inhibits recording of other indirect jumps (with linkage). | RW | UNDEFINED_LEGAL |
| [47] | DIRLJMPINH | mctrctl.DIRLJMPINH | When set, it inhibits recording of other direct jumps (with linkage). | RW | UNDEFINED_LEGAL |
| [63:60] | CUSTOM | mctrctl.CUSTOM | WARL bits designated for custom use. The value 0 must correspond to standard behavior. | RW | UNDEFINED_LEGAL |
Bits<12> addr = 0x14E;
Bits<64> mask = 0x00000000000803; # U, S, and BPFRZ are not optional
Csr csr_handle = direct_csr_lookup(addr);
if (!csr_handle.valid) {
unimplemented_csr($encoding);
}
if (MCTRCTL_RASEMU_IMPLEMENTED) {
mask = mask | (1 `<< 7);
}
if (MCTRCTL_STE_IMPLEMENTED) {
mask = mask | (1 `<< 8);
}
if (MCTRCTL_MTE_IMPLEMENTED) {
mask = mask | (1 `<< 9);
}
if (implemented?(ExtensionName::Sscofpmf)) {
mask = mask | (1 `<< 12);
}
if (MCTRCTL_EXCINH_IMPLEMENTED) {
mask = mask | (1 `<< 33);
}
if (MCTRCTL_INTRINH_IMPLEMENTED) {
mask = mask | (1 `<< 34);
}
if (MCTRCTL_TRETINH_IMPLEMENTED) {
mask = mask | (1 `<< 35);
}
if (MCTRCTL_NTBREN_IMPLEMENTED) {
mask = mask | (1 `<< 36);
}
if (MCTRCTL_TKBRINH_IMPLEMENTED) {
mask = mask | (1 `<< 37);
}
if (MCTRCTL_INDCALLINH_IMPLEMENTED) {
mask = mask | (1 `<< 40);
}
if (MCTRCTL_DIRCALLINH_IMPLEMENTED) {
mask = mask | (1 `<< 41);
}
if (MCTRCTL_INDJMPINH_IMPLEMENTED) {
mask = mask | (1 `<< 42);
}
if (MCTRCTL_DIRJMPINH_IMPLEMENTED) {
mask = mask | (1 `<< 43);
}
if (MCTRCTL_CORSWAPINH_IMPLEMENTED) {
mask = mask | (1 `<< 44);
}
if (MCTRCTL_RETINH_IMPLEMENTED) {
mask = mask | (1 `<< 45);
}
if (MCTRCTL_INDLJMPINH_IMPLEMENTED) {
mask = mask | (1 `<< 46);
}
if (MCTRCTL_DIRLJMPINH_IMPLEMENTED) {
mask = mask | (1 `<< 47);
}
if (MCTRCTL_CUSTOM_IMPLEMENTED) {
mask = mask | (4'b1111 `<< 60);
}
return ($bits(CSR[vsctrctl]) & mask);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.