← Home

sctrctl

Supervisor Control Transfer Records Control Register

Address: 0x14E (334) · Privilege: S · Length: 64 · Writable · Defined by: Ssctr

The `sctrctl` register enables and configures the Control Transfer Records capability in S mode.

Fields

63:5655:4847:4039:3231:2423:1615:87:0
CUSTOM—DIRLJMPINHINDLJMPINHRETINHCORSWAPINHDIRJMPINHINDJMPINHDIRCALLINHINDCALLINH—TKBRINHNTBRENTRETINHINTRINHEXCINH—LCOFIFRZBPFRZ—STERASEMU—SU
BitsFieldAliasDescriptionTypeReset
[0]Umctrctl.UEnable transfer recording in the User mode.RWUNDEFINED_LEGAL
[1]Smctrctl.SEnable transfer recording in the Supervisor mode.RWUNDEFINED_LEGAL
[7]RASEMUmctrctl.RASEMUWhen set, it enables RAS (Return Address Stack) Emulation Mode.RWUNDEFINED_LEGAL
[8]STEmctrctl.STEEnables recording of traps to S-mode when S=0.RWUNDEFINED_LEGAL
[11]BPFRZmctrctl.BPFRZSet `sctrstatus.FROZEN` on a breakpoint exception that traps to M or S mode.RWUNDEFINED_LEGAL
[12]LCOFIFRZmctrctl.LCOFIFRZSet `sctrstatus.FROZEN` on local-counter-overflow interrupt (LCOFI) that traps to M or S mode.RWUNDEFINED_LEGAL
[33]EXCINHmctrctl.EXCINHWhen set, it inhibits recording of exceptions.RWUNDEFINED_LEGAL
[34]INTRINHmctrctl.INTRINHWhen set, it inhibits recording of interrupts.RWUNDEFINED_LEGAL
[35]TRETINHmctrctl.TRETINHWhen set, it inhibits recording of trap returns.RWUNDEFINED_LEGAL
[36]NTBRENmctrctl.NTBRENWhen set, it enables recording of not-taken branches.RWUNDEFINED_LEGAL
[37]TKBRINHmctrctl.TKBRINHWhen set, it inhibits recording of taken branches.RWUNDEFINED_LEGAL
[40]INDCALLINHmctrctl.INDCALLINHWhen set, it inhibits recording of indirect calls.RWUNDEFINED_LEGAL
[41]DIRCALLINHmctrctl.DIRCALLINHWhen set, it inhibits recording of direct calls.RWUNDEFINED_LEGAL
[42]INDJMPINHmctrctl.INDJMPINHWhen set, it inhibits recording of indirect jumps (without linkage).RWUNDEFINED_LEGAL
[43]DIRJMPINHmctrctl.DIRJMPINHWhen set, it inhibits recording of direct jumps (without linkage).RWUNDEFINED_LEGAL
[44]CORSWAPINHmctrctl.CORSWAPINHWhen set, it inhibits recording of co-routine swaps.RWUNDEFINED_LEGAL
[45]RETINHmctrctl.RETINHWhen set, it inhibits recording of function returns.RWUNDEFINED_LEGAL
[46]INDLJMPINHmctrctl.INDLJMPINHWhen set, it inhibits recording of other indirect jumps (with linkage).RWUNDEFINED_LEGAL
[47]DIRLJMPINHmctrctl.DIRLJMPINHWhen set, it inhibits recording of other direct jumps (with linkage).RWUNDEFINED_LEGAL
[63:60]CUSTOMmctrctl.CUSTOMWARL bits designated for custom use. The value 0 must correspond to standard behavior.RWUNDEFINED_LEGAL

Software read

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[mctrctl]) & 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.