!Def¶
The !Def tag defines a integer value that can then be used in place of any constant within the design description. For example it can be used to define the width of a data bus, which can then be used in any !His that carries data as the width parameter.
It is preferable to make use of !Def tags as widely as possible, as it makes modifying parameters of the overall design far easier (rather than editing every file separately).
!Def tags are treated as first-class citizens, so they will be converted into DFDefines and attached the DesignFormat project. This means you can autogenerate a list of defined values in any language you write your implementation in.
Note
In the future !Def and !Const tags may be merged into one new tag in order to reduce complexity of the schema.
Usage¶
As !Def is a primitive tag, either sequence or mapping syntax may be used to declare it - examples of both are given below:
- !Def [data_bus_width, 32, "Width of all data buses in the design"]
- !Def
name : device_id
value: 0x12345678
ld : Identifier for the device
-
class
blade.schema.ph_def.Def(name, val, sd='', ld='', options=[])¶ Declares a named valued that can be used throughout the design.
-
__init__(name, val, sd='', ld='', options=[])¶ Initialisation of the !Def tag.
- Parameters
name – Name for this value
val – The integer value
sd – Short description - maximum 150 characters
ld – Long description - no limit on length
options – List of options in the form ‘KEY=VAL’ or just ‘KEY’ if a value is not required.
-
validate()¶ Check that this tag agrees with our YAML schema
-