- class hdl_registers.generator.python.python_class_generator.PythonClassGenerator(register_list: RegisterList, output_folder: Path)
Generate a Python class with register definitions.
- SHORT_DESCRIPTION = 'Python class'
- __init__(register_list: RegisterList, output_folder: Path)
register_list – Registers and constants from this register list will be included in the generated artifacts.
output_folder – Result file will be placed in this folder.
- create(**kwargs: Any) None
Create the binary pickle also, apart from the class file.
Note that this is a little bit hacky, preferably each generator should produce only one file.
- get_code(**kwargs: Any) str
Save register list object to binary file (pickle) and create a python class that recreates it.
- property should_create: bool
Since this generator creates two files, where on is binary, it is impossible to do the version/hash check. Hence, set it to “always create”. The mechanism “create if needed” should not be used for this generator anyway, since this generator is not designed to run in real-time like e.g. the VHDL generator.