pmpaddr40
PMP Address 40
PMP entry address
Attributes
Defining Extension |
|
---|---|
CSR Address |
0x3d8 |
Length |
32 when CSR[misa].MXL == 0 64 when CSR[misa].MXL == 1 |
Privilege Mode |
M |
Format
This CSR format changes dynamically.
Figure 1. pmpaddr40 Format when CSR[misa].MXL == 0
Figure 2. pmpaddr40 Format when CSR[misa].MXL == 1
Field Summary
Name | Location | Type | Reset Value |
---|---|---|---|
* 31:0 when CSR[misa].MXL == 0 * 63:0 when CSR[misa].MXL == 1 |
[when,"(NUM_PMP_ENTRIES > 40)"] RW [when,"(NUM_PMP_ENTRIES ⇐ 40)"] RO |
[when,"(NUM_PMP_ENTRIES > 40)"] UNDEFINED_LEGAL [when,"(NUM_PMP_ENTRIES ⇐ 40)"] 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 > 40) { 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[pmpcfg10].pmp40cfg[4] == 1)) {
return CSR[pmpaddr40].ADDR | {PMP_GRANULARITY - 3{1'b1}};
} else if ((PMP_GRANULARITY >= 8) && (CSR[pmpcfg10].pmp40cfg[4] == 0)) {
Bits<PHYS_ADDR_WIDTH - 2> mask = {PMP_GRANULARITY - 2{1'b1}};
return CSR[pmpaddr40].ADDR & ~mask;
} else {
return CSR[pmpaddr40].ADDR;
}
} else {
if ((PMP_GRANULARITY >= 16) && (CSR[pmpcfg10].pmp40cfg[4] == 1)) {
return CSR[pmpaddr40].ADDR | {PMP_GRANULARITY - 3{1'b1}};
} else if ((PMP_GRANULARITY >= 8) && (CSR[pmpcfg10].pmp40cfg[4] == 0)) {
Bits<PHYS_ADDR_WIDTH - 2> mask = {PMP_GRANULARITY - 2{1'b1}};
return CSR[pmpaddr40].ADDR & ~mask;
} else {
return CSR[pmpaddr40].ADDR;
}
}