!Group¶
The !Group tag declares a register group - a collection of registers that can be instantiated as a single object within a register set, with the position of the group within the set being controlled by the !Config tag.
Two different types of !Group exist:
REGISTERor ‘normal’ type groups can be instantiated uniquely within a register set, these are the default behaviour but can be explicitly declared by setting thetypeattribute toregister.MACROtype groups can be instantiated multiple times, each time using prefix, array, and alignment parameters provided by the !Macro tag.
!Groups contain a list of !Reg tags which declare the actual registers, which in turn contain a list of !Field tags which declare the variable width fields that make up the register.
BLADE will modify its behaviour when elaborating a register group based on values specified in the options array:
| Option | Effect |
|---|---|
| BYTE | Register addresses and alignments will be treated as byte values rather than word |
Note
By default, the elaborator will treat all register addresses and alignment requirements as word addresses (i.e. 4-byte wide). However, this behaviour can be changed to instead treat these values as byte addresses by using the BYTE option as described above.
Usage¶
-
class
blade.schema.ph_group.Group(name, regs, type='REGISTER', sd='', ld='', options='', array='1')¶ Defines a group containing !Reg tags which declare the registers
-
__init__(name, regs, type='REGISTER', sd='', ld='', options='', array='1')¶ Initialisation for the !Group tag
- Parameters
name – Name of the register group, will be used to refer to it when instantiating it within a !Config tag.
regs – List of the registers declared using !Reg tags.
type – The type of group - either ‘register’ (for normal behaviour) or ‘macro’ when this group is to be instantiated with a !Macro tag.
sd – Short description of the block - maximum 150 characters.
ld – Long description of the block - no maximum length.
options – List of options either in the form ‘KEY=VAL’ or just ‘KEY’ if a value is not required.
array – DEPRECATED and UNSUPPORTED, same behaviour is achievable by using the !Macro tag at instantiation.
-
set_file_marks(start, end)¶ Set start and end marks of the declaration and propagate to children
- Parameters
start – The starting mark
end – The ending mark
-
set_source_file(file)¶ Set the source file of this object and propagate it to children.
- Parameters
file – The source file path or object
-
validate()¶ Check that this tag agrees with our YAML schema
-