!Inst¶
The !Inst tag declares an instruction that can be extended to form an instruction set. It is useful for declaring CPU instruction set extensions, or microcode instructions for a accelerator engine.
Warning
This tag is likely to be refactored into a more generic !Command description tag, that builds on the ideas of ‘extending’ a base tag to add more functionality. This would be more suited to other uses than the existing !Inst instruction description - with the current implementation only one field can be overridden or fixed to a value per instruction layer, this is likely to be replaced with a more flexible mechanism.
Usage¶
- Inst
name : root
sd : Base instruction from which everything extends
fields:
- !Field
name : class
lsb : 0
width: 5
enums:
- !Enum [load_store, 0]
- !Enum [math, 1]
- !Enum [logic, 2]
- !Inst
name : load_store
base : root
decode_f: class
decode_e: load_store
fields :
- !Field
name : operation
lsb : 5
width: 2
enums:
- !Enum [load, 0]
- !Enum [store, 1]
- !Enum [clear, 2]
- !Field
name : operand_1
lsb : 7
width: 5
...
- !Inst
name : load_to_reg
base : load_store
decode_f: operation
decode_e: load
fields :
- !Field
name : register
lsb : 12
width: 5
...
-
class
blade.schema.ph_inst.Inst(name, base='', decode_f='', decode_e='', options='', sd='', ld='', hir_ref='', hir_name='', fields=None, unrolled=None)¶ Declares an instruction that can be extended to create a similarly formed instruction set, where the value of an inherited field can be forced to a specific value.
-
__init__(name, base='', decode_f='', decode_e='', options='', sd='', ld='', hir_ref='', hir_name='', fields=None, unrolled=None)¶ Initialisation for the !Inst tag.
- Parameters
name – Name of the instruction
base – Instruction to inherit from
decode_f – Which field should be fixed to a certain value
decode_e – What value from the enumeration of the field referenced by decode_f should be taken
options – List of options in the form ‘KEY=VAL’ or just ‘KEY’ if a value is not required
sd – Short description - maximum 150 characters
ld – Long description - no limit on length
hir_ref – Deprecated field - will be removed
fields – List of !Field tags for the instruction
unrolled – Deprecated field - will be removed
-
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
-