Skip to main content

peakrdl_halcpp

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() \<https://cmake.org/cmake/help/latest/command/set_property.html>_ CMake function):

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:

target_sources(<lib> INTERFACE FILE_SET HEADERS
BASE_DIRS "${PROJECT_SOURCE_DIR}/firmware/hal"
FILES "firmware/hal/<lib>_ext.h"
)

Parameters

NameTypeDescription
IP_LIBstringThe target IP library, it needs to have SYSTEMRDL_SOURCES property set with a list of SystemRDL files.

Keyword Arguments

NameTypeDescription
OUTDIRstring pathoutput directory in which the files will be generated, if ommited ${BINARY_DIR}/halcpp will be used.