← Home

pmpaddr40

PMP Address 40

Address: 0x3D8 (984) · Privilege: M · Length: MXLEN · Writable · Defined by: Sm and NUM_PMP_ENTRIES > 16

PMP entry address

Fields

RV32

31:2423:1615:87:0
ADDR

RV64

63:5655:4847:4039:3231:2423:1615:87:0
ADDR
BitsFieldAliasDescriptionTypeReset
RV32 [31:0]
RV64 [63:0]
ADDRBits PHYS_ADDR_WIDTH-1:2 of the address specifier for PMP entry 40 (or, if `pmp41cfg.A` == TOR, for PMP entry 41).
if (NUM_USABLE_PMP_ENTRIES > 40) {
  return CsrFieldType::RW;
} else {
  # entry is either not implemented or implemented as read-only zero
  return CsrFieldType::RO;
}
return 0;

Software read

# when the mode is NAPOT and PMP_GRANULARITY >= 4,
# bits (PMP_GRANULARITY-4):0 must read as ones
if (MXLEN == 32) {
  if ((PMP_GRANULARITY >= 4) &&
      (CSR[pmpcfg10].pmp40cfg[4] == 1)) {
    return CSR[pmpaddr40].ADDR | {PMP_GRANULARITY-3{1'b1}};

  # when the mode is OFF or TOR and PMP_GRANULARITY >= 3,
  # bits (PMP_GRANULARITY-3):0 must read as zeros
  } else if ((PMP_GRANULARITY >= 3) &&
              (CSR[pmpcfg10].pmp40cfg[4] == 0)) {
    Bits<PHYS_ADDR_WIDTH-2> mask = {PMP_GRANULARITY-2{1'b1}};
    return CSR[pmpaddr40].ADDR & ~mask;

  # no modifications needed
  } else {
    return CSR[pmpaddr40].ADDR;
  }
} else {
  if ((PMP_GRANULARITY >= 4) &&
      (CSR[pmpcfg10].pmp40cfg[4] == 1)) {
    return CSR[pmpaddr40].ADDR | {PMP_GRANULARITY-3{1'b1}};

  # when the mode is OFF or TOR and PMP_GRANULARITY >= 3,
  # bits (PMP_GRANULARITY-3):0 must read as zeros
  } else if ((PMP_GRANULARITY >= 3) &&
              (CSR[pmpcfg10].pmp40cfg[4] == 0)) {
    Bits<PHYS_ADDR_WIDTH-2> mask = {PMP_GRANULARITY-2{1'b1}};
    return CSR[pmpaddr40].ADDR & ~mask;

  # no modifications needed
  } else {
    return CSR[pmpaddr40].ADDR;
  }
}

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.