rtlpy.design.memory.Field

class rtlpy.design.memory.Field(name: str, size: int = 1, access: AccessType = AccessType.READ_ONLY, reset: int = 0, volatile: bool = False, randomizable: bool = True, reserved: bool = False)

Bases: object

Class which represents a Field within a Register for a MemoryMap

__init__(name: str, size: int = 1, access: AccessType = AccessType.READ_ONLY, reset: int = 0, volatile: bool = False, randomizable: bool = True, reserved: bool = False) None

Methods

__init__(name[, size, access, reset, ...])

from_dict(definition)

Converts the dictionary definition into a Field object.

valid()

Checks the Field is validly defined

Attributes

access

Access Policy of the Field

randomizable

Whether the field can be randomized

reserved

Whether the field is a reserved field

reset

The reset value of the field

size

Size of the field in bits

volatile

Whether the value of field is volatile

name

Field name

access: AccessType = 'RO'

Access Policy of the Field

static from_dict(definition: dict) Field

Converts the dictionary definition into a Field object. Requires the following keys: [name] Accepts the optional keys: [size, lsb_pos, access, reset, volatile, randomizable]

Parameters:

definition (dict) – The definition of the field in dictionary form

Raises:

MissingDefinitionException – Raised when a required key is missing from the definition

Returns:

The field derived from the definition

Return type:

Field

name: str

Field name

randomizable: bool = True

Whether the field can be randomized

reserved: bool = False

Whether the field is a reserved field

reset: int = 0

The reset value of the field

size: int = 1

Size of the field in bits

valid() bool

Checks the Field is validly defined

Returns:

Returns true if the Field is valid. False otherwise

Return type:

bool

volatile: bool = False

Whether the value of field is volatile