|
| 1 | +# Copyright (c) Muhammad Abdullah — 10xEngineers |
| 2 | +# SPDX-License-Identifier: BSD-3-Clause-Clear |
| 3 | + |
| 4 | +# yaml-language-server: $schema=../../../../schemas/csr_schema.json |
| 5 | + |
| 6 | +$schema: csr_schema.json# |
| 7 | +kind: csr |
| 8 | +name: sctrctl |
| 9 | +long_name: Supervisor Control Transfer Records Control Register |
| 10 | +address: 0x14E |
| 11 | +writable: true |
| 12 | +priv_mode: S |
| 13 | +length: 64 |
| 14 | +definedBy: Smctr |
| 15 | +description: The `sctrctl` register enables and configures the Control Transfer Records capability in S mode. |
| 16 | +fields: |
| 17 | + U: |
| 18 | + location: 0 |
| 19 | + type: RW |
| 20 | + alias: mctrctl.U |
| 21 | + reset_value: UNDEFINED_LEGAL |
| 22 | + description: | |
| 23 | + Enable transfer recording in the User mode. |
| 24 | + S: |
| 25 | + location: 1 |
| 26 | + type: RW |
| 27 | + alias: mctrctl.S |
| 28 | + reset_value: UNDEFINED_LEGAL |
| 29 | + description: | |
| 30 | + Enable transfer recording in the Supervisor mode. |
| 31 | + RASEMU: |
| 32 | + location: 7 |
| 33 | + type: RW |
| 34 | + alias: mctrctl.RASEMU |
| 35 | + reset_value: UNDEFINED_LEGAL |
| 36 | + description: | |
| 37 | + When set, it enables RAS (Return Address Stack) Emulation Mode. |
| 38 | + STE: |
| 39 | + location: 8 |
| 40 | + type: RW |
| 41 | + alias: mctrctl.STE |
| 42 | + reset_value: UNDEFINED_LEGAL |
| 43 | + description: | |
| 44 | + Enables recording of traps to S-mode when S=0. |
| 45 | + BPFRZ: |
| 46 | + location: 11 |
| 47 | + type: RW |
| 48 | + alias: mctrctl.BPFRZ |
| 49 | + reset_value: UNDEFINED_LEGAL |
| 50 | + description: | |
| 51 | + Set `sctrstatus.FROZEN` on a breakpoint exception that traps to M or S mode. |
| 52 | + LCOFIFRZ: |
| 53 | + location: 12 |
| 54 | + type: RW |
| 55 | + alias: mctrctl.LCOFIFRZ |
| 56 | + reset_value: UNDEFINED_LEGAL |
| 57 | + description: | |
| 58 | + Set `sctrstatus.FROZEN` on local-counter-overflow interrupt (LCOFI) that traps |
| 59 | + to M or S mode. |
| 60 | + definedBy: Sscofpmf |
| 61 | + EXCINH: |
| 62 | + location: 33 |
| 63 | + type: RW |
| 64 | + alias: mctrctl.EXCINH |
| 65 | + reset_value: UNDEFINED_LEGAL |
| 66 | + description: | |
| 67 | + When set, it inhibits recording of exceptions. |
| 68 | + INTRINH: |
| 69 | + location: 34 |
| 70 | + type: RW |
| 71 | + alias: mctrctl.INTRINH |
| 72 | + reset_value: UNDEFINED_LEGAL |
| 73 | + description: | |
| 74 | + When set, it inhibits recording of interrupts. |
| 75 | + TRETINH: |
| 76 | + location: 35 |
| 77 | + type: RW |
| 78 | + alias: mctrctl.TRETINH |
| 79 | + reset_value: UNDEFINED_LEGAL |
| 80 | + description: | |
| 81 | + When set, it inhibits recording of trap returns. |
| 82 | + NTBREN: |
| 83 | + location: 36 |
| 84 | + type: RW |
| 85 | + alias: mctrctl.NTBREN |
| 86 | + reset_value: UNDEFINED_LEGAL |
| 87 | + description: | |
| 88 | + When set, it enables recording of not-taken branches. |
| 89 | + TKBRINH: |
| 90 | + location: 37 |
| 91 | + type: RW |
| 92 | + alias: mctrctl.TKBRINH |
| 93 | + reset_value: UNDEFINED_LEGAL |
| 94 | + description: | |
| 95 | + When set, it inhibits recording of taken branches. |
| 96 | + INDCALLINH: |
| 97 | + location: 40 |
| 98 | + type: RW |
| 99 | + alias: mctrctl.INDCALLINH |
| 100 | + reset_value: UNDEFINED_LEGAL |
| 101 | + description: | |
| 102 | + When set, it inhibits recording of indirect calls. |
| 103 | + DIRCALLINH: |
| 104 | + location: 41 |
| 105 | + type: RW |
| 106 | + alias: mctrctl.DIRCALLINH |
| 107 | + reset_value: UNDEFINED_LEGAL |
| 108 | + description: | |
| 109 | + When set, it inhibits recording of direct calls. |
| 110 | + INDJMPINH: |
| 111 | + location: 42 |
| 112 | + type: RW |
| 113 | + alias: mctrctl.INDJMPINH |
| 114 | + reset_value: UNDEFINED_LEGAL |
| 115 | + description: | |
| 116 | + When set, it inhibits recording of indirect jumps (without linkage). |
| 117 | + DIRJMPINH: |
| 118 | + location: 43 |
| 119 | + type: RW |
| 120 | + alias: mctrctl.DIRJMPINH |
| 121 | + reset_value: UNDEFINED_LEGAL |
| 122 | + description: | |
| 123 | + When set, it inhibits recording of direct jumps (without linkage). |
| 124 | + CORSWAPINH: |
| 125 | + location: 44 |
| 126 | + type: RW |
| 127 | + alias: mctrctl.CORSWAPINH |
| 128 | + reset_value: UNDEFINED_LEGAL |
| 129 | + description: | |
| 130 | + When set, it inhibits recording of co-routine swaps. |
| 131 | + RETINH: |
| 132 | + location: 45 |
| 133 | + type: RW |
| 134 | + alias: mctrctl.RETINH |
| 135 | + reset_value: UNDEFINED_LEGAL |
| 136 | + description: | |
| 137 | + When set, it inhibits recording of function returns. |
| 138 | + INDLJMPINH: |
| 139 | + location: 46 |
| 140 | + type: RW |
| 141 | + alias: mctrctl.INDLJMPINH |
| 142 | + reset_value: UNDEFINED_LEGAL |
| 143 | + description: | |
| 144 | + When set, it inhibits recording of other indirect jumps (with linkage). |
| 145 | + DIRLJMPINH: |
| 146 | + location: 47 |
| 147 | + type: RW |
| 148 | + alias: mctrctl.DIRLJMPINH |
| 149 | + reset_value: UNDEFINED_LEGAL |
| 150 | + description: | |
| 151 | + When set, it inhibits recording of other direct jumps (with linkage). |
| 152 | + CUSTOM: |
| 153 | + location: 63-60 |
| 154 | + type: RW |
| 155 | + alias: mctrctl.CUSTOM |
| 156 | + reset_value: UNDEFINED_LEGAL |
| 157 | + description: | |
| 158 | + WARL bits designated for custom use. The value 0 must correspond to standard behavior. |
| 159 | +sw_read(): | |
| 160 | + Bits<12> sctrctl_addr = 0x14E; |
| 161 | + Bits<64> sctrctl_mask = 0x787F9F80000DC3; |
| 162 | + Csr csr_handle = direct_csr_lookup(sctrctl_addr); |
| 163 | + if (!csr_handle.valid) { |
| 164 | + unimplemented_csr($encoding); |
| 165 | + } |
| 166 | + return (CSR[mctrctl] & sctrctl_mask); |
0 commit comments