勉強しないとな~blog

ちゃんと勉強せねば…な電気設計エンジニアです。

ZYBOを進める - 25. ツールバージョン変更(2020.2)

久しぶりにZYBOのほうを進めたいと思います。

内容

前回(既に1年前…)までは

  • VMWare + Ubuntu18.04
  • Vivado 2017.4
  • Petalinux 2017.4

の環境を使っていました。

ただ、今回はXilinxツールのVitisも使っていきたいと思っていて、使用するツールバージョンを新しくしたいと思います。

ツールバージョン変更作業

仮想マシン環境作り直し

最近Avnet社のUltra96ボードもいじろうとしています。
こちらでは以下のサイトにリファレンスデザインやガイドがありますが、こちらのガイドに従うと、VirtualBoxを使う流れになります。ZYBO開発のほうでもVirtualBoxを使うほうに切り替えていきたいと思います。

Ultra96-V2 | element14 | Avnet Boards Community

「Reference Designs」のタブを開いて、「Development Using Ubuntu Desktop Linux」のところを見ると「VirtualBox and Linux VM installation Guide」というのがいくつかあります。
これに従うと、

  • VirtualBoxのインストール、Ubuntu OSのセットアップ
  • VivadoおよびVitisのインストール
  • Petalinuxのインストール
  • その他必要な環境の整備

を行うことができます。

f:id:nokixa:20211009003207p:plain:w300

環境を用意したら、digilentのVivado向けのボード定義ファイルを、Vivadoインストールパスの下に置きます。

Installing Vivado, Xilinx SDK, and Digilent Board Files - Digilent Reference

こちらのサイトから、「Master Branch ZIP Archive」をクリックしてzipファイルをダウンロード、解凍します。解凍されたファイルを、以下のようにコピーします。

コピー元: vivado-boards-master/new/board_files/ コピー先: /tools/Xilinx/Vivado/2020.2/data/boards/board_files/

f:id:nokixa:20210926025147p:plain

f:id:nokixa:20210926010136p:plain


Vivadoプロジェクト移行

今までで作ったVivadoプロジェクトも、新しいVivadoに移行します。
とりあえず今まで使っていたZybo-base_linuxプロジェクトを仮想マシンにコピー。.xprファイルをVivadoで開きます。
すると、まずプロジェクトのバージョン違いの警告が出てきます。

f:id:nokixa:20210926013425p:plain

「Automatically upgrade to the current version」にチェックを入れた状態でOKし、プロジェクトのアップグレードを試みます。

アップグレードの必要なIPがあるようです。

f:id:nokixa:20210926015239p:plain

OKをクリックして、Vivadoのメニューで「Reports」 > 「Report IP Status」と開くと、IPのアップグレード必要性の状況が表示されます。
ここからアップグレードを行うこともできます。

f:id:nokixa:20210926015314p:plain

IPアップグレードを行うと、Critical Warningが発生しました。

f:id:nokixa:20211009012710p:plain

ip_upgrade.logを見てみると、Critical Warningを出しているIPが記載されています。

1つ目はsystem_v_tc_out_0 (ブロックデザイン内、Video Timing Controller)。

Upgrade Log for IP 'system_v_tc_out_0'

1. Summary
----------

CAUTION (success, with warnings) in the upgrade of system_v_tc_out_0 from xilinx.com:ip:v_tc:6.1 (Rev. 12) to xilinx.com:ip:v_tc:6.2 (Rev. 1)

After upgrade, an IP may have parameter and port differences compared to the original customization. Please review the parameters within the IP customization GUI to ensure proper functionality. Also, please review the updated IP instantiation template to ensure proper connectivity, and update your design if required.

2. Connection Warnings
----------------------

Detected external port differences while upgrading 'system_v_tc_out_0'. These changes may impact your design.


-Upgrade has added port 'sof_state'


3. Customization warnings
-------------------------

An attempt to modify the value of disabled parameter 'GEN_F0_VSYNC_HSTART' from '640' to '1280' has been ignored for IP 'system_v_tc_out_0'

An attempt to modify the value of disabled parameter 'GEN_F0_VSYNC_HEND' from '695' to '1280' has been ignored for IP 'system_v_tc_out_0'

An attempt to modify the value of disabled parameter 'GEN_F0_VBLANK_HSTART' from '640' to '1280' has been ignored for IP 'system_v_tc_out_0'

An attempt to modify the value of disabled parameter 'GEN_F0_VBLANK_HEND' from '640' to '1280' has been ignored for IP 'system_v_tc_out_0'

