30#ifndef __ARCH_RISCV_PMP_HH__
31#define __ARCH_RISCV_PMP_HH__
38#include "params/PMP.hh"
139 bool pmpUpdateCfg(uint32_t pmp_index, uint8_t this_cfg);
Defines global host-dependent types: Counter, Tick, and (indirectly) {int,uint}{8,...
The AddrRange class encapsulates an address range, and supports a number of tests to check if two ran...
This class helps to implement RISCV's physical memory protection (pmp) primitive.
const uint8_t PMP_LOCK
pmpcfg address range locked mask
const uint8_t PMP_WRITE
pmpcfg address range write permission mask
int pmpEntries
maximum number of entries in the pmp table
const uint8_t PMP_A_MASK
pmpcfg A field mask
void pmpUpdateRule(uint32_t pmp_index)
pmpUpdateRule updates the pmp rule for a given pmp entry depending on the value of pmpaddr and pmpcfg...
const uint8_t PMP_READ
pmpcfg address range read permission mask
int numRules
variable to keep track of active number of rules any time
bool hasLockEntry
variable to keep track of any lock of entry
AddrRange pmpDecodeNapot(Addr pmpaddr)
This function decodes a pmpaddr register value into an address range when A field of pmpcfg register ...
pmpAmatch
This enum is used for encoding of address matching mode of pmp address register, which is present in ...
bool pmpUpdateAddr(uint32_t pmp_index, Addr this_addr)
pmpUpdateAddr updates the pmpaddr for a pmp entry and calls pmpUpdateRule to update the rule of corre...
std::vector< PmpEntry > pmpTable
a table of pmp entries
Fault createAddrfault(Addr vaddr, BaseMMU::Mode mode)
createAddrfault creates an address fault if the pmp checks fail to pass for a given access.
bool pmpUpdateCfg(uint32_t pmp_index, uint8_t this_cfg)
pmpUpdateCfg updates the pmpcfg for a pmp entry and calls pmpUpdateRule to update the rule of corresp...
void pmpReset()
pmpReset reset when reset signal in trigger from CPU.
uint8_t pmpGetAField(uint8_t cfg)
pmpGetAField extracts the A field (address matching mode) from an input pmpcfg register
const uint8_t PMP_EXEC
pmpcfg address range execute permission mask
Fault pmpCheck(const RequestPtr &req, BaseMMU::Mode mode, RiscvISA::PrivilegeMode pmode, ThreadContext *tc, Addr vaddr=0)
pmpCheck checks if a particular memory access is allowed based on the pmp rules.
bool shouldCheckPMP(RiscvISA::PrivilegeMode pmode, ThreadContext *tc)
This function is called during a memory access to determine if the pmp table should be consulted for ...
Abstract superclass for simulation objects.
ThreadContext is the external interface to all thread state for anything outside of the CPU.
const Params & params() const
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
std::shared_ptr< FaultBase > Fault
std::shared_ptr< Request > RequestPtr
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Declaration of the Packet class.
Addr rawAddr
raw addr in pmpaddr register for a pmp entry
AddrRange pmpAddr
addr range corresponding to a single pmp entry
uint8_t pmpCfg
pmpcfg reg value for a pmp entry