You can create a platform using either the Vitis IDE or the XSCT console. However, the Vitis IDE only supports one XSA file as input. If your design has two XSA (hw and hw-emu) files, use XSCT to create the platform.
Click here to see how to use the Vitis IDE to create a Vitis platform
Launch Vitis IDE.
Prepare Vitis environment
source <Vitis_tool_install_dir>/settings64.sh
Launch Vitis by typing
vitis &
in the console.Select
zcu104_software_platform
folder as workspace directory.
Create a new platform project.
Select File > New > Platform Project to create a platform project.
Enter the project name. For this example, type
zcu104_custom_fsbl
. Click Next.In the Platform page,
Click Browse button, select the XSA file generated by the Vivado. In this case, it is
zcu104_custom_platform_hw.xsa
.Set the operating system to standalone.
Set the processor to psu_cortexa53_0.
Set the architecture to 64-bit.
Check the option Generate boot components, because the auto generated FSBL and PMU firmware are our goals.
Click Finish.
Click zcu104_custom_fsbl project in the Vitis Explorer view, then click the Build button to generate the platform.
After building we can get FSBL and PMU firmware.
Click here to see how to use XSCT to create a Vitis platform
Create a Tcl file with XSCT commands. For example, here is the parts of xsct_create_pfm.tcl.
setws .
#set OUTPUT platform_repo
platform create -name $platform_name \
-desc "A custom platform ZCU104 platform" \
-hw ${xsa_path}/${xsa_name}_hw.xsa \
-hw_emu ${xsa_path}/${xsa_name}_hwemu.xsa \
-fsbl-target psu_cortexa53_0 \
# -out ./${OUTPUT}
# standalone domain
domain create -name standalone -proc psu_cortexa53_0 -os standalone -arch {64-bit}
# Linux domain
#domain create -name xrt -proc psu_cortexa53 -os linux -arch {64-bit} -runtime {ocl} -sd-dir {./sd_dir} -bootmode {sd}
# domain active xrt
#domain config -boot {./boot}
#domain config -generate-bif
#domain config -qemu-data ./boot
platform write
platform generate
Note: Replace the file name and directory name in the script with your project file location.
The platform create
command needs the following input values:
-name
: Platform name.-hw
: Hardware XSA file location.-hw_emu
: Hardware emulation XSA file location.-out
: platform output path if you usesetws
to specify the workspace there is no need for this option.-sd-dir
: the directory that contains the files to be included in the FAT32 partition of the SD card image.-fsbl-target
: specify the CPU core and generate corresponding FSBL and PMU image.
Note: If you do not need to support hardware emulation, you can omit the option
-hw_emu
and its value for the commandplatform create
.
The domain
command sets up a standalone domain or the Linux domain with SD boot mode. It uses files in the ./sd_dir
folder to form the FAT32 partition of the SD card image and files in the ./boot
directory to generate boot.bin
.
You can pass the values to the script directly by replacing the variable with the actual value, or define them in the header of the tcl script, or pass the value to XSCT when calling this script.
Here is an example of calling XSCT if you hardcode all contents in xsct_create_pfm.tcl
.
xsct xsct_create_pfm.tcl
To support better generalization, the example Makefile and xsct_create_pfm.tcl in the ref_files
directory uses variables to represent the file names and directory location. Refer to them if you would like to get more programmability in your scripts.
In this step, you created a platform to get FSBL and PMU firmware. You will add all the components to the platform in the last step. The next file that you need to prepare is the DTB file.