!Macro

The !Macro tag is used within the order section of a !Config tag to specify the position that a macro type register !Group should be instantiated.

Unlike when using a !Register tag, when using a !Macro the same register !Group can be instantiated multiple times - each time controlling the number of instantiations (using the array parameter) and the word alignment of the base of each instantiation (using the align parameter).

Note

Only !Groups with their type attribute set to macro can be instantiated using the !Macro tag.

Usage

The !Macro tag is primitive, so either sequence or mapping syntax can be used when declaring it. Examples of both are given below:

- !Config
  order:
  - !Macro [inbound_ctrl, group_a, 2, 10, "Groups for inbound controls"]
  - !Macro
    name : outbound_ctrl
    macro: group_a
    array: 3
    align: 20
    ld   : Groups for outbound controls

- !Group
  name: group_a
  ...
class blade.schema.ph_macro.Macro(name, macro, array='-', align='-', ld='')

Use within !Config to specify a !Group of type Macro. Has an option to specify a prefix, number of array and alignment.

__init__(name, macro, array='-', align='-', ld='')

Initialisation for the !Macro tag

Parameters
  • name – Prefix to add to the name of the group for this instantiation

  • macro – Name of the macro-type group being instantiated

  • array – How many instances to place

  • align – The word (i.e. 4-byte) alignment of the group’s base address

  • ld – Long description for the macro

validate()

Check that this tag agrees with our YAML schema