pmpaddr2

PMP Address 2

PMP entry address

Attributes

Defining Extension

  • Smpmp, version >= 0

CSR Address

0x3b2

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 2
(or, if pmp3cfg.A == TOR, for PMP entry 3).

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 > 2) {
  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[pmpcfg0].pmp2cfg[4] == 1)) {
    return CSR[pmpaddr2].ADDR | {PMP_GRANULARITY - 3{1'b1}};
  } else if ((PMP_GRANULARITY >= 8) && (CSR[pmpcfg0].pmp2cfg[4] == 0)) {
    Bits<PHYS_ADDR_WIDTH - 2> mask = {PMP_GRANULARITY - 2{1'b1}};
    return CSR[pmpaddr2].ADDR & ~mask;
  } else {
    return CSR[pmpaddr2].ADDR;
  }
} else {
  if ((PMP_GRANULARITY >= 16) && (CSR[pmpcfg0].pmp2cfg[4] == 1)) {
    return CSR[pmpaddr2].ADDR | {PMP_GRANULARITY - 3{1'b1}};
  } else if ((PMP_GRANULARITY >= 8) && (CSR[pmpcfg0].pmp2cfg[4] == 0)) {
    Bits<PHYS_ADDR_WIDTH - 2> mask = {PMP_GRANULARITY - 2{1'b1}};
    return CSR[pmpaddr2].ADDR & ~mask;
  } else {
    return CSR[pmpaddr2].ADDR;
  }
}