cmake.hwip¶
- cmake.hwip.add_ip(IP_NAME **kwargs)¶
This function creates an INTERFACE library for a given IP.
This function is a wrapper around the cmake built-in add_library() function. It generates the library name using the vendor, library, name, and version (VLNV) information passed in arguments (see create_ip_vlnv()). It creates two alias libraries to the default <vendor>__<library>__<name>__<version>:
<vendor>::<library>::<name>::<version> (‘__’ replaced by ‘::’)
<vendor>::<library>::<name> (short name without the version)
This function can be used in FULL and SHORT form: Full form: ``` add_ip(ip
VENDOR vendor LIBRARY lib VERSION 1.2.3 DESCRIPTION “This is a sample IP” )
``` In full form it is possible to ommit VENDOR, LIBRARY and VERSION, DESCRIPTION, although it is not recommended.
Ommiting them all would have following signature:
` add_ip(ip2) `
Short form:
` add_ip(vendor2::lib2::ip2::1.2.2) `
In short form only the full VLNV format is accepted- Parameters:
IP_NAME (string) – The name of the IP.
Keyword Arguments
- Parameters:
VENDOR (string) – Name of the IP vendor.
LIBRARY (string) – Name of the IP library.
VERSION (string) – Version of the IP following a three-part version number (Major.Minor.Patch, e.g., 1.0.13).
DESCRIPTION (string) – Short description to be associated with the IP library, will appear in help_ips() message
- cmake.hwip.create_ip_vlnv(OUTVAR IP_NAME **kwargs)¶
This function creates an IP name provided vendor, library, name, and version (VLNV) information.
This functions appends the vendor, library, name, and version (VLNV) information separated by ‘__’ to create a unique string representing an IP name. This string is used as the library name when when calling the cmake built-in add_library() function (see add_ip()).
- Parameters:
OUTVAR (string) – The generate IP name.
IP_NAME (string) – The name of the IP.
Keyword Arguments
- Parameters:
VENDOR (string) – Name of the IP vendor.
LIBRARY (string) – Name of the IP library.
VERSION (string) – Version of the IP following a three-part version number (Major.Minor.Patch, e.g., 1.0.13).
- cmake.hwip.parse_ip_vlnv(IP_VLNV VENDOR LIBRARY IP_NAME VERSION **kwargs)¶
This function parses IP name from the VLNV format e.g. (vendor::lib::ip::0.0.1)
This functions appends the vendor, library, name, and version (VLNV) information separated by ‘__’ to create a unique string representing an IP name. This string is used as the library name when when calling the cmake built-in add_library() function (see add_ip()).
- Parameters:
OUTVAR (string) – The generate IP name.
IP_NAME (string) – The name of the IP.
Keyword Arguments
- Parameters:
VENDOR (string) – Name of the IP vendor.
LIBRARY (string) – Name of the IP library.
VERSION (string) – Version of the IP following a three-part version number (Major.Minor.Patch, e.g., 1.0.13).
- cmake.hwip.ip_sources(IP_LIB LANGUAGE **kwargs)¶
This function adds source file(s) to an IP target.
This functions adds source file(s) to an IP target as a property named after the type of source file(s) and the suffix ‘__SOURCES’. If source files of the same type already exist they are appended to the existing list. Ne source files can also be prepended with the optional keyword PREPEND. The source files are later used to create the list of files to be compiled (e.g., by a simulator) by a tool to execute its tasks. The source files are passed as a list after the parameters and keywords.
- Parameters:
IP_LIB (string) – The target IP library.
TYPE (string) – The type of source file(s).
Keyword Arguments
- Parameters:
PREPEND (string) – This keyword enable prepending the new source files with respect to the existing ones.
- cmake.hwip.get_ip_sources(OUTVAR IP_LIB LANGUAGE **kwargs)¶
This function retrieves the specific source files of a target library.
- Parameters:
OUTVAR (string) – The variable containing the retrieved source file.
IP_LIB (string) – The target IP library.
LANGUAGE (string) – The type of source file(s).
- cmake.hwip.ip_include_directories(IP_LIB LANGUAGE)¶
This function adds include directory(ies) to a target library.
This function adds an interface include directory(ies) to a target library. The include directory(ies) is added with the INTERFACE option (i.e., passed to targets depending on this one). The include directories are passed as a list after the parameter.
- Parameters:
IP_LIB (string) – The target IP library.
LANGUAGE (string) – Language of the included files.
- cmake.hwip.get_ip_include_directories(OUTVAR IP_LIB LANGUAGE **kwargs)¶
This function retrieves the included directories of a target library and its dependencies.
- Parameters:
OUTVAR (string) – The variable containing the retrieved included directory(ies).
IP_LIB (string) – The target IP library.
LANGUAGE (string) – Language of the included files.
- cmake.hwip.check_languages(LANGUAGE)¶
This function checks the the language is supported by SoCMake.
This function checks the the language is supported by SoCMake and issue a warning/error depending on the verbosity level. The supported languages can be augmented using the variable SOCMAKE_ADDITIONAL_LANGUAGES.
- Parameters:
OUT (string) – The variable in which to store the original retrieved name.
LIB (string) – The target IP library name.
- cmake.hwip.ip_link(IP_LIB **kwargs)¶
This function adds a target link library and a dependency to an IP target.
This function gets the original target and dependency names in case an alias is given. Then it checks if the link library exists and adds it (if it’s not already added). Finally, the link library is added as a dependency. This last step can be skipped with the keyword NODEPEND. The dependencies are passed as a list after the parameters and the keyword.
- Parameters:
IP_LIB (string) – The target IP library name.
Keyword Arguments
- Parameters:
NODEPEND (string) – This keyword disable the dependency between the targets.
- cmake.hwip.get_ip_property(OUTVAR TARGET PROPERTY **kwargs)¶
This function retrieves a specific property from a target library and its dependencies.
- Parameters:
OUTVAR (string) – Variable containing the requested property.
TARGET (string) – The target IP library name.
PROPERTY (string) – Property to retrieve from IP_LIB.
- cmake.hwip.ip_compile_definitions(IP_LIB LANGUAGE)¶
Set a compile definition on a IP for a given language inside property <LANGUAGE>_COMPILE_DEFINITIONS.
Any leading -D on an item will be removed. Empty items are ignored. For example, the following are all equivalent:
ip_compile_definitions(foo VERILOG FOO) ip_compile_definitions(foo VERILOG -DFOO) # -D removed ip_compile_definitions(foo VERILOG “” FOO) # “” ignored ip_compile_definitions(foo VERILOG -D FOO) # -D becomes “”, then ignored.
- Parameters:
IP_LIB (string) – The target IP library name.
LANGUAGE (string) – Language to which the definition should apply.
- cmake.hwip.get_ip_compile_definitions(OUTVAR IP_LIB LANGUAGE **kwargs)¶
This function is a hardcoded version of get_ip_property() for the <LANGUAGE>_COMPILE_DEFINITIONS property.
- Parameters:
OUTVAR (string) – Variable containing the requested property.
IP_LIB (string) – The target IP library name.
LANGUAGE (string) – Language to which the definition apply.
- cmake.hwip.get_ip_links(OUTVAR IP_LIB **kwargs)¶
Get the IP link graph in a flat list
- Parameters:
OUTVAR (string) – Variable containing the link list.