Library YAML file - 2024.1 English

Vitis Tutorials: Embedded Software (XD260)

Document ID
XD260
Release Date
2024-06-19
Version
2024.1 English

The YAML file for the LwIP is shown below

type: library

version: 1.0

description: |-
  lwip213 library lwIP (light weight IP) is an open source TCP/IP stack configured for AMD hard and soft Ethernet MACs.
properties:
  reg:
    description: Physical base address and size of the controller register map
  interrupts:
    description: Interrupt property of the controller
  xlnx,txcsum:
    description: Ethernet controller transmit checksum mode (Full, Partial and None)
  xlnx,rxcsum:
    description: Ethernet controller receive checksum mode (Full, Partial and None)
  axistream-connected:
    description: Connected Stream IP Type (1-AXI_FIFO 2-AXI_DMA 3-AXI_MCDMA)
  phy-handle:
    description: Child phy-node phandle property

supported_processors:
  - psxl_cortexa78
  - psxl_cortexr52
  - psu_cortexa53
  - psu_cortexr5
  - psv_cortexa72
  - psv_cortexr5
  - ps7_cortexa9
  - psu_pmu
  - psv_pmc
  - psv_psm
  - microblaze

supported_os:
  - standalone
  - freertos10_xilinx

depends:
    emaclite:
        - reg
        - interrupts
    axiethernet:
        - reg
        - interrupts
        - xlnx,txcsum
        - xlnx,rxcsum
        - axistream-connected
    emacps:
        - reg
        - interrupts
        - phy-handle

The properties keyword is used to extract Hardware metadata using Lopper Framework and is populated in an Example.cmake. For example, the phy-handle property. The Lopper Framework will read the System Device Tree to extract this node property and if found will populate this in the cmake file above.

To test this, users can update the ethernet node in the SDT (pcw.dtsi) to add the phy-handle node property. I added the xlnx,phy-type node property

phy-handle = <&phy0>;
	mdio: mdio {
	#address-cells = <1>;
	#size-cells = <0>;
	phy0: ethernet-phy@c {
		xlnx,phy-type = <0x4>;
	};
};

Users can see the lopper code here. If I now Re-Generate the BSP and view the lwip232Example.cmake

set(EMACPS0_PROP_LIST "0xff0e0000;0x403f;0x4")

The Supported_Processors is used to guide the tools on the supported processors determined by Lopper, and warn the user if a unsupported processor is used.

Similarily, the depends is used to help the tools to make sure that the supported hardware is found in the SDT to support the functionality of the library.

In Vitis Classic, the bsp parameters were populated for the MLD and MSS file. In Vitis Unified, these files no longer exist. Instead the CMake file (library_name.cmake) in the src directory of the library is used to populate the GUI and bsp.yaml. Again, using the lwip as an example

cmake_minimum_required(VERSION 3.3)

find_package(common)
set(lwip213_api_mode RAW_API CACHE STRING "Mode of operation for lwIP (RAW API/Sockets API)")
set_property(CACHE lwip213_api_mode PROPERTY STRINGS RAW_API SOCKET_API)
option(lwip213_no_sys_no_timers "Drops support for sys_timeout when NO_SYS==1" ON)
set(lwip213_socket_mode_thread_prio 2 CACHE STRING "Priority of threads in socket mode")
option(lwip213_tcp_keepalive "Enable keepalive processing with default interval" OFF)
set(sgmii_fixed_link 0 CACHE STRING "Enable fixed link for GEM SGMII at 1Gbps")
set_property(CACHE sgmii_fixed_link PROPERTY STRINGS 0 1)
...

This metadata is used to create the lwipopts.h with the #defines used by the library during pre-compilation to configurate the library.

configure_file(${CMAKE_CURRENT_SOURCE_DIR}/contrib/ports/xilinx/include/lwipopts.h.in ${CMAKE_BINARY_DIR}/include/lwipopts.h)