An attempt to modify the value of disabled parameter 'GEN_F1_VSYNC_HSTART' from '695' to '1280' has been ignored for IP 'system_v_tc_out_0'

An attempt to modify the value of disabled parameter 'GEN_F1_VSYNC_HEND' from '695' to '1280' has been ignored for IP 'system_v_tc_out_0'

An attempt to modify the value of disabled parameter 'GEN_F1_VBLANK_HSTART' from '640' to '1280' has been ignored for IP 'system_v_tc_out_0'

An attempt to modify the value of disabled parameter 'GEN_F1_VBLANK_HEND' from '640' to '1280' has been ignored for IP 'system_v_tc_out_0'

ディスエーブルされているパラメータの設定は無視される、ということが書かれています。
ブロックデザインでIPのカスタマイズGUIを出してみると、

f:id:nokixa:20210928003113p:plain

となっています。
Video Formatが現状では720pになっていて他のパラメータがグレーアウトされていますが、 これをCustomに変えてみると、各パラメータ変更できました。
特にここのパラメータも気にしないでよさそうかなと。

後はsof_stateというポートも追加されたようです。
Video Timing Controller IPのガイドを見ると、これはAXI4 Video Out bridgeと一緒に使用するときにbridgeのsof_stateポートを接続してください、ということが書かれています。

f:id:nokixa:20210928033038p:plain

2つ目はsystem_v_axi4s_vid_out_0_0 (ブロックデザイン内、AXI4-Stream to Video Out)。

Upgrade Log for IP 'system_v_axi4s_vid_out_0_0'

1. Summary
----------

CAUTION (success, with warnings) in the upgrade of system_v_axi4s_vid_out_0_0 (xilinx.com:ip:v_axi4s_vid_out:4.0) from (Rev. 8) to (Rev. 11)

After upgrade, an IP may have parameter and port differences compared to the original customization. Please review the parameters within the IP customization GUI to ensure proper functionality. Also, please review the updated IP instantiation template to ensure proper connectivity, and update your design if required.

2. Connection Warnings
----------------------

Detected external port differences while upgrading 'system_v_axi4s_vid_out_0_0'. These changes may impact your design.


-Upgrade has added port 'fifo_read_level'

-Upgrade has added port 'sof_state_out'

fifo_read_levelとsof_state_outというポートが追加になったようです。
sof_state_outは先ほどのVideo Timing Controllerに接続する信号のようなので、ブロックデザイン上で接続します。fifo_read_levelは何のための信号かよく分からず。IPのガイドを見ても何も記載がありませんでした。特に何もしないでいいかな。

f:id:nokixa:20210928034900p:plain

最後はsystem_axi_gpio_led_0 (ブロックデザイン内、AXI GPIO)。
gpio_io_i、gpio_io_tポートが消えています。他にもAXI GPIOのインスタンスは存在しますが、このインスタンスだけ出力専用モードに設定されているためかと思われます。元々使われていないポートなので、特に対応は不要かと。

Upgrade Log for IP 'system_axi_gpio_led_0'

1. Summary
----------

CAUTION (success, with warnings) in the upgrade of system_axi_gpio_led_0 (xilinx.com:ip:axi_gpio:2.0) from (Rev. 17) to (Rev. 24)

After upgrade, an IP may have parameter and port differences compared to the original customization. Please review the parameters within the IP customization GUI to ensure proper functionality. Also, please review the updated IP instantiation template to ensure proper connectivity, and update your design if required.

2. Connection Warnings
----------------------

Detected external port differences while upgrading 'system_axi_gpio_led_0'. These changes may impact your design.


-Upgrade has removed port 'gpio_io_i'

-Upgrade has removed port 'gpio_io_t'

というところで、ブロックデザインを一部変更したので、Validate Designをして保存、ビットストリーム生成をします。
ブロックデザイン内のIP全部再合成になるので時間がかかります…

一部要変更点。

  • ブロックデザインの外部ポートが一部変わった(axi_gpio_led_0のポートが一部なくなった)ので、ラッパの再生成も必要でした。
    • Vivadoプロジェクトのデフォルトの言語をVerilogに変更していたので、ラッパはsystem_wrapper.vが使用される。
  • 外部ポート名が一部変更になっているので、制約ファイル(ZYBO_Master.xdc)で変更
    leds_4bits_tri_io → leds_4bits_tri_o
  • ほかにも制約ファイルで変更したIOポート名があった気がしますが、メモ忘れました…

f:id:nokixa:20210928230915p:plain


一旦ここまで

長くなったのでここまでにします。
VivadoプロジェクトはGitHubに上げたいですが、現状のプロジェクト管理方法だといまいちなので、また後で直して上げたい…