|
| 1 | +# yaml-language-server: $schema=../../../schemas/csr_schema.json |
| 2 | +$schema: csr_schema.json# |
| 3 | +kind: csr |
| 4 | +name: mcyclecfg |
| 5 | +long_name: Machine Cycle Counter Configuration |
| 6 | +address: 0x321 |
| 7 | +priv_mode: M |
| 8 | +length: 64 |
| 9 | +definedBy: Smcntrpmf |
| 10 | +description: | |
| 11 | + The `mcyclecfg` CSR is a 64-bit machine-level register that configures privilege |
| 12 | + mode filtering for the cycle counter. Each inhibit bit (xINH) suppresses |
| 13 | + counting of events in the corresponding privilege mode when set. |
| 14 | +
|
| 15 | + | Field | Description | |
| 16 | + |---------|---------------------------------------------------------| |
| 17 | + | MINH | If set, then counting of events in M-mode is inhibited. | |
| 18 | + | SINH | If set, then counting of events in S/HS-mode is inhibited. | |
| 19 | + | UINH | If set, then counting of events in U-mode is inhibited. | |
| 20 | + | VSINH | If set, then counting of events in VS-mode is inhibited. | |
| 21 | + | VUINH | If set, then counting of events in VU-mode is inhibited. | |
| 22 | +
|
| 23 | + When all xINH bits are zero, event counting is enabled in all modes. |
| 24 | +
|
| 25 | + For each bit in 61:58, if the associated privilege mode is not implemented, |
| 26 | + the bit is read-only zero. |
| 27 | +
|
| 28 | + Bit 63 is hardwired to 0, as these counters do not generate overflow interrupts. |
| 29 | +
|
| 30 | + Bits [57:0] are reserved (WPRI) and read as zero. |
| 31 | +
|
| 32 | + For RV32, the upper 32 bits of `mcyclecfg` are accessed via `mcyclecfgh` (CSR 0x721). |
| 33 | +
|
| 34 | + Note: Although CSR address 0x320 would have been a more natural choice, |
| 35 | + it is already allocated to `mcountinhibit`. |
| 36 | +
|
| 37 | +fields: |
| 38 | + MINH: |
| 39 | + location: 62 |
| 40 | + base: 64 |
| 41 | + type: RW |
| 42 | + definedBy: M |
| 43 | + description: If set, then counting of events in M-mode is inhibited. |
| 44 | + reset_value: UNDEFINED_LEGAL |
| 45 | + |
| 46 | + SINH: |
| 47 | + location: 61 |
| 48 | + base: 64 |
| 49 | + type: RW |
| 50 | + definedBy: S |
| 51 | + description: If set, then counting of events in S/HS-mode is inhibited. |
| 52 | + reset_value: UNDEFINED_LEGAL |
| 53 | + |
| 54 | + UINH: |
| 55 | + location: 60 |
| 56 | + base: 64 |
| 57 | + type: RW |
| 58 | + definedBy: U |
| 59 | + description: If set, then counting of events in U-mode is inhibited. |
| 60 | + reset_value: UNDEFINED_LEGAL |
| 61 | + |
| 62 | + VSINH: |
| 63 | + location: 59 |
| 64 | + base: 64 |
| 65 | + type: RW |
| 66 | + definedBy: H |
| 67 | + description: If set, then counting of events in VS-mode is inhibited. |
| 68 | + reset_value: UNDEFINED_LEGAL |
| 69 | + |
| 70 | + VUINH: |
| 71 | + location: 58 |
| 72 | + base: 64 |
| 73 | + type: RW |
| 74 | + definedBy: H |
| 75 | + description: If set, then counting of events in VU-mode is inhibited. |
| 76 | + reset_value: UNDEFINED_LEGAL |
0 commit comments