前回の続き。チュートリアルのLab.2をやっていこう。今回は、単純にtclを使って、GUIを立ち上げずに合成をするだけだ。
前回のLab.1で、script.tclという名前で、操作のログが生成された。これを加工して、CUIだけで合成とIP生成ができるようにしよう。 まずはLab.1のscript.tclをコピーして、いくつかオプションを付け加える。
- Add a –reset option to the open_project command. Because you typically run Tcl files repeatedly on the same project, it is best to overwrite any existing project information.
- Add a –reset option to the open_solution command. This removes any existing solution information when the Tcl file is re-run on the same solution.
- Delete the source command. If a previous project contains any directives you wish to re-use, you can copy the directives.tcl file from that project to a local path, or you can copy the directives directly into this file.
- Add the exit command.
- Save the file.
という訳で、以下のscript.tclを作った。
############################################################ ## This file is generated automatically by Vivado HLS. ## Please DO NOT edit it. ## Copyright (C) 2015 Xilinx Inc. All rights reserved. ############################################################ open_project fir -reset set_top fir add_files ../lab1/fir.c add_files -tb ../lab1/fir_test.c add_files -tb ../lab1/out.gold.dat open_solution "solution1" -reset set_part {xc7z020clg484-1} create_clock -period 10 -name default csim_design csynth_design cosim_design export_design -format ip_catalog exit
Vivado 2015.4 Command Promptで、実行してみよう。
vivado_hls –f run_hls.tcl.
Lab.1と同様に、fir.vが生成された。レポートも出力されている。