!ModInst¶
The !ModInst tag instantiates a !Mod description as a child module of the block. The same !Mod may be instantiated multiple times, each time with a different name. Once the instance is declared, interconnectivity can be specified using the !Connect tag.
If more than one instance of a particular block is required for creating parallel, identical, data paths then you can use the count parameter to instantiate multiple instances with the same name. This makes declaration of interconnections much easier, as both instances can be hooked up with a single statement (see !Connect for further details).
Usage¶
As the !ModInst tag is primitive, it can be used with either mapping or sequence syntax - although the latter is encouraged for brevity. An example of both uses is given below:
- !Mod
name : my_mod
modules:
- !ModInst [block_a, inverter, "Instantiating 4 inverters", 4]
- !ModInst
name : block_b
ref : adder
sd : Instantiating 2 addition units
count: 2
...
-
class
blade.schema.ph_mod_inst.ModInst(name, ref, sd='', count=1, ld='', options=[])¶ Instantiates a !Mod description with a name and count
-
__init__(name, ref, sd='', count=1, ld='', options=[])¶ Initialisation for !ModInst tag.
- Parameters
name – Name of the instantiation
ref – The !Mod tag to instantiate
sd – Short description - maximum 150 characters
count – How many instances to create
ld – Long description - no maximum length
options – List of options either in the form ‘KEY=VALUE’ or just ‘KEY’ if a value is not required.
-
validate()¶ Check that this tag agrees with our YAML schema
-