coreblocks.priv package

Subpackages

Submodules

coreblocks.priv.pmp module

class coreblocks.priv.pmp.DynamicAreaPMPChecker

Bases: Elaboratable

Implementation of physical memory protection checker that checks permissions of an naturally aligned power-of-two physical address range.

__init__(gen_params: GenParams, *, mode: PMPOperationMode, size_classes: list[int]) None
Parameters:
mode: PMPOperationMode

How privilege level, for which access will be done, is found.

size_classes: list[int]

The log2 of power-of-two for which the checker can do the operations. The size_class signal selects the value from these.

paddr: Value

Memory address, for which PMP checks are requested. Must be aligned to the size class.

result: View

RWX permission bits for the given address based on current PMP configuration and privilege mode. Bits are set to 0 if access is denied. layout: PMPLayout

size_class: Value

The size class for which to check uniformity and attributes. See size_classes in constructor.

uniform: Value

Is the address range fully inside a single PMP entry.

class coreblocks.priv.pmp.PMPChecker

Bases: Elaboratable

Like DynamicAreaPMPChecker, but with constant access size.

__init__(gen_params: GenParams, *, mode: PMPOperationMode, access_size_log: int = 2) None
Parameters:
mode: PMPOperationMode

How privilege level, for which access will be done, is found.

access_size_log: int

The log2 of power-of-two for which the checker validates operations for.

paddr: Value

Memory address, for which PMP checks are requested.

result: View

RWX permission bits for the given address based on current PMP configuration and privilege mode. Bits are set to 0 if access is denied. layout: PMPLayout

uniform: Value

Is the address range fully inside a single PMP entry.

class coreblocks.priv.pmp.PMPLayout

Bases: StructLayout

__init__()
class coreblocks.priv.pmp.PMPLayoutFull

Bases: StructLayout

__init__()
class coreblocks.priv.pmp.PMPOperationMode

Bases: Enum

choice of the privilege mode of an access

INSTRUCTION_FETCH = 2

access is of the current privilege mode

LSU = 1

access is MPRV-aware - using MPP when MPRV=1, otherwise current privilege mode

MMU = 3

access is always generated by S-mode

Module contents