########## cmake.hwip ########## .. module:: cmake.hwip .. function:: 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 ______: * :::::: ('__' replaced by '::') * :::: (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 :param IP_NAME: The name of the IP. :type IP_NAME: string **Keyword Arguments** :keyword VENDOR: Name of the IP vendor. :type VENDOR: string :keyword LIBRARY: Name of the IP library. :type LIBRARY: string :keyword VERSION: Version of the IP following a three-part version number (Major.Minor.Patch, e.g., 1.0.13). :type VERSION: string :keyword DESCRIPTION: Short description to be associated with the IP library, will appear in `help_ips()` message :type DESCRIPTION: string .. function:: 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()). :param OUTVAR: The generate IP name. :type OUTVAR: string :param IP_NAME: The name of the IP. :type IP_NAME: string **Keyword Arguments** :keyword VENDOR: Name of the IP vendor. :type VENDOR: string :keyword LIBRARY: Name of the IP library. :type LIBRARY: string :keyword VERSION: Version of the IP following a three-part version number (Major.Minor.Patch, e.g., 1.0.13). :type VERSION: string .. function:: 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()). :param OUTVAR: The generate IP name. :type OUTVAR: string :param IP_NAME: The name of the IP. :type IP_NAME: string **Keyword Arguments** :keyword VENDOR: Name of the IP vendor. :type VENDOR: string :keyword LIBRARY: Name of the IP library. :type LIBRARY: string :keyword VERSION: Version of the IP following a three-part version number (Major.Minor.Patch, e.g., 1.0.13). :type VERSION: string .. function:: 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. Relative file paths are accepted and will be converted to absolute, relative to ${CMAKE_CURRENT_SOURCE_DIR} :param IP_LIB: The target IP library. :type IP_LIB: string :param TYPE: The type of source file(s). :type TYPE: string :param HEADERS: List of header files. Header files are stored in separate property ${LANGUAGE}_HEADERS :type HEADERS: list **Keyword Arguments** :keyword PREPEND: This keyword enable prepending the new source files with respect to the existing ones. :type PREPEND: string .. function:: get_ip_sources(OUTVAR IP_LIB LANGUAGE **kwargs) This function retrieves the specific source files of a target library. :param OUTVAR: The variable containing the retrieved source file. :type OUTVAR: string :param IP_LIB: The target IP library. :type IP_LIB: string :param LANGUAGE: The type of source file(s). :type LANGUAGE: string :keyword [NO_DEPS]: Only return the list off IPs that are immedieate childrean from the current IP :type [NO_DEPS]: bool :keyword [HEADERS]: Return the list of HEADER files only. :type [HEADERS]: bool .. function:: 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. :param IP_LIB: The target IP library. :type IP_LIB: string :param LANGUAGE: Language of the included files. :type LANGUAGE: string .. function:: get_ip_include_directories(OUTVAR IP_LIB LANGUAGE **kwargs) This function retrieves the included directories of a target library and its dependencies. :param OUTVAR: The variable containing the retrieved included directory(ies). :type OUTVAR: string :param IP_LIB: The target IP library. :type IP_LIB: string :param LANGUAGE: Language of the included files. :type LANGUAGE: string :keyword [NO_DEPS]: Only return the list off IPs that are immedieate childrean from the current IP :type [NO_DEPS]: bool .. function:: 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. :param OUT: The variable in which to store the original retrieved name. :type OUT: string :param LIB: The target IP library name. :type LIB: string .. function:: 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. :param IP_LIB: The target IP library name. :type IP_LIB: string **Keyword Arguments** :keyword NODEPEND: This keyword disable the dependency between the targets. :type NODEPEND: string .. function:: get_ip_property(OUTVAR TARGET PROPERTY **kwargs) This function retrieves a specific property from a target library and its dependencies. :param OUTVAR: Variable containing the requested property. :type OUTVAR: string :param TARGET: The target IP library name. :type TARGET: string :param PROPERTY: Property to retrieve from IP_LIB. :type PROPERTY: string :keyword [NO_DEPS]: Only return the list off IPs that are immedieate childrean from the current IP :type [NO_DEPS]: bool .. function:: ip_compile_definitions(IP_LIB LANGUAGE) Set a compile definition on a IP for a given language inside property _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. :param IP_LIB: The target IP library name. :type IP_LIB: string :param LANGUAGE: Language to which the definition should apply. :type LANGUAGE: string .. function:: get_ip_compile_definitions(OUTVAR IP_LIB LANGUAGE **kwargs) This function is a hardcoded version of get_ip_property() for the _COMPILE_DEFINITIONS property. :param OUTVAR: Variable containing the requested property. :type OUTVAR: string :param IP_LIB: The target IP library name. :type IP_LIB: string :param LANGUAGE: Language to which the definition apply. :type LANGUAGE: string :keyword [NO_DEPS]: Only return the list off IPs that are immedieate childrean from the current IP :type [NO_DEPS]: bool .. function:: get_ip_links(OUTVAR IP_LIB **kwargs) Get the IP link graph in a flat list :param OUTVAR: Variable containing the link list. :type OUTVAR: string :keyword [NO_DEPS]: Only return the list off IPs that are immedieate childrean from the current IP :type [NO_DEPS]: bool .. function:: socmake_add_languages() .. function:: get_socmake_languages(OUTVAR)