hdl_registers.generator.cpp package

Submodules

hdl_registers.generator.cpp.cpp_generator_common module

class hdl_registers.generator.cpp.cpp_generator_common.CppGeneratorCommon(register_list: RegisterList, output_folder: Path)

Bases: RegisterCodeGenerator, RegisterCodeGeneratorHelpers

Class with common methods for generating C++ code.

COMMENT_START: str = '//'
__init__(register_list: RegisterList, output_folder: Path)
Parameters:
  • 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.

hdl_registers.generator.cpp.header module

class hdl_registers.generator.cpp.header.CppHeaderGenerator(register_list: RegisterList, output_folder: Path)

Bases: CppGeneratorCommon

Class to generate a C++ header.

DEFAULT_INDENTATION_LEVEL: int = 4
SHORT_DESCRIPTION = 'C++ header'
get_code(**kwargs: Any) str

Get the generated code as a string.

Overload in a subclass where the code generation is implemented.

Parameters:

kwargs – Further optional parameters that can be used. Can send any number of named arguments, per the requirements of get_code() of any custom generators that inherit this class.

property output_file: Path

Result will be placed in this file.

hdl_registers.generator.cpp.implementation module

class hdl_registers.generator.cpp.implementation.CppImplementationGenerator(register_list: RegisterList, output_folder: Path)

Bases: CppGeneratorCommon

Class to generate a C++ implementation.

DEFAULT_INDENTATION_LEVEL: int = 4
SHORT_DESCRIPTION = 'C++ implementation'
get_code(**kwargs: Any) str

Get a complete C++ class implementation with all methods.

property output_file: Path

Result will be placed in this file.

hdl_registers.generator.cpp.interface module

class hdl_registers.generator.cpp.interface.CppInterfaceGenerator(register_list: RegisterList, output_folder: Path)

Bases: CppGeneratorCommon

Class to generate a C++ interface header.

DEFAULT_INDENTATION_LEVEL: int = 4
SHORT_DESCRIPTION = 'C++ interface header'
get_code(**kwargs: Any) str

Get the generated code as a string.

Overload in a subclass where the code generation is implemented.

Parameters:

kwargs – Further optional parameters that can be used. Can send any number of named arguments, per the requirements of get_code() of any custom generators that inherit this class.

property output_file: Path

Result will be placed in this file.