pmpaddr17

PMP Address 17

PMP entry address

Attributes

Defining Extension

  • Smpmp, version >= 0

CSR Address

0x3c1

Length

32-bit

64-bit

Privilege Mode

M

Format

This CSR format changes dynamically.

svg
svg

Field Summary

Name Location Type Reset Value

ADDR

63:0

RW
RO
UNDEFINED_LEGAL
0

Fields

ADDR

Location

63:0

Description

Bits PHYS_ADDR_WIDTH-1:2 of the address specifier for PMP entry 17
(or, if pmp18cfg.A == TOR, for PMP entry 18).

Type
RW
RO
Reset value
UNDEFINED_LEGAL
0

Software write

This CSR may store a value that is different from what software attempts to write.

When a software write occurs (e.g., through csrrw), the following determines the written value:

ADDR = if (csr_value.ADDR >= (PHYS_ADDR_WIDTH >> 2)) {
  return UNDEFINED_LEGAL_DETERMINISTIC;
} else if (NUM_PMP_ENTRIES > 17) {
  return UNDEFINED_LEGAL_DETERMINISTIC;
} else {
  return csr_value.ADDR;
}

Software read

This CSR may return a value that is different from what is stored in hardware.

if (XLEN == 32) {
  if ((PMP_GRANULARITY >= 16) && (CSR[pmpcfg4].pmp17cfg[4] == 1)) {
    return CSR[pmpaddr17].ADDR | {PMP_GRANULARITY - 3{1'b1}};
  } else if ((PMP_GRANULARITY >= 8) && (CSR[pmpcfg4].pmp17cfg[4] == 0)) {
    Bits<PHYS_ADDR_WIDTH - 2> mask = {PMP_GRANULARITY - 2{1'b1}};
    return CSR[pmpaddr17].ADDR & ~mask;
  } else {
    return CSR[pmpaddr17].ADDR;
  }
} else {
  if ((PMP_GRANULARITY >= 16) && (CSR[pmpcfg4].pmp17cfg[4] == 1)) {
    return CSR[pmpaddr17].ADDR | {PMP_GRANULARITY - 3{1'b1}};
  } else if ((PMP_GRANULARITY >= 8) && (CSR[pmpcfg4].pmp17cfg[4] == 0)) {
    Bits<PHYS_ADDR_WIDTH - 2> mask = {PMP_GRANULARITY - 2{1'b1}};
    return CSR[pmpaddr17].ADDR & ~mask;
  } else {
    return CSR[pmpaddr17].ADDR;
  }
}