CSR Bit Fields

RISC-V mpmpdeleg CSR Register

Address 0x316Privilege MachineAccess Machine RW / MXLENMachine physical memory protection CSRs

mpmpdeleg (0x316) is the MXLEN-bit machine CSR from the Frozen Smpmpdeleg extension; its WARL pmpnum field delegates PMP entries at and above that index as SPMP entries.

Field Map

Understand mpmpdeleg By Bit Fields

2 key fields
63:7

Reserved

WPRI

RV64 upper reserved range for future standard use; preserve when writing other fields and ignore on read.

Reserved (bits 63:7) — RV64 upper reserved range for future standard use; preserve when writing other fields and ignore on read.

What This Field Controls

  • - RV64 upper reserved range for future standard use; preserve when writing other fields and ignore on read.

Common Values

This field is better understood together with surrounding context than as a fixed memorized enumeration.

6:0

pmpnum

WARL

Delegation start index. PMP entries with indices >= pmpnum become SPMP entries; a write above the writable-entry count reads back as that count. An implementation may hardwire the partition, and non-writable entries behave as read-only zero.

pmpnum (bits 6:0) — Delegation start index. PMP entries with indices >= pmpnum become SPMP entries; a write above the writable-entry count reads back as that count. An implementation may hardwire the partition, and non-writable entries behave as read-only zero.

What This Field Controls

  • - Delegation start index. PMP entries with indices >= pmpnum become SPMP entries; a write above the writable-entry count reads back as that count. An implementation may hardwire the partition, and non-writable entries behave as read-only zero.

Common Values

0Delegate all

All PMP entries are delegated as SPMP entries; non-writable entries still behave as read-only zero.

N_writableDelegate none

When N_writable is the total writable PMP-entry count, no entries are delegated to SPMP, effectively disabling Sspmp; SPMP-related register accesses read zero and ignore writes.

Official Basis & Search Notes

mpmpdeleg.pmpnum is the PMP/SPMP boundary: lower-numbered entries remain PMP, entries starting at pmpnum are delegated as SPMP, and non-writable entries remain read-only zero.

Smpmpdeleg v0.9.2 defines address 0x316, MXLEN width, WPRI upper bits, and WARL pmpnum[6:0].
pmpnum=0 delegates every writable entry; the writable-entry count delegates none and effectively disables Sspmp.
A locked PMP entry constrains downward boundary movement, and role changes inherit old configuration.

What To Check First When Reading This CSR

  • - mpmpdeleg belongs to Smpmpdeleg, not Smepmp; the v0.9.2 specification is Frozen.
  • - Smpmpdeleg is mandatory for implementations supporting both Sspmp and Sm1p13 and depends on Smcsrind.
  • - Unless hardwired, pmpnum resets to the total writable PMP-entry count, meaning no entries are delegated by default.

Risk Checks Before Writing

  • - pmpnum cannot be set to a value less than or equal to the index of any locked PMP entry; such a write is ignored and the prior value is retained.
  • - Changing pmpnum makes entries inherit configuration from their former PMP/SPMP role; initialize affected configuration for the new role before writing the new value.

Put It Back Into A Real Flow

1

Read pmpnum and the implemented writable-entry count to determine the current PMP/SPMP boundary.

2

Initialize configuration for entries that will change roles before moving the boundary.

3

Write pmpnum and read back the WARL result, then use standard PMP CSRs or the xiselect indirect interface for their respective ranges.

FAQ

What does mpmpdeleg.pmpnum=0 mean?

It delegates all PMP entries as SPMP; non-writable entries still behave as read-only zero. Setting pmpnum to the writable PMP-entry count delegates none.