Vitis 2024.1 无法正常编译custom ip的bug(因为Makefile里的wildcard)

发布于:2025-03-20 ⋅ 阅读:(14) ⋅ 点赞:(0)

现象:如果在vivado中,添加了自己的custom IP,比如AXI4 IP,那么在Vitis(2024.1)编译导出的原本的.xsa的时候,会构建build失败。报错代码是:

"Compiling blank_test_ip..."
microblaze-xilinx-elf-gcc.exe: warning: (ildcard: linker input file unused because linking not done 
microblaze-xilinx-elf-gcc.exe: error: (ildcard: linker input file not found: No such file or directory 
microblaze-xilinx-elf-gcc.exe: warning: *.c): linker input file unused because linking not done microblaze-xilinx-elf-gcc.exe: error: *.c): linker input file not found: Invalid argument 
make[2]: *** [Makefile:18: libs] Error 1 
make[1]: *** [Makefile:46: psu_pmu_0/libsrc/blank_test_ip_v1_0/src/make.libs] Error 2 
make: *** [Makefile:18: all] Error 2

原因:自动生成的Makefile文件有语法错误:

LIBSOURCES=($wildcard *.c)
OUTS = ($wildcard *.o)

自动生成的makefile
$应该在wildcard括号外面。

解决办法,有两种(推荐(2)):

(1) 如果你已经有了.xsa: 导入.xsa后,在Vitis内点Search,将这个platform project里面所有($wildcard 替换成 $(wildcard,重新build。要在vitis里面改,不要在原来的文件系统里面改,因为要改好多处,有些是原来文件系统里没有的。

原来错误的自动生成的Makefile代码改成:

LIBSOURCES=$(wildcard *.c)
OUTS = $(wildcard *.o)

(2) 如果你可以重新生成xsa:直接在Vivado里pack IP之后,在IP的Makefile里直接改一次。改的代码和上述方法(1)一样。upgrade IP,重新生成.xsa,就是正确的了。这个是问题根源。

在这里插入图片描述

后续:如果你按方法(1)改,虽然还会有无法生成image的问题,但不启动系统的话问题不大

sdcard_gen --xpfm abcd.xpfm --sys_config abcd --bif abcd/Debug/system.bif --bitstream abcd/_ide/bitstream/mpsoc_preset_wrapper.bit --elf abcd/Debug/chip_test.elf,psu_cortexa53_0
creating BOOT.BIN using abcd/_ide/bitstream/mpsoc_preset_wrapper.bit
Error intializing SD boot data : Software platform XML error, sdx:qemuArguments value "abcd/qemu/pmu_args.txt" path does not exist abcd/qemu/pmu_args.txt, platform path abcd sdx:configuration , sdx:image standard
make: *** [makefile:37: package] Error 1

如果想解决这个问题,可以参照https://zhuanlan.zhihu.com/p/26294135403

方法(2)没有后续问题。

Vitis到2024了居然还有这种低级bug…