FPGA開発日記

カテゴリ別記事インデックス https://msyksphinz.github.io/github_pages , English Version https://fpgadevdiary.hatenadiary.com/

Vivado 2015.4 HLSを試す(チュートリアル Lab.2)

前回の続き。チュートリアルのLab.2をやっていこう。今回は、単純にtclを使って、GUIを立ち上げずに合成をするだけだ。

http://www.xilinx.com/support/documentation/sw_manuals/xilinx2014_2/ug871-vivado-high-level-synthesis-tutorial.pdf

前回のLab.1で、script.tclという名前で、操作のログが生成された。これを加工して、CUIだけで合成とIP生成ができるようにしよう。 まずはLab.1のscript.tclをコピーして、いくつかオプションを付け加える。

  1. 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.
  2. 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.
  3. 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.
  4. Add the exit command.
  5. 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.

f:id:msyksphinz:20151126234352p:plain

Lab.1と同様に、fir.vが生成された。レポートも出力されている。