DFRegisterGroup¶
DFRegisterGroup represents a named collection of DFRegisters that are related in some manner - for example a register block could be split into separate groups for controlling power state and for driving the block’s “mission” mode. The group has an offset property, that defines the base address of the group within the overall register bank.
As with every tag, DFRegisterGroup inherits from DFBase, so has support for all of the core attributes (id, description, and attributes).
{
"id": "my_reg_group",
"description": "Free-form description",
"attributes": { },
"offset": 256,
"registers": [ ]
}
| Property | Usage |
|---|---|
| offset | Specifies the base address of the group relative to the start of the register bank |
| registers | List of DFRegisters that form this group |
Python API¶
-
class
designformat.register_group.DFRegisterGroup(id=None, offset=0, block=None, description=None)¶ DesignFormat representation of a named group of registers
-
__getattribute__(key)¶ By overriding __getattribute__ we can expose all registers as if they were first class attributes of this object. Note that this code prioritises true class properties.
-
__init__(id=None, offset=0, block=None, description=None)¶ Constructor for the register group object.
- Parameters
id – Name of the group
offset – Offset from the register bank’s base address
block – The DFBlock which is holding this register group
description – Human-readable description of this group
-
addRegister(reg)¶ Add a new register and sort the list by ascending address
- Parameters
reg – The register to add
-
dumpObject(project)¶ Dump out this node so that it can be reloaded
- Parameters
project – Project definition used to calculate references
-
getOffset()¶ Return this register group’s offset
-
loadObject(obj, root)¶ Reload this node from passed in object.
- Parameters
obj – Description of this node
root – Root object in the tree
-
sortRegisters()¶ Ensures the register list is in acsending address order and checks that there are no overlaps.
-
Javascript API¶
-
class
DFRegisterGroup(id, offset, block, description)¶ DesignFormat representation of a named group of registers
Constructor for the register group object.
- Arguments
id (string) – Name of the group
offset (integer) – Offset from the register bank’s base address
block (DFBlock) – The DFBlock which is holding this register group
description (string) – Human-readable description of this group
-
DFRegisterGroup.addRegister(reg)¶ Add a new register and sort the list by ascending address
- Arguments
reg (DFRegister) – The register to add
-
DFRegisterGroup.dumpObject(project)¶ Dump out this node so that it can be reloaded
- Arguments
project (DFProject) – Project definition used to calculate references
-
DFRegisterGroup.getOffset()¶ Return this register group’s offset
-
DFRegisterGroup.loadObject(obj, root, types)¶ Reload this node from passed in object.
- Arguments
obj (object) – Description of this node
root (DFBase) – Root object in the tree
types (object) – Map from class name to class definition
-
DFRegisterGroup.sortRegisters()¶ Ensures the register list is in acsending address order and checks that there are no overlaps.