Below is the MDD file for the AXI GPIO driver. The supported_peripherals parameter is cross checked agaisnt the IP (or cells) found in an XSA file using the HSI API
Below HSI is used to extract all cells with IP_NAME that matches the supported_peripherals parameter in the driver. If matched, the driver is added to the MSS file.
xsct% hsi::open_hw_design design_1_wrapper.xsa
xsct% hsi::get_cells -hierarchical -filter {IP_NAME==axi_gpio}
axi_gpio_0
OPTION psf_version = 2.1;
BEGIN driver gpio
OPTION supported_peripherals = (axi_gpio);
OPTION driver_state = ACTIVE;
OPTION copyfiles = all;
OPTION VERSION = 4.9;
OPTION NAME = gpio;
END driver
The driver init file is generated using the TCL file in the data folder
::hsi::utils::define_config_file $drv_handle "xgpio_g.c" "XGpio" "DEVICE_ID" "C_BASEADDR" "C_INTERRUPT_PRESENT" "C_IS_DUAL"
In the example above, the xgpio_g.c file is generated at the XGpio struct is initialised with the “DEVICE_ID” “C_BASEADDR” “C_INTERRUPT_PRESENT” and “C_IS_DUAL” parameters that are populated in the xparameter.h file.