############################ cmake.peakrdl/peakrdl_halcpp ############################ .. module:: cmake.peakrdl/peakrdl_halcpp .. function:: peakrdl_halcpp(IP_LIB **kwargs) Create a target for invoking PeakRDL-halcpp on IP_LIB. PeakRDL-halcpp generates a C++ 17 Hardware Abstraction Layer (HAL) drivers based on SystemRDL description. PeakRDL-halcpp can be found on this `link `_ Function expects that **IP_LIB** *INTERFACE_LIBRARY* has **SYSTEMRDL_SOURCES** property set with a list of SystemRDL files to be used as inputs. To set the SYSTEMRDL_SOURCES property use the ip_sources() function from SoCMake (internally using `set_property() `_ CMake function): .. code-block:: cmake ip_sources(IP_LIB LANGUAGE [SYSTEMRDL|SYSTEMVERILOG|...] ${PROJECT_SOURCE_DIR}/file.rdl) This function will append CPP source files to the **FILE_SET** **HEADERS** of the **IP_LIB**. If the **IP_LIB** has a header file called **IP_LIB_ext.h** added to **FILE_SET** **HEADERS**, that module will be passed to peakrdl-halcpp as \-\-ext argument. Meaning that the extended class will be used in the hierarchy instead of the HAL generated one. The function works recursively, so its enough to call it once on the top library of the hierarchy. To set the extended class to the library this code snippet can be used: .. code-block:: c++ target_sources( INTERFACE FILE_SET HEADERS BASE_DIRS "${PROJECT_SOURCE_DIR}/firmware/hal" FILES "firmware/hal/_ext.h" ) :param IP_LIB: RTL interface library, it needs to have SYSTEMRDL_SOURCES property set with a list of SystemRDL files. :type IP_LIB: INTERFACE_LIBRARY **Keyword Arguments** :keyword OUTDIR: output directory in which the files will be generated, if ommited ${BINARY_DIR}/halcpp will be used. :type OUTDIR: string path .. function:: __ext_header_provided(LIB libs) Find headers that have _ext.h extension and compare with libraries. If there is a library that matches the file name add it to list.