テンプレート makefile の使用 - 2022.1 日本語

Vitis 統合ソフトウェア プラットフォームの資料: アプリケーション アクセラレーション開発 (UG1393)

Document ID
UG1393
Release Date
2022-05-25
Version
2022.1 日本語

Vitis のインストール フォルダーにはテンプレート makefile が含まれており、それを元にカスタム makefile を開発しやすくなっています。次に、テンプレート makefile を使用して独自の makefile を作成するのに必要な変数について説明します。

Vitis HLS# Accelerator source files (ie.  code, or vpp_acc code) 
# must be specified here; they will be processed by v++ --compile
ACC_SRCS  := src/conv_filter_acc.cpp
 
# Host source files are defined here:
HOST_SRCS := src/host.cpp src/function_cpu.cpp
 
# Include tool provided Makefile template:
include ${XILINX_VITIS}/system_compiler/examples/vpp_sc.mk

テンプレート makefile のビルド ターゲットには、allrunbuildcleanultraclean などがあります。ハードウェア エミュレーション (hw_emu) のデザインを build するのに有効な make コマンドは、次のとおりです。

$ make DEVICE=<platform> TARGET=hw_emu build

ターゲットを run する make コマンドも次のようになります。

$ make DEVICE=<platform> TARGET=hw_emu run
重要: VSC は g++ -dumpversion を使用して g++ のバージョン番号を取得し、バージョンが 7.1.0 より古い場合はビルドを停止します。ただし、一部の OS では、このコマンドはメジャー バージョンしか戻しません。たとえば、バージョン 7.5.0 はバージョン 7 と認識され、次のエラー メッセージが表示されます。
vpp_sc.mk: Using /usr/bin/g++
vpp_sc.mk: g++ (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0 <Installation path of Vitis 2022.1>/system_compiler/examples/vpp_sc.mk:29:
*** gcc version lower then 7.1.0 is not supported. Stop.

このエラーを解決するには、make コマンドに GCC_VERSION=75000 を付けます。これで、バージョンがテンプレート makefile に 75000 として戻され、ビルドが続行されます。