FC2カウンター FPGAの部屋 2020年11月
fc2ブログ

FPGAやCPLDの話題やFPGA用のツールの話題などです。 マニアックです。 日記も書きます。

FPGAの部屋

FPGAの部屋の有用と思われるコンテンツのまとめサイトを作りました。Xilinx ISEの初心者の方には、FPGAリテラシーおよびチュートリアルのページをお勧めいたします。

バサロさんの”Ultra96v2でVitis AIを使った、MNIST(手書き文字)の実装。”をやってみる1

バサロさんの”Ultra96v2でVitis AIを使った、MNIST(手書き文字)の実装。”をやってみよう。

バサロさんの”Ultra96v2でVitis AIを使った、MNIST(手書き文字)の実装。”を使わせていただいて、手順に従って実行していく。

すでに”Vitis-AI 1.2 を Ubuntu 18.04 LTS にインストールする”で Vitis-AI が Ubuntu 18.04 に入っていて、起動も済んでいる。

2.演習データの取り込み
演習データを git clone して、 Vitis-AI-Tutrials/files ディレクトリに移動した。
git clone -b MNIST-Classification-TensorFlow https://github.com/Xilinx/Vitis-AI-Tutorials.git
cd Vitis-AI-Tutrials
cd files

Vitis_AI_1_2_bs_29_201129.png

3.学習
環境変数の設定をを行う。
source 0_setenv.sh
Vitis_AI_1_2_bs_30_201129.png

学習を行う。
source 1_train.sh
Vitis_AI_1_2_bs_31_201129.png

ログを示す。

(vitis-ai-tensorflow) masaaki@masaaki-H110M4-M01:/workspace/Vitis-AI-Tutorials/f
iles$ source 1_train.sh 
-----------------------------------------
TRAINING STARTED..
-----------------------------------------

------------------------------------
Keras version      : 2.2.4-tf
TensorFlow version : 1.15.2
Python version     : 3.6.10 |Anaconda, Inc.| (default, Mar 25 2020, 23:51:54) 
[GCC 7.3.0]
------------------------------------
Command line options:
 --input_height    :  28
 --input_width     :  28
 --input_chan      :  1
 --epochs          :  5
 --batchsize       :  100
 --learnrate       :  0.001
 --output_ckpt_path:  ./build/chkpts/float_model.ckpt
 --infer_graph_path:  ./build/chkpts/inference_graph.pb
 --tboard_path     :  ./build/tb_logs
 --gpu             :  0
------------------------------------

Downloading data from https://storage.googleapis.com/tensorflow/tf-keras-datasets/mnist.npz
11493376/11490434 [==============================] - 1s 0us/step
WARNING:tensorflow:From /workspace/Vitis-AI-Tutorials/files/customcnn.py:42: conv2d (from tensorflow.python.layers.convolutional) is deprecated and will be removed in a future version.
Instructions for updating:
Use `tf.keras.layers.Conv2D` instead.
WARNING:tensorflow:From /opt/vitis_ai/conda/envs/vitis-ai-tensorflow/lib/python3.6/site-packages/tensorflow_core/python/layers/convolutional.py:424: Layer.apply (from tensorflow.python.keras.engine.base_layer) is deprecated and will be removed in a future version.
Instructions for updating:
Please use `layer.__call__` method instead.
WARNING:tensorflow:From /workspace/Vitis-AI-Tutorials/files/customcnn.py:43: batch_normalization (from tensorflow.python.layers.normalization) is deprecated and will be removed in a future version.
Instructions for updating:
Use keras.layers.BatchNormalization instead.  In particular, `tf.control_dependencies(tf.GraphKeys.UPDATE_OPS)` should not be used (consult the `tf.keras.layers.batch_normalization` documentation).
WARNING:tensorflow:From /workspace/Vitis-AI-Tutorials/files/customcnn.py:63: flatten (from tensorflow.python.layers.core) is deprecated and will be removed in a future version.
Instructions for updating:
Use keras.layers.flatten instead.
WARNING:tensorflow:From /opt/vitis_ai/conda/envs/vitis-ai-tensorflow/lib/python3.6/site-packages/tensorflow_core/python/ops/losses/losses_impl.py:121: where (from tensorflow.python.ops.array_ops) is deprecated and will be removed in a future version.
Instructions for updating:
Use tf.where in 2.0, which has the same broadcast rule as np.where
Network input shape:  (?, 28, 28, 1)
                      (?, 14, 14, 16)
                      (?, 7, 7, 32)
                      (?, 4, 4, 64)
                      (?, 1, 1, 10)
Network output shape: (?, 10)

----------------------------
 TRAINING STARTED...
----------------------------
 Epoch 1 / 5 - accuracy 97.32 %
 Epoch 2 / 5 - accuracy 98.14 %
 Epoch 3 / 5 - accuracy 98.38 %
 Epoch 4 / 5 - accuracy 98.50 %
 Epoch 5 / 5 - accuracy 98.44 %

----------------------------
 SAVING CHECKPOINT & GRAPH...
----------------------------
 Saved checkpoint to ./build/chkpts/float_model.ckpt
Network input shape:  (?, 28, 28, 1)
                      (?, 14, 14, 16)
                      (?, 7, 7, 32)
                      (?, 4, 4, 64)
                      (?, 1, 1, 10)
Network output shape: (?, 10)
 Saved binary inference graph to ./build/chkpts/inference_graph.pb
 Run `tensorboard --logdir=./build/tb_logs --port 6006 --host localhost` to see the results.
-----------------------------------------
TRAINING COMPLETED
-----------------------------------------


学習が終わったデータを凍結化する。
source 2_freeze.sh
Vitis_AI_1_2_bs_32_201129.png
Vitis_AI_1_2_bs_33_201129.png

凍結したネットワークを図で確認する。
https://netron.app/ のサイトを表示する。
Open Model... ボタンをクリックする。

”ファイルを開く”ダイアログが表示される。

Vitis-AI/Vitis-AI-Tutorials/files/build/freeze/frozen_graph.pb を選択して、”開く”ボタンをクリックする。
Vitis_AI_1_2_bs_36_201129.png

すると次の図のようなニューラルネットワーク図が開く。
Vitis_AI_1_2_bs_34_201129.png
Vitis_AI_1_2_bs_35_201129.png

凍結したネットワークを検証する。
source 3_eval_frozen_graph.sh
Vitis_AI_1_2_bs_37_201129.png

精度は 98.00 % だった。
  1. 2020年11月30日 04:47 |
  2. Vitis-AI
  3. | トラックバック:0
  4. | コメント:0

”(目標)Vivado HLSで1クロック毎に結果を出力できるNNを作る”を Vitis HLS 2020.2 でやってみる

前にやった時に”large runtime and excessive memory usage”でうまく行かなかった”(目標)Vivado HLSで1クロック毎に結果を出力できるNNを作る”を Vitis HLS 2020.2 で、もう一度やってみよう。

前回、挫折した記事は”(目標)Vivado HLSで1クロック毎に結果を出力できるNNを作る4(チューンナップ1)”だった。Vitis HLS 2020.2 のプロジェクトを作成して、C コードの合成を行ったところやはり”large runtime and excessive memory usage”でエラーになってしまった。
Vitis_HLS_2020_2_39_201129.png

ERROR: [HLS 200-1471] Stop unrolling loop 'af1_dot2' (all_deploy_afnet4mnist2_202/mnist_nn.cpp:844) in function 'mnist_nn' because it may cause large runtime and excessive memory usage due to increase in code size. Please avoid unrolling the loop or form sub-functions for code in the loop body.\


Solution Settings の Configuration Settings の config_compile にもそれらしいオプション無いようだし、今回もだめだったようだ。。。 orz
Vitis_HLS_2020_2_40_201129.png
  1. 2020年11月29日 05:45 |
  2. Vitis HLS
  3. | トラックバック:0
  4. | コメント:0

Vitis HLS 2020.2 を使ってみる3

Vitis HLS 2020.2 を使ってみる2”の続き。

前回は、 AXI4 Master インターフェースのラプラシアン・フィルタを題材に Vitis HLS 2020.1 と Vitis_HLS 2020.2 を比較した。今回は、C シミュレーションや C/RTL 協調シミュレーションのオプションをチェックしてみよう。

最初に、”Vitis HLS 2020.1 と Vivado HLS 2019.2 の違い(AXI4 Master インターフェースでの offset=slave オプション時の扱いの違い)”で検証した。Vivado HLS と Vitis HLS の書き方の違いがあった。これは、 INTERFACE 指示子の m_axi オプションで AXI4 Master に指定したポートのオフセットを offset=slave で AXI4 Lite Slave のレジスタと指定した場合に、Vitis HLS はその AXI4 Master のポートも AXI4 Lite Slave として INTERFACE 指示子を付加する必要があるというものだった。
今回は、 AXI4 Lite Slave として INTERFACE 指示子を付加して無くても、1 つのレジスタ領域にまとめられているようだが、一応付加しよう。
lap_filter_axim() の cam_fb, lap_fb ポートに次の指示子を付加した。

#pragma HLS INTERFACE s_axilite port=lap_fb
#pragma HLS INTERFACE s_axilite port=cam_fb


Vitis_HLS_2020_2_30_201128.png

C シミュレーションを行った。 C Simulation ダイアログで、 Enable Pre-synthesis Control Flow Viewer にチェックを入れて OK ボタンをクリックした。
Vitis_HLS_2020_2_31_201128.png

すると、エラーが発生した。
Vitis_HLS_2020_2_32_201128.png

エラー内容を示す。

   Compiling ../../../laplacian_filter4.cpp in debug mode
   Generating csim.exe
Makefile.rules:392: recipe for target 'csim.exe' failed
obj/lap_filter_tb.o: 関数 `main' 内:
/tmp/apcc_db_masaaki/56901606564857179227/lap_filter_tb.c:1193: `lap_filter_axim' に対する定義されていない参照です
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [csim.exe] Error 1
ERROR: [SIM 211-100] 'csim_design' failed: compilation error(s).
INFO: [SIM 211-3] *************** CSIM finish ***************


いろいろとやってみたが、やはり、テストベンチの lap_filter_tb.c を lap_filter_tb.cpp にファイル名を変更しただけで、エラーが解消した。Vitis HLS ではテストベンチも C 言語のソースコードを使用しないほうが良さそうだ。

Pre-synthesis Control Flow Viewer が表示された。
Vitis_HLS_2020_2_33_201128.png

一部を拡大した。
Vitis_HLS_2020_2_34_201128.png

次に C/RTL 協調シミュレーションのオプションを試してみよう。
Wave Debug にチェックを入れた。
Vitis_HLS_2020_2_35_201128.png

Vivado のシミュレーション画面が表示されて、$finish; で止まっている。
Vitis_HLS_2020_2_36_201128.png

Wave Debug はうまく行ったが、後の Disable Deadlock Detection, Channel (PIPO/FIFO) Profiling, Dynamic Deadlock Prevention はうまく行かなかった。Vitis HLS 2020.1 でやってみた時もうまく行かなかったと思う。
  1. 2020年11月29日 05:35 |
  2. Vitis HLS
  3. | トラックバック:0
  4. | コメント:0

Vitis HLS 2020.2 を使ってみる2

Vitis HLS 2020.2 を使ってみる1”の続き。

Vivado 2020.2 が出たので、Vitis HLS 2020.2 も使ってみよう。
前回は、”Vivado HLS 2020.1 vs Vitis HLS 2020.1 (プロジェクトの作成)”で使用した multi_apuint.cpp を例にやってみた。今回は、 AXI4 Master インターフェースのラプラシアン・フィルタを題材に Vitis HLS 2020.1 と Vitis_HLS 2020.2 を比較しよう。

Vitis HLS 2020.1 の laplacian_filter4 プロジェクトを示す。
Vitis_HLS_2020_2_13_201128.png

Vitis HLS 2020.2 の laplacian_filter4 プロジェクトを示す。
Vitis_HLS_2020_2_14_201128.png

Vitis HLS 2020.1 で C シミュレーションを実行した。
Vitis_HLS_2020_2_15_201128.png

Vitis HLS 2020.2 で C シミュレーションを実行した。
Vitis_HLS_2020_2_16_201128.png

どちらの Vitis HLS でも出力されたフィルタ出力のエッジ画像には違いはない。

そうそう、ZYBO Z7-20 なので、AXI4 Master の 64 ビットアドレスは OFF しておこう。
Vitis HLS 2020.1 の Solution Settings の General の Add ボタンをクリックした時の設定画面を示す。
config_interface の m_axi_addr64 のチェックボックを off した。
Vitis_HLS_2020_2_17_201128.png

Vitis HLS 2020.2 の Solution Settings の General の設定画面はそのまま設定値をいじることができるようになっている。
同様に config_interface の m_axi_addr64 のチェックボックを off した。
Vitis_HLS_2020_2_18_201128.png

Vitis HLS 2020.1 で Top Function を選ぼうとするとリストが空だった。
Vitis_HLS_2020_2_19_201128.png

Vitis HLS 2020.2 でも Top Function を選ぼうとするとリストが空だった。

閃いて、 laplacian_filter4.c を名前だけ laplacian_filter4.cpp に変更した。
すると、 Vitis HLS 2020.1 も Vitis HLS 2020.2 でも Top Function を設定することができた。
Vitis_HLS_2020_2_20_201128.png

C 言語のソースファイルがダメなわけじゃないですよね?バグかな?

C コードの合成を行った。
Vitis HLS 2020.1 で C コードの合成を行ったところ、エラーになってしまった。
Vitis_HLS_2020_2_21_201128.png

エラー内容を示す。

ERROR: [HLS 214-200] Bundle name conflict happens between interface pragma, possible reason: (1) same with maxi offset=off bundle name; (2) same bundle name between maxi and s_axilite interfaces; (3) same with port name directly; in Function 'lap_filter_axim(int volatile*, int volatile*)' (laplacian_filter4/laplacian_filter4.cpp:13:0)


Vitis HLS 2020.2 で C コードの合成を行ったところ、こちらはうまく行った。
Vitis_HLS_2020_2_22_201128.png

レポートも増えている。
Vitis_HLS_2020_2_23_201128.png
Vitis_HLS_2020_2_24_201128.png

Vitis HLS 2020.2 で config_interface の m_axi_addr64 のチェックボックを off したので、 cam_fb_offset や lap_fb_offset が [31:0] しか無かった。 m_axi_addr64 のチェックボックを on すると [63:32] も出てくる。 Vitis HLS 2020.1 では、m_axi_addr64 のチェックボックを off しても [63:32] が消えなかった。
Vitis_HLS_2020_2_25_201128.png

Vitis HLS 2020.2 の C/RTL 協調シミュレーションを行った。結果を示す。
Vitis_HLS_2020_2_26_201128.png

Vitis HLS 2020.2 での Export RTL を Vivado synthesis, place and route にチェックを入れて行った。
Vitis_HLS_2020_2_27_201128.png

Export RTL の結果を行った。
Vitis_HLS_2020_2_28_201128.png

Vitis HLS 2020.1 の C コード合成時のエラーだが、”(3) same with port name directly”がダメそうなので、bundle 名を変更した。

#pragma HLS INTERFACE m_axi depth=3072 port=cam_fb offset=slave bundle=cam_fb0
#pragma HLS INTERFACE m_axi depth=3072 port=lap_fb offset=slave bundle=lap_fb0


これで合成が通った。
Vitis_HLS_2020_2_29_201128.png
  1. 2020年11月28日 14:55 |
  2. Vitis HLS
  3. | トラックバック:0
  4. | コメント:0

Vitis HLS 2020.2 を使ってみる1

Vivado 2020.2 が出たので、Vitis HLS 2020.2 も使ってみよう。
Vivado HLS 2020.1 vs Vitis HLS 2020.1 (プロジェクトの作成)”で使用した multi_apuint.cpp を例に見ていこう。

Vitis HLS 2020.2 で multi_apuint プロジェクトを作成した。
Vitis_HLS_2020_2_1_201127.png

ボタンがすべてプルダウンメニューになっている。

C シミュレーションをおこなう。プルダウンメニューから C Simulation を選択する。
Vitis_HLS_2020_2_2_201127.png

C Simulation Dialog が開く。これは、2020.1 と変わらない?
Vitis_HLS_2020_2_3_201127.png

C シミュレーション結果が表示された。
Vitis_HLS_2020_2_4_201127.png

次に C コードの合成を行った。
レポートが充実している。
Vitis_HLS_2020_2_5_201127.png
Vitis_HLS_2020_2_6_201127.png

Analysis 画面を表示した。
Vitis_HLS_2020_2_7_201127.png

Operation がシンプルになっている?

C/RTL 協調シミュレーションを行う。
Co-simulation Dialog を示す。これは変化ないか?
Vitis_HLS_2020_2_8_201127.png

C/RTL 協調シミュレーション結果を示す。
下位のモジュールやループにかかっている時間も表示するようになったようだ。このコードでは、乗算のみなので、変化はない。
Vitis_HLS_2020_2_9_201127.png

C/RTL 協調シミュレーションの波形を表示した。
HLS Process Summary や AESL_ints_xxxx 信号が増えている。。。
Vitis_HLS_2020_2_10_201127.png

Export RTL を行った。
Export RTL ダイアログで Vivado synthesis, place and route にチェックを入れた。
Vitis_HLS_2020_2_11_201127.png

Export RTL の結果を示す。
結果がでるのが速かった気がするが気のせいだろうか?もっとやってみて、比較する必要があるな。
Vitis_HLS_2020_2_12_201127.png

DSP 1 個に割り当てられている。これは、Vitis HLS 2020.1, Vivado HLS 2020.1 の結果と変わらない。
  1. 2020年11月27日 04:17 |
  2. Vitis HLS
  3. | トラックバック:0
  4. | コメント:0

Vivado 2020.2 の新機能1

昨日、Vviado 2020.2 が出たので、早速、起動して新機能を確認してみた。

Vivado 2020.2 の新機能は Xilinx 社の”What's New in Vivado”に書いてある。

Vivado 2020.2 を立ち上げた。この時点では前のバージョンと変更は無いようだ。
Vivado_2020_2_1_201126.png

Create Project していくと、Project Type ダイアログに "Project is an extensible Vitis Platform" が追加されている。
Vitis プラットフォームを作成する時に使えるようだ。
Vivado_2020_2_2_201126.png

プロジェクト作成手順を進めていて、プロジェクトを作成した。
Vivado_2020_2_3_201126.png

Zynq PS と AXI_GPIO を使用したブロックデザインを作成した。
Vivado_2020_2_4_201126.png

ブロックデザインを拡大する。
Vivado_2020_2_5_201126.png

Address Editor を示す。
Vivado_2020_2_6_201126.png

Vivado 2020.2 では、 Address Map 画面が増えている。
Vivado_2020_2_7_201126.png

Add IP で xpm_cdc IP が追加できるようになった。(ツィッターで TL で話題にもなっていた。 xpm_cdc については、確か IDA さんと windy さんに教えてもらったのだったか?)
これは、シンクロナイザーの IP で異なるクロックのデータを同期する時に使われる。
Vivado_2020_2_8_201126.png

xpm_cdc をダブルクリックして設定画面を表示した。
Vivado_2020_2_9_201126.png

現在の CDC Type は Synchronous Reset Synchronizer となっているが、プルダウンメニューからいろいろと設定できるようだ。
Vivado_2020_2_10_201126.png

なお、xpm_cdc については、”UltraScale アーキテクチャ ライブラリ ガイド UG974 (v2019.2) 2019 年 10 月 30 日”や、”Vivado Design Suite 7 シリーズ FPGA および Zynq-7000 SoC ライブラリ ガイド UG953 (v2019.2) 2019 年 10 月 30 日”をご覧ください。

その後、ビットファイルも生成して Hardware Export してみたが、前のバージョンとの差異は感じなかった。
  1. 2020年11月26日 04:40 |
  2. Vivado
  3. | トラックバック:0
  4. | コメント:0

Vitis, Vivado 2020.2 がでました

Vitis, Vivado 2020.2 がでました。

日本の Xilinx 社のダウンロード・ページにはまだ 2020.2 がありませんが、USA の Xilinx 社のダウンロード・ページには 2020.2 があります。

早速、Ubuntu 18.04 にダウンロードしてインストールしました。
Vitis HLS 2020.2 のGUI が変わっていました。

現在、Windows 10 にインストール中です。

(追記)
日本の Xilinx 社のダウンロード・ページにも 2020.2 のダウンロード・リンクが出ています。
  1. 2020年11月25日 05:09 |
  2. Vivado
  3. | トラックバック:0
  4. | コメント:0

Vitis-AI 1.2 を Ubuntu 18.04 LTS にインストールする

バサロさんの”Ultra96v2でVitis AIを使った、MNIST(手書き文字)の実装。”をやるために、Vitis-AI を Ubuntu 18.04 LTS にインストールする。

GitHub の Xilinx/Vitis-AI を見ながらインストールしよう。
まずは、Docker をインストールする。私は Docker をインストールしてあるので、ここはパス。

Ensure your linux user is in the group docker”する。

sudo groupadd docker
はすでにグループを作ってあった。

sudo usermod -aG docker $USER
で自分を docker グループに追加した。

docker run hello-world
で起動テストをした。
Vitis_AI_1_2_bs_28_201124.png
Vitis_AI_1_2_bs_23_201124.png

Vitis-AI をクローンして、Vitis-AI ディレクトリに入った。
git clone --recurse-submodules https://github.com/Xilinx/Vitis-AI
cd Vitis-AI

Vitis_AI_1_2_bs_24_201124.png

CPU で実行される Docker を PULL した。
docker pull xilinx/vitis-ai:latest
Vitis_AI_1_2_bs_25_201124.png
Vitis_AI_1_2_bs_26_201124.png

Docker を起動した。
./docker_run.sh xilinx/vitis-ai:latest
Vitis_AI_1_2_bs_27_201124.png

Vitis-AI が起動できた。
  1. 2020年11月25日 03:38 |
  2. Vitis-AI
  3. | トラックバック:0
  4. | コメント:0

バサロさんの”Ultra96v2向けVitis AI のデモ(SDカードイメージ)2020.1版”をやってみる2

バサロさんの”Ultra96v2向けVitis AI のデモ(SDカードイメージ)2020.1版”をやってみる1”の続き。

Vitis-AI を使ってみたいので、バサロさんが公開された”Ultra96v2向けVitis AI のデモ(SDカードイメージ)2020.1版”をやってみることにしたということで、前回は、イメージを MicroSD カードに書き込んで、Ultra96V2 に挿入して、PetaLinux をブートした。今回は、Vitis-AI を動かしてみよう。

前回は、USB - LAN ケーブルを接続していたので、Ultra96V2 の PetaLinux に IP が振られていた。よって、SSH 接続してみよう。
ssh 192.168.3.23 -X -l root
したところ、以前も使用したことがあるので、鍵が違うと出てしまった。
ssh-keygern -f "/home/masaaki/.ssh/known_hosts" -R "192.168.3.23"
を実行させると新しい鍵を生成したようだ。
再度、
ssh 192.168.3.23 -X -l root
を入れると接続できた。
Vitis_AI_1_2_bs_10_201123.png
Vitis_AI_1_2_bs_11_201123.png

パソコンにダウンロードしてあった vitis-ai_v1.2_dnndk.tar.gz、 vitis-ai_v1.2_dnndk_sample_img.tar.gz、 vitis_ai_dnndk_samples_u96v2.zip を Ultra96V2 の PetaLinux にアップロードする。
FileZilla を起動して、 Ultra96V2 の PetaLinux にログインした。
Vitis_AI_1_2_bs_12_201123.png

vitis-ai_v1.2_dnndk.tar.gz、 vitis-ai_v1.2_dnndk_sample_img.tar.gz、 vitis_ai_dnndk_samples_u96v2.zip を Ultra96V2 の PetaLinux の /home/root にアップロードした。
Vitis_AI_1_2_bs_13_201123.png

vitis-ai_v1.2_dnndk.tar.gz、 vitis-ai_v1.2_dnndk_sample_img.tar.gz、 vitis_ai_dnndk_samples_u96v2.zip を展開する。
tar xzf vitis-ai_v1.2_dnndk.tar.gz
tar xzf vitis-ai_v1.2_dnndk_sample_img.tar.gz
unzip vitis_ai_dnndk_samples_u96v2.zip

Vitis_AI_1_2_bs_14_201123.png
Vitis_AI_1_2_bs_15_201123.png

vitis-ai_v1.2_dnndk ディレクトリに入って、 install.sh を実行する。
cd vitis-ai_v1.2_dnndk
./install.sh

Vitis_AI_1_2_bs_16_201123.png

/home/root/vitis_ai_dnndk_samples/resnet50 ディレクトリに入って、ビルドする。
cd ~/vitis_ai_dnndk_samples/
cd resnet50
./build.sh u96v2

Vitis_AI_1_2_bs_17_201123.png
Vitis_AI_1_2_bs_18_201123.png

resnet50 がビルドされたので、起動した。
いろいろな写真が表示されて、その認識結果がターミナルに表示されているようだ。その内の 2 個を示す。

かまきりの写真で、認識結果は、 mantis で合っている。
Vitis_AI_1_2_bs_19_201123.jpg

次は、鶏の写真で認識結果は hen でこちらも合っている。
Vitis_AI_1_2_bs_20_201123.jpg

もう1つ tf_yolov3_voc_py をやってみた。
./build .sh u96v2
を行った。
Vitis_AI_1_2_bs_21_201123.png

python3 tf_yolov3_voc.py
を実行したところ、犬の写真で犬を認識したようだ。
Vitis_AI_1_2_bs_22_201123.jpg
  1. 2020年11月24日 04:38 |
  2. Vitis-AI
  3. | トラックバック:0
  4. | コメント:0

バサロさんの”Ultra96v2向けVitis AI のデモ(SDカードイメージ)2020.1版”をやってみる1

Vitis-AI を使ってみたいので、バサロさんが公開された”Ultra96v2向けVitis AI のデモ(SDカードイメージ)2020.1版”をやってみることにした。これは、同じくバサロさんの公開された”Ultra96v2でVitis AIを使った、MNIST(手書き文字)の実装。”をやって見るための布石である。
なお、OS は Ubuntu 18.04 LTS を使用する。

さて、sd_card.img.zip、 vitis-ai_v1.2_dnndk.tar.gz、 vitis-ai_v1.2_dnndk_sample_img.tar.gz、 vitis_ai_dnndk_samples_u96v2.zip をダウンロードした。ダウンロードのリンクは、”Ultra96v2向けVitis AI のデモ(SDカードイメージ)2020.1版”を参照のこと。
Vitis_AI_1_2_bs_1_201122.png

sd_card.img.zip を解凍して、sd_card.img が解凍できたので、それを balenaEtchar で MicroSD カードに書き込む。
Vitis_AI_1_2_bs_2_201122.png

書き込めた。
Vitis_AI_1_2_bs_3_201122.png

書かれた MicroSD カードには 2 つのパーティションができていて、その内の 1.1 GB パーティションの内容を示す。ブート用のファイルがある。
Vitis_AI_1_2_bs_4_201122.png

2.2 GB パーティションの内容を示す。こちらは Roof File System のようだ。
Vitis_AI_1_2_bs_5_201123.png

gtkerm を起動する。
sudo gtkterm --port /dev/ttyUSB1 --speed 115200
Vitis_AI_1_2_bs_6_201123.png

MicroSD カードを Ultra96V2 に挿入して、電源 ON すると、 PetaLinux が立ち上がった。
Vitis_AI_1_2_bs_7_201123.png

私の Ultra96V2 の様子。デュアル・カメラ基板が載っているが、カメラのマニュアルが無いので、手が出ない。。。orz
そのうちに Linux のドライバを読んで、パラメータを推測してみようと思っている。
Vitis_AI_1_2_bs_23_201123.jpg

第 2 パーティションの領域を拡張する。
parted
を起動した。
Partition number を聞かれるので、 2
/dev/mmcblk0p2 は使用しているけど、続けるのか? yes
End? 100%
を入力した。
resize2fs /dev/mmcblk0p2
を実行した。
df
すると、 13346444 k-blocks になっているので、第 2 パーティションが拡張された。
Vitis_AI_1_2_bs_8_201123.png

この後、”5.Ultra96v2とパソコンを接続させる(SSH接続)”を行うのだが、私は USB - LAN アダプタが接続されているので、自動認識されていた。
ifconfig
すると、IP が振られているのが分かる。
Vitis_AI_1_2_bs_9_201123.png

使用している USB - LAN ケーブルは昔買ったもので、プラネックスの GU-1000T という USB - LAN ケーブルだ。
  1. 2020年11月23日 13:05 |
  2. Vitis-AI
  3. | トラックバック:0
  4. | コメント:0

Adam Taylor さんの”MicroZed Chronicles: Using Analysis View in Vitis and Vivado”をやってみる3

Adam Taylor さんの”MicroZed Chronicles: Using Analysis View in Vitis and Vivado”をやってみる2”の続き。

Adam Taylor さんの”MicroZed Chronicles: Using Analysis View in Vitis and Vivado”が気になったので、自分でもやってみることにしたということで、前回は *raw_line の定義が volatile ap_uint<1> の時の C コードの合成、Analysis 画面を確認、C/RTL 協調シミュレーション、C/RTL 協調シミュレーションの波形の確認を行った。今回は、 *raw_line の定義が volatile bool の時の C コードの合成、Analysis 画面を確認、C/RTL 協調シミュレーション、C/RTL 協調シミュレーションの波形の確認を行う。

最初に、”MicroZed Chronicles: Using Analysis View in Vitis and Vivado”に示されているように、 Vitis HLS と Vivado HLS の *raw_line の定義を volatile ap_uint<1> から volatile bool に変更した。
adm_test_16_201121.png

C コードの合成を行った。
Vitis HLS 2020.1 を示す。
adm_test_17_201121.png

前回の結果と比べると、Latency が 49 クロックから 50 クロックになった。
リソース使用量も前回の Vivado HLS の結果と等しい。

Vivado HLS 2020.1 を示す。
adm_test_18_201121.png

adm_test_19_201121.png

前回と同じ結果だ。

Analysis 画面を確認する。
Vitis HLS
adm_test_20_201122.png

raw_line_write_ln12 が最初にある。

Vivado HLS
adm_test_21_201122.png

C/RTL 協調シミュレーションを行った。
Vitis HLS
adm_test_22_201122.png

Vivado HLS
adm_test_23_201122.png

C/RTL 協調シミュレーションの波形を示す。
Vitis HLS
adm_test_24_201122.png

Vivado HLS
adm_test_25_201122.png

raw_line の波形は同じだった。

やはり、Vitis HLS のバグなのか? 2020.2 では直っているだろうか?
  1. 2020年11月22日 04:28 |
  2. Vitis HLS
  3. | トラックバック:0
  4. | コメント:0

Adam Taylor さんの”MicroZed Chronicles: Using Analysis View in Vitis and Vivado”をやってみる2

Adam Taylor さんの”MicroZed Chronicles: Using Analysis View in Vitis and Vivado”をやってみる1”の続き。

Adam Taylor さんの”MicroZed Chronicles: Using Analysis View in Vitis and Vivado”が気になったので、自分でもやってみることにしたということで、前回はソースコードを貼って、Vitis HLS 2020.1 と Vivado HLS 2020.1 のプロジェクトを作成し、C シミュレーションを行った。今回は、 *raw_line の定義が volatile ap_uint<1> の時の C コードの合成、Analysis 画面を確認、C/RTL 協調シミュレーション、C/RTL 協調シミュレーションの波形の確認を行う。

C コードの合成を行う。
Vitis HLS 2020.1 の結果を示す。
adm_test_5_201120.png

Vivado HLS 2020.1 の結果を示す。
adm_test_6_201121.png

adm_test_7_201121.png

Vitis HLS の方が Latency が 1 クロック短い。 リソース使用量も Vitis HLS の方が少ないな。

Analysis 画面を見てみよう。
Vitis HLS
adm_test_8_201121.png

Vivado HLS
adm_test_9_201121.png

Vivado HLS には raw_line_V_write があるが Vitis HLS には無い。

Vitis HLS の最後には、raw_line_write がある。
adm_test_10_201121.png

Vivado HLS にも raw_line_V_write が存在する。
adm_test_11_201121.png

Vitis HLS の C/RTL 協調シミュレーション結果を示す。
adm_test_12_201121.png

Vivado HLS の C/RTL 協調シミュレーション結果を示す。
adm_test_13_201121.png

Vitis HLS の C/RTL 協調シミュレーション波形を示す。
adm_test_14_201121.png

raw_line がずーと 0 のままだ。これはおかしいのじゃないだろうか?

Vivado HLS の C/RTL 協調シミュレーション結果を示す。
adm_test_15_201121.png

やはりこれが正しいのではないだろうか?
  1. 2020年11月21日 17:07 |
  2. Vitis HLS
  3. | トラックバック:0
  4. | コメント:0

Adam Taylor さんの”MicroZed Chronicles: Using Analysis View in Vitis and Vivado”をやってみる1

Adam Taylor さんの”MicroZed Chronicles: Using Analysis View in Vitis and Vivado”が気になったので、自分でもやってみることにした。

結局、Vitis HLS 2020.1 のバグなんじゃないか?と思ったのだが、どうなんだろう?
Vitis HLS 2020.1 と Vivado HLS 2020.1 を比較してやってみようと思う。

まずは、Adam Taylor さんの”MicroZed Chronicles: Using Analysis View in Vitis and Vivado”には、 vitis_source.h やテストベンチが書かれていなかったので、ソースコードを少し書き換えさせてもらって、foo.h を追加した。更に、テストベンチを書いた。

多少書き換えた foo.cpp を示す。
ほとんどのコードは”MicroZed Chronicles: Using Analysis View in Vitis and Vivado”から引用しているが、インクルード部分と raw_line の宣言部分は私が書き換えた。

#include "foo.h"
#include "ap_utils.h"

void foo(volatile ap_uint<32> *reg, volatile op_type *raw_line){
#pragma HLS INTERFACE ap_none port=raw_line
#pragma HLS INTERFACE s_axilite bundle=ctrl port=reg
#pragma HLS INTERFACE s_axilite bundle=ctrl port=return

    ap_uint<32> local_reg = *reg;

    if ((local_reg & 1) == 1){
        *raw_line = 1;
        local_reg.clear(0);
        ap_wait_n(50);
    }

    *reg = local_reg;
    *raw_line = 0;
}


foo.h を示す。

// foo.h
// 2020/11/20 by marsee
//

#ifndef __FOO_H__
#define __FOO_H__

#include "ap_int.h"

typedef ap_uint<1> op_type;
// typedef bool op_type;

#endif


テストベンチの foo_tb.cpp を示す。

// foo_tb.cpp
// 2020/11/20 by marsee
//

#include "foo.h"

void foo(volatile ap_uint<32> *reg, volatile op_type *raw_line);

int main(){
    ap_uint<32> reg;
    op_type raw_line;

    reg = 0; raw_line = 1;
    foo(&reg, &raw_line);
    std::cout << "reg = " << reg << " raw_line = " << raw_line << std::endl;

    reg = 3; raw_line = 0;
    foo(&reg, &raw_line);
    std::cout << "reg = " << reg << " raw_line = " << raw_line << std::endl;

    return(0);
}



Vitis HLS 2020.1 と Vivado HLS 2020.1 の adam_test プロジェクトを作成した。
Vitis HLS 2020.1 の adam_test プロジェクトを示す。
adm_test_1_201120.png

Vivado HLS 2020.1 の adam_test プロジェクトを示す。
adm_test_2_201120.png

C シミュレーションを行った。
Vitis HLS 2020.1 の C シミュレーション結果を示す。
adm_test_3_201120.png

Vivado HLS 2020.1 の C シミュレーション結果を示す。
adm_test_4_201120.png

C シミュレーション結果には違いはない。
  1. 2020年11月20日 05:15 |
  2. Vitis HLS
  3. | トラックバック:0
  4. | コメント:0

GPS と 3軸加速度センサーを使ったシステム6(Vitis でアプリケーション・ソフトウェアを作成)

GPS と 3軸加速度センサーを使ったシステム5(Vivado 2020.1 のプロジェクトを作成中)”の続き。

前回は、GPS と 3 軸加速度センサーを 4 個使ったシステムの Vivado 2020.1 プロジェクトを紹介した。 GPS と 4 個の 3 軸加速度センサーそれぞれに MicroBlaze プロセッサを実装して、合計 5 個の MicroBlaze プロセッサと Zynq PS プロセッサが実装される回路になった。今回は、このシステムのアプリケーション・ソフトウェアを Vitis 2020.1 で作成したので、紹介する。

Vitis 2020.1 の画面を示す。
合計 5 個の MicroBlaze プロセッサと Zynq PS プロセッサについて、プラットフォームとアプリケーション・ソフトウェアを作成してある。
acc_gps_sensor_21_201118.png

4 個の MicroBlaze 用のアプリケーション・ソフトウェアは同じコードとなっている。
その mb_acc.c ソースコードを示す。
なお、ハードウェアはまだ作成していないので、すべてのコードは検証されていない。

// mb_app.c
// 2020/11/13 by marsee
//

#include <stdio.h>
#include <stdint.h>
#include <unistd.h>

#define TX_FIFO_EMPTY   0x80
#define RX_FIFO_EMPTY   0x40
#define BB              0x04

#define AXI_GPIO_0  0x40000000
#define AXI_GPIO_1  0x40010000
#define AXI_IIC_0   0x40800000

void acc_sensor_init(volatile uint32_t *axi_iic_ad){
    axi_iic_ad[72] = 0x0F; // RX_FIFI_PIRQ
    axi_iic_ad[64] = 0x2; // Control Register (100h) reset tx fifo
    axi_iic_ad[64] = 0x1; // Control Register (100h) enable i2c
}

void idle_check(volatile uint32_t *axi_iic_ad){
    int32_t status_reg;
    int32_t check_bit;

    do{
        status_reg = axi_iic_ad[65]; // Status Register (104h))
        check_bit = status_reg & (TX_FIFO_EMPTY | RX_FIFO_EMPTY | BB);
    }while(check_bit != (TX_FIFO_EMPTY | RX_FIFO_EMPTY)) ;
}

void acc_sensor_write(volatile uint32_t *axi_iic_ad, uint32_t device_addr, uint32_t write_addr, uint32_t write_data){
    idle_check(axi_iic_ad);
    axi_iic_ad[66] = 0x100 | (device_addr & 0xfe); // Slave IIC Write Address, address is 0x108, i2c_tx_fifo
    axi_iic_ad[66] = write_addr & 0xff;           // address
    axi_iic_ad[66] = 0x200 | (write_data & 0xff);      // data
}

uint32_t acc_sensor_read(volatile uint32_t *axi_iic_ad, uint32_t device_addr, uint32_t read_addr){
    int32_t status_reg, rx_fifo_empty;

    idle_check(axi_iic_ad);
    axi_iic_ad[66] = 0x100 | (device_addr & 0xfe); // Slave IIC Write Address, address is 0x108, i2c_tx_fifo
    axi_iic_ad[66] = read_addr & 0xff;  // address byte
    axi_iic_ad[66] = 0x100 | (device_addr & 0xff); // Slave IIC Read Address, address is 0x108, i2c_tx_fifo, with repeat start
    axi_iic_ad[66] = 0x201;      // 1 byte data, NACK condition

    do{
        status_reg = axi_iic_ad[65];
        rx_fifo_empty = status_reg & RX_FIFO_EMPTY;
    }while(rx_fifo_empty); // Wait untill not RX_FIFO_EMPTY(Status Register (104h))

    int32_t read_data = axi_iic_ad[67] & 0xff; // Read Receive FIFO (10Ch)
    return(read_data);
}

void acc_sensor_recv(volatile uint32_t *axi_iic_ad, int32_t *dataX, int32_t *dataY, int32_t *dataZ){
    int32_t read_data, data_ready;

    do{
        read_data = acc_sensor_read(axi_iic_ad, 0x3b, 0x04);
        data_ready = read_data & 0x01;
    }while(data_ready != 0x01);

    *dataX = acc_sensor_read(axi_iic_ad, 0x3b, 0x08) << 12; // XDATA3
    *dataX |= (acc_sensor_read(axi_iic_ad, 0x3b, 0x09) << 4); // XDATA2
    *dataX |= ((acc_sensor_read(axi_iic_ad, 0x3b, 0x0a) & 0xf0) >> 4); // XDATA1

    *dataY = acc_sensor_read(axi_iic_ad, 0x3b, 0x0b) << 12; // YDATA3
    *dataY |= (acc_sensor_read(axi_iic_ad, 0x3b, 0x0c) << 4); // YDATA2
    *dataY |= ((acc_sensor_read(axi_iic_ad, 0x3b, 0x0d) & 0xf0) >> 4); // YDATA1

    *dataZ = acc_sensor_read(axi_iic_ad, 0x3b, 0x0e) << 12; // ZDATA3
    *dataZ |= (acc_sensor_read(axi_iic_ad, 0x3b, 0x0f) << 4); // ZDATA2
    *dataZ |= ((acc_sensor_read(axi_iic_ad, 0x3b, 0x10) & 0xf0) >> 4); // ZDATA1
}

int main(){
    volatile uint32_t *axi_iic_ad, *axi_gpio_0_ad, *axi_gpio_1_ad;
    int32_t dataX, dataY, dataZ;
    uint8_t count, count_b;

    axi_iic_ad = (volatile uint32_t *)AXI_IIC_0;
    axi_gpio_0_ad = (volatile uint32_t *)AXI_GPIO_0;
    axi_gpio_1_ad = (volatile uint32_t *)AXI_GPIO_1;

    acc_sensor_init(axi_iic_ad);

    acc_sensor_write(axi_iic_ad, 0x3a, 0x2c, 0x82); // I2C speed is Hi speed, +-4g

    acc_sensor_write(axi_iic_ad, 0x3a, 0x1e, 0x00); // OFFSET_X_H
    acc_sensor_write(axi_iic_ad, 0x3a, 0x1f, 0x00); // OFFSET_X_L
    acc_sensor_write(axi_iic_ad, 0x3a, 0x20, 0x00); // OFFSET_Y_H
    acc_sensor_write(axi_iic_ad, 0x3a, 0x21, 0x00); // OFFSET_Y_L
    acc_sensor_write(axi_iic_ad, 0x3a, 0x22, 0x00); // OFFSET_Z_H
    acc_sensor_write(axi_iic_ad, 0x3a, 0x23, 0x00); // OFFSET_Z_L

    acc_sensor_write(axi_iic_ad, 0x3a, 0x2d, 0x00); // stanby clear

    int start = 1;
    while(1){
        while(1){ // wait new count
            count = (uint8_t)(axi_gpio_0_ad[0] & 0xff);
            if(start == 1){
                count_b = count - 1;
                start = 0;
            }
            if(count /= count_b){ // sensor receive start
                count_b = count;
                break;
            } else {
                usleep(500); // 500 us wait
            }
        }

        dataX = 0; dataY = 0; dataZ = 0;
        acc_sensor_recv(axi_iic_ad, &dataX, &dataY, &dataZ);

        dataX |= ((uint32_t)count << 24);
        axi_gpio_0_ad[0] = dataX; // GPIO_0, 0x0, GPIO_DATA
        axi_gpio_0_ad[2] = dataY; // GPIO_0, 0x8, GPIO2_DATA
        axi_gpio_1_ad[0] = dataZ; // GPIO_1, 0x0, GPIO_DATA
    }

    return(0);
}


GPS を担当する MicroBlaze 用のアプリケーション・ソフトウェアの mb_gps.c を示す。

// mb_gps.c
// 2020/11/17 by marsee
// reference : GPS NMEA format
// https://www.hiramine.com/physicalcomputing/general/gps_nmeaformat.html
//

#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <unistd.h>
#include "xparameters.h"
#include "xuartlite_l.h"

// XPAR_GPS_UARTLITE_AXI_GPIO_MG0_BASEADDR 0x40000000 : [0]-latitude, [2]-longitude
// XPAR_GPS_UARTLITE_AXI_GPIO_MG1_BASEADDR 0x40010000 : [0]-gps_time

int main(){
    int i;
    char buf[100];
    char gps_time_s[20], latitude_s[20], longitude_s[20];
    int32_t gps_time, latitude, longitude;
    volatile int32_t *gpio_mg0, *gpio_mg1;
    double temp;

    gpio_mg0 = (volatile int32_t *)XPAR_GPS_UARTLITE_AXI_GPIO_MG0_BASEADDR;
    gpio_mg1 = (volatile int32_t *)XPAR_GPS_UARTLITE_AXI_GPIO_MG1_BASEADDR;

    XUartLite_SetControlReg(XPAR_GPS_UARTLITE_AXI_UARTLITE_0_BASEADDR, XUL_CR_FIFO_RX_RESET|XUL_CR_FIFO_TX_RESET); // Rst Rx FIFO, Rst TX FIFO
    XUartLite_SetControlReg(XPAR_GPS_UARTLITE_AXI_UARTLITE_0_BASEADDR, 0); // normal

    while(1){
        for(i=0; i<200; i++){
            char status = XUartLite_GetStatusReg(XPAR_GPS_UARTLITE_AXI_UARTLITE_0_BASEADDR);
            while(!(status & XUL_SR_RX_FIFO_VALID_DATA)); // Wait received data

            u8 read_data = XUartLite_RecvByte(XPAR_GPS_UARTLITE_AXI_UARTLITE_0_BASEADDR);
            buf[i] = read_data;
            if(read_data == '\n')
                break;
        }
        if(strstr(buf, "$GPRMC") == NULL)
            continue;
        strncpy(gps_time_s, &buf[7], 6); // UTC Time
        gps_time_s[6] = '\0';
        strncpy(latitude_s, &buf[20], 8);
        latitude_s[8] = '\0';
        strncpy(longitude_s, &buf[32], 9);
        longitude_s[9] = '\0';

        temp = atof(latitude_s); // convert double
        latitude = (int32_t)(temp * 1000.0);
        temp = atof(longitude_s); // convert double
        longitude = (int32_t)(temp * 1000.0);
        gps_time = (int32_t)(atoi(gps_time_s));

        gpio_mg0[0] = latitude;
        gpio_mg0[2] = longitude;
        gpio_mg1[0] = gps_time;
    }
}


最後に全体を統括する Zynq PS のアプリケーション・ソフトウェアを示す。

// arm_app.c
// 2020/11/16 by marsee
//

#include <stdio.h>
#include <stdint.h>
#include <unistd.h>
#include "xtime_l.h"
#include "xparameters.h"

#define WAIT_US 3333 // 3333 us = 300 Hz

// XPAR_AXI_UARTLITE_0_BASEADDR 0x42C00000U         : for GPS UART
// XPAR_AXI_GPIO_4_BASEADDR 0x41200000              : for GPS gpio
// XPAR_MB_IIC_0_AXI_GPIO_P00_BASEADDR 0x41210000   : for MB0 X and Y axis
// XPAR_MB_IIC_0_AXI_GPIO_P01_BASEADDR 0x41250000   : for MB0 Z axis
// XPAR_MB_IIC_1_AXI_GPIO_P10_BASEADDR 0x41220000   : for MB1 X and Y axis
// XPAR_MB_IIC_1_AXI_GPIO_P11_BASEADDR 0x41260000   : for MB1 Z axis
// XPAR_MB_IIC_2_AXI_GPIO_P20_BASEADDR 0x41230000   : for MB2 X and Y axis
// XPAR_MB_IIC_2_AXI_GPIO_P21_BASEADDR 0x41270000   : for MB2 Z axis
// XPAR_MB_IIC_3_AXI_GPIO_P30_BASEADDR 0x41240000   : for MB3 X and Y axis
// XPAR_MB_IIC_3_AXI_GPIO_P31_BASEADDR 0x41280000   : for MB3 Z axis
// XPAR_GPS_UARTLITE_AXI_GPIO_PG0_BASEADDR 0x41290000   : for GPS axi_uartlite
// XPAR_GPS_UARTLITE_AXI_GPIO_PG1_BASEADDR 0x412A0000   : for GPS axi_uartlite
// XPAR_AXI_GPIO_4_BASEADDR 0x41200000  : for GPS pps

void get_axis_data(volatile int32_t *gpio0, volatile int32_t *gpio1, uint8_t count,
        int32_t *dataX, int32_t *dataY, int32_t *dataZ){
    int32_t gpiod;

    do {
        gpiod = gpio0[0]; // dataX
    } while(((gpiod>>24) & 0xff) != count) ;

    if(gpiod & 0x80000) // sign extended
        gpiod |= 0xfff00000;
    else
        gpiod &= 0x000fffff;
    *dataX = gpiod;

    gpiod = gpio0[2]; // dataY
    if(gpiod & 0x80000) // sign extended
        gpiod |= 0xfff00000;
    else
        gpiod &= 0x000fffff;
    *dataY = gpiod;

    gpiod = gpio1[0]; // dataZ
    if(gpiod & 0x80000) // sign extended
        gpiod |= 0xfff00000;
    else
        gpiod &= 0x000fffff;
    *dataZ = gpiod;
}

int main(){
    volatile int32_t *mb_p00, *mb_p01, *mb_p10, *mb_p11, *mb_p20, *mb_p21, *mb_p30, *mb_p31;
    volatile int32_t *gps_uart_pg0, *gps_uart_pg1, *gps_pps;
    int32_t dataX0, dataY0, dataZ0;
    int32_t dataX1, dataY1, dataZ1;
    int32_t dataX2, dataY2, dataZ2;
    int32_t dataX3, dataY3, dataZ3;
    uint8_t count;
    XTime time;
    long long int time_us, time_us_n, temp_time;
    int32_t latitude, longitude, gps_time, pps;
    uint32_t int_time;

    mb_p00 = (volatile int32_t *)XPAR_MB_IIC_0_AXI_GPIO_P00_BASEADDR;
    mb_p01 = (volatile int32_t *)XPAR_MB_IIC_0_AXI_GPIO_P01_BASEADDR;
    mb_p10 = (volatile int32_t *)XPAR_MB_IIC_1_AXI_GPIO_P10_BASEADDR;
    mb_p11 = (volatile int32_t *)XPAR_MB_IIC_1_AXI_GPIO_P11_BASEADDR;
    mb_p20 = (volatile int32_t *)XPAR_MB_IIC_2_AXI_GPIO_P20_BASEADDR;
    mb_p21 = (volatile int32_t *)XPAR_MB_IIC_2_AXI_GPIO_P21_BASEADDR;
    mb_p30 = (volatile int32_t *)XPAR_MB_IIC_3_AXI_GPIO_P30_BASEADDR;
    mb_p31 = (volatile int32_t *)XPAR_MB_IIC_3_AXI_GPIO_P31_BASEADDR;
    gps_uart_pg0 = (volatile int32_t *)XPAR_GPS_UARTLITE_AXI_GPIO_PG0_BASEADDR;
    gps_uart_pg1 = (volatile int32_t *)XPAR_GPS_UARTLITE_AXI_GPIO_PG1_BASEADDR;
    gps_pps = (volatile int32_t *)XPAR_AXI_GPIO_4_BASEADDR;

    count = 0;
    XTime_GetTime(&time);
    time_us = (long long int)((double)(time)/333.333);
    int_time = time_us;
    while(1){
        usleep(2500); // 2.5 ms Wait
        do {
            XTime_GetTime(&time);
            time_us_n = (long long int)((double)(time)/333.333);
            usleep(10); // 10us Wait
        } while((time_us_n - time_us) < WAIT_US);
        time_us = time_us_n;

        count++;
        mb_p00[0] = count;
        mb_p10[0] = count;
        mb_p20[0] = count;
        mb_p30[0] = count;

        get_axis_data(mb_p00, mb_p01, count, &dataX0, &dataY0, &dataZ0);
        get_axis_data(mb_p10, mb_p11, count, &dataX1, &dataY1, &dataZ1);
        get_axis_data(mb_p20, mb_p21, count, &dataX2, &dataY2, &dataZ2);
        get_axis_data(mb_p30, mb_p31, count, &dataX3, &dataY3, &dataZ3);

        latitude = gps_uart_pg0[0];
        longitude = gps_uart_pg0[2];
        gps_time = gps_uart_pg1[0];
        pps = gps_pps[0];

        temp_time = (time_us/1000000)*1000000;
        int_time = (uint32_t)(time_us - temp_time);

        printf("0, %d, %d, %d, %d, %d, %x, %x, %x, %x, %x, %x, %x, %x, %x, %x, %x, %x\n", latitude, longitude, gps_time, pps, int_time,
                dataX0, dataY0, dataZ0, dataX1, dataY1, dataZ1, dataX2, dataY2, dataZ2, dataX3, dataY3, dataZ3);
    }
}


当初、MicroBlaze には、BRAM のメモリを 8kバイトマップしたのだが、 mb_gps.c は 40 kバイト程度のメモリを使用しているので、ELF ファイルが生成されなかった。そこで、ブロックデザインで BRAM の容量を 64 kバイトに変更した。というか、変更できなかったので、MicroBlaze を一旦消去して、再度 Add IP した。今度は BRAM の容量を 64 kバイトに指定した。
acc_gps_sensor_28_201119.png

3 軸加速度センサー用の MicoBlaze の BRAM の容量は 8 kバイトに設定してある。
acc_gps_sensor_29_201119.png
  1. 2020年11月19日 04:41 |
  2. FPGAを使用したシステム
  3. | トラックバック:0
  4. | コメント:0

MicroBlaze プロセッサのメモリ用の BRAM に ELF ファイルを関連付ける方法

MicroBlaze のアプリケーション・ソフトウェアをブート時にロードしたいと思っていた。ツィッターでツイートするとバサロさんが Vivado の Associate ELF Files で MicroBlaze に ELF ファイルを関連付ける方法を教えてくれた。早速やってみよう。

Associate ELF Files については、”Vivado Design Suite ユーザー ガイド エンベデッド プロセッサ ハードウェアデザイン UG898 (v2020.1) 2020 年 6 月 10 日”の 146 ページの”UpdateMEM を使用した BIT ファイルの MMI および ELF データでのアップデート”に記載がある。

Vivado のデザインは”GPS と 3軸加速度センサーを使ったシステム5(Vivado 2020.1 のプロジェクトを作成中)”の GPS と 3 軸加速度センサーを 4 個使ったシステムで、それぞれ 1 個の MicroBlaze プロセッサが搭載されていてるので、合計 5 個の MicroBlaze プロセッサが搭載されている。
すでに、Vitis で アプリケーション・ソフトウェアを作成してある。
acc_gps_sensor_21_201118.png

Vivado 2020.1 の Tools メニューから Associate ELF Files... を選択する。

Associate ELF Files ダイアログが開く。
acc_gps_sensor_22_201118.png

gps_uartlite/microblaze_0 の Associate ELF File を指定する。右端の・・・ボタンをクリックする。
Select ELF Files ダイアログが開く。
mb_gps.elf を選択して OK ボタンをクリックする。(適当な ELF ファイルが無い場合は Add Files... ボタンをクリックして、適当な ELF ファイルを選択する)
acc_gps_sensor_23_201118.png

gps_uartlite/microblaze_0 の Associate ELF File に mb_gps.elf が指定された。
acc_gps_sensor_24_201118.png

Associate ELF Files ダイアログを OK ボタンをクリックして閉じると、Vivado の右上に write_bitstream Out-of-date と表示された。
Flow Navigator から Generate Bitsteram をクリックして、ビットファイルを生成する。
acc_gps_sensor_25_201118.png

Running write_bitstream になって、ビットファイルを生成しているところだ。つまり、 Generate Bitsteram のフェーズのみ実行されるので、時間がかからなくて良い。
acc_gps_sensor_26_201118.png

write_bitstream Complete になった。
acc_gps_sensor_27_201118.png

Associate ELF Files で MicroBlaze に ELF ファイルを関連付ける方法をやってみたが、PS の DDR SDRAM を MicroBlaze のメモリとして使用する方法もある。
旧 Xilinx ツールの EDK を使用する例ではあるが、”シンプルな AMP : Zynq SoC Cortex-A9 ベアメタル システムと MicroBlaze プロセッサ”がある。これも参考になると思う。
最後にツィッターでは IDA さんにもいろいろ通してていただいた。皆様、ありがとうございます。
  1. 2020年11月18日 05:10 |
  2. MicroBlaze
  3. | トラックバック:0
  4. | コメント:0

GPS と 3軸加速度センサーを使ったシステム5(Vivado 2020.1 のプロジェクトを作成中)

GPS と 3軸加速度センサーを使ったシステム4(3軸加速度センサーのI2Cを3m伸ばした)”の続き。

GPS と 3 軸加速度センサーを 4 個使ったシステムを作成している。今回は、Vivado 2020.1 の acc_gps_sensor_mb プロジェクトを作成した。これは、MicroBlaze が 5 個と、Zynq の PS の ARM Cortex-A9 を使用したシステムだ。
MicroBlaze は、 4 個の 3 軸加速度センサーにそれぞれ 1 個ずつ使用し、GPS にも MicroBlaze を 1 個使用する。
MicroBlaze は各センサー専任とする。 3 軸加速度センサーの MicroBlaze は PS からの指示があった場合に加速度値を取得して axi_gpio に値をセットする。MicroBlaze の axi_gpio からの主力を PS 側の axi_gpio で受けて、PS 側が加速度値を取得できるようになっている。
PS からの指示はカウンタを使用する。カウント値が以前と異なる場合に 3 軸加速度センサー側の MicroBlaze が加速度値を取得して axi_gpio にセットする。カウント値も axi_gpio で渡すことにする。この間隔は 3.333 ms , 300 Hz とする予定だ。
GPS のデータは 1 秒に 1 回送られてくるので、それを MicroBlaze で取得して、必要なデータのみを axi_gpio 経由で PS が取得する。
基本コンセプトは割り込みを極力使わないシステムということになる。

Vivado の acc_gps_sensor_mb プロジェクトを示す。
acc_gps_sensor_10_201117.png

acc_gps_bd ブロックデザインを示す。
acc_gps_sensor_11_201117.png

4 個の mb_iic_x モジュールと GPS の PPS を取得するための axi_gpio_4 、 gps_uartlite モジュールがある。

mb_iic_0 モジュールの中身を示す。
acc_gps_sensor_12_201117.png

axi_gpio_p00, axi_gpio_p01 が PS に接続されている axi_gpio で、 axi_gpio_m00, axi_gpio_m01 が MicroBlaze 側に接続されている axi_gpio となっている。
後の 3 個の mb_iic_x モジュールも一緒の構成になっている。

mb_iic_1 モジュールの中身を示す。
acc_gps_sensor_13_201117.png

mb_iic_2 モジュールの中身を示す。
acc_gps_sensor_14_201117.png

mb_iic_3 モジュールの中身を示す。
acc_gps_sensor_15_201117.png

gps_uartlite モジュールの中身を示す。
acc_gps_sensor_16_201117.png

axi_uartlite で GPS のシリアルデータを受け取る。

Address Editor を示す。
acc_gps_sensor_17_201117.png
acc_gps_sensor_18_201117.png

制約ファイルの acc_gps_sensor_mb.xdc を示す。

set_property PACKAGE_PIN V8 [get_ports iic_0_scl_io]; # JB,1
set_property PACKAGE_PIN W8 [get_ports iic_0_sda_io]; # JB,2
set_property IOSTANDARD LVCMOS33 [get_ports iic_0_scl_io];
set_property IOSTANDARD LVCMOS33 [get_ports iic_0_sda_io];

set_property PACKAGE_PIN V6 [get_ports iic_1_scl_io]; # JB,9
set_property PACKAGE_PIN W6 [get_ports iic_1_sda_io]; # JB,10
set_property IOSTANDARD LVCMOS33 [get_ports iic_1_scl_io];
set_property IOSTANDARD LVCMOS33 [get_ports iic_1_sda_io];

set_property PACKAGE_PIN V15 [get_ports iic_2_scl_io]; # JC,1
set_property PACKAGE_PIN W15 [get_ports iic_2_sda_io]; # JC,2
set_property IOSTANDARD LVCMOS33 [get_ports iic_2_scl_io];
set_property IOSTANDARD LVCMOS33 [get_ports iic_2_sda_io];

set_property PACKAGE_PIN T11 [get_ports iic_3_scl_io]; # JC,3
set_property PACKAGE_PIN T10 [get_ports iic_3_sda_io]; # JC,4
set_property IOSTANDARD LVCMOS33 [get_ports iic_3_scl_io];
set_property IOSTANDARD LVCMOS33 [get_ports iic_3_sda_io];

set_property PACKAGE_PIN U7 [get_ports uart_0_rxd]; # JB,3
set_property PACKAGE_PIN V7 [get_ports uart_0_txd]; # JB,4
set_property IOSTANDARD LVCMOS33 [get_ports uart_0_rxd];
set_property IOSTANDARD LVCMOS33 [get_ports uart_0_txd];

set_property PACKAGE_PIN Y7 [get_ports gpio_0_tri_i]; # JB,7
set_property IOSTANDARD LVCMOS33 [get_ports gpio_0_tri_i];


論理合成、インプリメンテーション、ビットストリームの生成を行って、成功した。
Project Summary を示す。
acc_gps_sensor_19_201117.png
acc_gps_sensor_20_201117.png
  1. 2020年11月17日 04:07 |
  2. FPGAを使用したシステム
  3. | トラックバック:0
  4. | コメント:0

WSL2 上で動作する Vitis HLS 2020.1 の C シミュレーション時のエラー解消

WSL2 上で動作する Vitis HLS 2020.1 の C シミュレーション時に 2 つエラーが出てしまったので、その解消方法を書いておく。

WSL2 を立ち上げ、Vitis 2020.1 の環境を設定し、XRT の環境を設定した。
source /home/masaaki/tools/Xilinx/Vitis/2020.1/settings64.sh
source /opt/xilinx/xrt/setup.sh
vitis_hls &

Vitis_HLS_Error_3_201115.png

Vitis HLS 2020.1 が立ち上がった。
Vitis_HLS_Error_5_201115.png

プロジェクトを作成して、C シミュレーションを行ったが、エラーになってしまった。
sys/cdefs.h が No such file or directory というエラーだった。
ネットを検索すると”fatal error: sys/cdefs.h: No such file or directory|”が見つかった。
fatal error: sys/cdefs.h: No such file or directory|”によると、libc6-dev-i386 をインストールすればよいそうだ。
sudo apt install libc6-dev-i386
Vitis_HLS_Error_4_201115.png

もう一度、C simulation を行った。

g++ -L/runtime/lib/x86_64 -lstdc++ -lxilinxopencl -lgomp ./src/streamHost-all.o -o gstreambench
/lnx64/binutils-2.26/bin/ld: cannot find crt1.o: No such file or directory
/lnx64/binutils-2.26/bin/ld: cannot find crti.o: No such file or directory
/lnx64/binutils-2.26/bin/ld: cannot find -lm
/lnx64/binutils-2.26/bin/ld: cannot find -lc
/lnx64/binutils-2.26/bin/ld: cannot find crtn.o: No such file or directory
collect2: ld returned 1 exit status


というようなエラーだった。
また、ネットで検索すると”AR# 69355 SDx 2017.x - .settings64-SDx.csh ファイルの LIBRARY_PATH に /usr/lib/x86_64-linux-gnu へのパスが含まれていない”が検索できた。
これによると、LIBRARY_PATH を設定すれば良いとのことだった。
Vitis HLS を一旦落として、
export LIBRARY_PATH=/usr/lib/x86_64-linux-gnu
を実行して、もう一度、Vitis HLS を立ち上げて C Simulation したところ、C シミュレーションに成功した。
Vitis_HLS_Error_1_201115.png

export LIBRARY_PATH=/usr/lib/x86_64-linux-gnu
を .bashrc に追加しておいた。
Vitis_HLS_Error_2_201115.png
  1. 2020年11月16日 04:18 |
  2. Vitis HLS
  3. | トラックバック:0
  4. | コメント:0

ACRiルームの Alveo U50 で Emulation-SW と Emulation-HW を試す2

ACRiルームの Alveo U50 で Emulation-SW と Emulation-HW を試す1”の続き。

Assistant ウインドウをすべて展開した。
Emulation-SW, Emulation-HW 共に、vadd-Default の下に Run Summary があるのが分かる。
ACRi_U50_99_201114.png

Emulation-SW -> vadd-Default -> Run Summary (xclbin) を右クリックし、右クリックメニューから Open in Vitis Analyzer を選択した。
ACRi_U50_100_201114.png

Run Summary ウインドウが表示された。
ACRi_U50_101_201114.png

Profile Summary を示す。
ACRi_U50_102_201115.png

Application Timeline を示す。
ACRi_U50_103_201115.png

波形がある部分を拡大した。
ACRi_U50_104_201115.png

更に拡大した。
ACRi_U50_105_201115.png

次に、Emulation-HW -> vadd-Default -> Run Summary (binary_container_1.xclbin) を右クリックし、右クリックメニューから Open in Vitis Analyzer を選択した。
ACRi_U50_106_201115.png

Run Summary ウインドウが表示された。
ACRi_U50_107_201115.png

System Diagram を示す。
ACRi_U50_108_201115.png

Platform Diagram を示す。
ACRi_U50_109_201115.png

Run Guidance の一部を示す。
ACRi_U50_110_201115.png

Profile Summary を示す。
ACRi_U50_111_201115.png

Application Timeline を示す。
ACRi_U50_112_201115.png

拡大した。
ACRi_U50_113_201115.png
  1. 2020年11月15日 05:03 |
  2. Alveo
  3. | トラックバック:0
  4. | コメント:0

ACRiルームの Alveo U50 で Emulation-SW と Emulation-HW を試す1

今までは Ultra96V2 の自作の Vitis アクセラレーション・プラットフォームを使ってきたので、QEMU が設定されていなかった。よって、 Emulation-SW と Emulation-HW を試したことが無かった。今回は、ACRiルームの Alveo U50 を使用するので、 Emulation-SW と Emulation-HW を試してみたい。

ACRiルームの Alveo U50 で ChipScope Debug を試す2”で vadd に wait_for_enter() 関数を追加したが、それをコメントアウトした。
vadd の Emulation-SW をビルドした。
下の図に Emulation-SW をビルドしようと、Assistant ウインドウで Emulation-SW を右クリックし、右クリックメニューから Build を選択した様子を示す。
ACRi_U50_92_201113.png

Emulation-SW のビルドはすぐに終わったが、Emulation-HW のビルドは Hardware と同様に遅かった。

さて、実行してみよう。まずは、 Emulation-SW から実行してみよう。
Assistant ウインドウで Emulation-SW を右クリックし、右クリックメニューから vadd-Default を選択した。
ACRi_U50_93_201113.png

TEST PASSED が表示された。実行時間は短い。
ログを示す。

[Console output redirected to file:/home/u_marsee101/Vitis_Work/U50/2019.2/vadd/Emulation-SW/vadd-Default.launch.log]
Loading: '../binary_container_1.xclbin'
TEST PASSED



次に、 Emulation-HW をやってみる。
Assistant ウインドウで Emulation-SW を右クリックし、右クリックメニューから Build を選択してビルド成功した。
ACRi_U50_95_201113.png

Assistant ウインドウで Emulation-HW を右クリックし、右クリックメニューから vadd-Default を選択した。
TEST PASSED が表示された。実行時間はEmulation-SW よりも長い。
ACRi_U50_96_201113.png

ログを示す。

[Console output redirected to file:/home/u_marsee101/Vitis_Work/U50/2019.2/vadd/Emulation-HW/vadd-Default.launch.log]
Loading: '../binary_container_1.xclbin'
INFO: [HW-EM 01] Hardware emulation runs simulation underneath. Using a large data set will result in long simulation times. It is recommended that a small dataset is used for faster execution. The flow uses approximate models for DDR memory and interconnect and hence the performance data generated is approximate.
TEST PASSED
INFO: [HW-EM 06-0] Waiting for the simulator process to exit
INFO: [HW-EM 06-1] All the simulator processes exited successfully



vadd/Emulation-SW ディレクトリを示す。
ACRi_U50_97_201114.png

vadd/Emulation-HW ディレクトリを示す。
ACRi_U50_98_201114.png
  1. 2020年11月14日 05:02 |
  2. Alveo
  3. | トラックバック:0
  4. | コメント:0

ACRiルームの Alveo U50 で ChipScope Debug を試す2

ACRiルームの Alveo U50 で ChipScope Debug を試す1”の続き。

前回は、”Vitis 2020.1 でカーネルの ChipScope Debug をやってみた”で試した ChipScope Debug を ACRi ルームの Alveo U50 でもうまく行くかどうか?を確かめたかったということで、”Vitis 2020.1 でカーネルの ChipScope Debug をやってみた”と同様にやってみたが、Alveo U50 が JTAG で接続されていないようだった。今回は、”Debugging Your Applications on an Alveo Data Center Accelerator Card Using ChipScope”を見つけたので、それを参照してやってみよう。

参照するのは、、”Debugging Your Applications on an Alveo Data Center Accelerator Card Using ChipScope”と
日本語では、”Vitis 統合ソフトウェア開発プラットフォーム 2020.1 の XVC およびハードウェア サーバーの実行”だ。

Debugging Your Applications on an Alveo Data Center Accelerator Card Using ChipScope”によると、デバックモードで途中でブレークポイントを作成して、ソフトウェアを停止するようになっているが、ACRiルームのAlveo U50 でデバックモードにすると、ソースコード・デバックが行えずに、なぜかDisassemble に落ちてしまう。
ACRi_U50_85_201113.png

そこで、”Vitis 統合ソフトウェア開発プラットフォーム 2020.1 の カーネル開始前に ILA トリガーを追加”を参照して、wait_for_enter() 関数を追加した。
ACRi_U50_86_201113.png

vadd アクセラレーション・アプリケーションを実行すると、wait_for_enter() 関数が実行されて、”Press ENTER to continue after setting up ILA trigger...”で停止した。
ACRi_U50_87_201113.png

停止後に、、”Debugging Your Applications on an Alveo Data Center Accelerator Card Using ChipScope”によると、
debug_hw --xvc_pcie /dev/xvc_pub. --hw_server
を実行するということなので、
ls /dev
で見たところ、xvc_pri.m0 があったので、それではないだろうか?
ACRi_U50_88_201113.png

そこで、
debug_hw --xvc_pcie /dev/xvc_pri.m0 --hw_server
を実行した。
ACRi_U50_89_201113.png

ところが、エラーになってしまった。

u_marsee101@as004:~$ debug_hw --xvc_pcie /dev/xvc_pri.m0 --hw_server
launching xvc_pcie...
/tools/Xilinx/Vivado/2019.2/bin/xvc_pcie -d /dev/xvc_pri.m0 -s TCP::10200
launching hw_server...
/tools/Xilinx/Vivado/2019.2/bin/hw_server -sTCP::3121

****************************
*** Press Ctrl-C to exit ***
****************************

ERROR: xvc_pcie process terminated with error code 2.


このエラーを検索すると、”Can't run debug_hw”が見つかった。
この資料によると、”この問題はまもなくリリースされる新しいXRTで対処されます。”とのことでした。。。 orz...

ちなみに
xbutil scan
の結果を示す。
ACRi_U50_90_201113.png

u_marsee101@as004:~$ xbutil scan
INFO: Found total 1 card(s), 1 are usable
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
System Configuration
OS name:    Linux
Release:    3.10.0-957.27.2.el7.x86_64
Version:    #1 SMP Mon Jul 29 17:46:05 UTC 2019
Machine:    x86_64
Model:      To Be Filled By O.E.M.
CPU cores:  16
Memory:     128432 MB
Glibc:      2.27
Distribution:   Ubuntu 18.04.4 LTS
Now:        Fri Nov 13 04:34:39 2020
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
XRT Information
Version:    2.6.655
Git Hash:   2d6bfe4ce91051d4e5b499d38fc493586dd4859a
Git Branch: 2020.1
Build Date: 2020-05-22 12:05:03
XOCL:       2.6.655,2d6bfe4ce91051d4e5b499d38fc493586dd4859a
XCLMGMT:    2.6.655,2d6bfe4ce91051d4e5b499d38fc493586dd4859a
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 [0] 0000:01:00.1 xilinx_u50_gen3x16_xdma_201920_3 user(inst=129)
WARNING: Kernel verison 3.10.0-957.27.2.el7.x86_64 is not officially supported. 5.3.0 is the latest supported version


XRTのバージョンの 2.6.655 は”Can't run debug_hw”と同じだった。残念。。。

最後に Vitis IDE で Enter キーを押すと、TEST PASSED が表示された。
ACRi_U50_91_201113.png
  1. 2020年11月13日 04:41 |
  2. Alveo
  3. | トラックバック:0
  4. | コメント:0

ACRiルームの Alveo U50 で ChipScope Debug を試す1

久しぶりに ACRi ルームの Alveo U50 を使ってみることにした。”Vitis 2020.1 でカーネルの ChipScope Debug をやってみた”で試した ChipScope Debug を ACRi ルームの Alveo U50 でもうまく行くかどうか?を確かめたかったからだ。

まずは、”ACRi ルームへようこそ!”のページから Alveo U50 の予約を取った。今回は、予約時間が過ぎていても予約取れるようになっていて、とっても便利になっている。とても良い。。。

ACRi ルームの Alveo U50 を使ってみた1(Vector Addition の実行)”を参照しながら、Tera Term を立ち上げて gw.acri.c.titech.ac.jp に接続し、リモートデスクトップ接続を立ち上げて、as004 に入れた。久しぶりなので、ドキドキした。接続できてよかった。。。

Activities をクリックして、ファイル・ブラウザとターミナルを起動した。

ターミナルで、XRT と Vitis 2019.2 の環境を設定し、Vitis を起動した。
source /opt/xilinx/xrt/setup.sh
source /tools/Xilinx/Vitis/2019.2/settings64.sh
vitis

ACRi_U50_73_201112.png

Vitis 2019.2 の Assistant ウインドウの vadd_system を右クリックし、右クリックメニューから Settings... を選択する。
ACRi_U50_74_201112.png

System Project Settings ダイアログが開く。
vadd_system -> vadd -> Hardware -> binary container_1 -> krnl_vadd をクリックする。
ACRi_U50_75_201112.png

krnl_vadd の ChipScope Debug のチェックボックスをクリックすると、すべての ChipScope Debug チェックボックスにチェックが入る。
ACRi_U50_76_201112.png

Apply ボタンをクリックしてから Apply and Clod ボタンをクリックする。

Vitis 2019.2 の Assistant ウインドウの vadd_system -> Hardware を右クリックし、右クリックメニューから Build を選択してビルドする。
ACRi_U50_77_201112.png

ビルドしているところだ。
ACRi_U50_78_201112.png

ビルドが成功した。
ACRi_U50_79_201112.png

Assistant ウインドウの vadd_system -> vadd -> Hardware -> binary container_1 を右クリックし、右クリックメニューから Open Vivado Project を選択する。
ACRi_U50_80_201112.png

Vivado 2019.2 が起動した。
ACRi_U50_81_201112.png

Assistant ウインドウの vadd_system -> vadd -> Hardware を右クリックし、右クリックメニューから Run -> vadd-Default (OpenCL Application) を選択する。
ACRi_U50_82_201112.png

TEST PASSED した。
ACRi_U50_83_201112.png

Vivado で PROGRAM AND DEBUG -> Open Hardware Manager -> Open Target をクリックして、Auto Connect を選択したが、Vivado Analyzer 画面は表示されなかった。やはり、JTAG では接続されていないようだ。
ACRi_U50_84_201112.png
  1. 2020年11月12日 05:11 |
  2. Alveo
  3. | トラックバック:0
  4. | コメント:0

GPS と 3軸加速度センサーを使ったシステム4(3軸加速度センサーのI2Cを3m伸ばした)

3 軸加速度センサーの I2C を 3m の LANケーブルを使用して伸ばした。

ZYBO Z7-20 から 3 m の LAN ケーブルに電源と I2C の SDA と SCL を通して、3 軸加速度センサーに接続しようという計画だ。

秋月電子の LANコネクタDIP化キットを使用している。
SDA と SCL は異なるペアを使用している。確か、

1 番ピン ー SDA
2 番ピン ー 空き
3 番ピン ー SCL
4 番ピン ー 空き
5 番ピン ー +3.3V
6 番ピン ー GND
7 番ピン ー +3.3V
8 番ピン ー GND


で接続した。

実験風景(汚いが)を示す。
acc_sensor_14_201111.jpg

400 kHz クロックでの波形はこんな感じだ。 2 つの波形は少し立ち上がり方が異なるが、どうやって計測したか、忘れてしまった。
いずれにせよ、きちんと I2C の信号を受信できている。
acc_sensor_12_201111.jpg

acc_sensor_13_201111.jpg

次は手作りだが、基板をはんだ付けで作って再度特性を確認する。
  1. 2020年11月11日 04:55 |
  2. FPGAを使用したシステム
  3. | トラックバック:0
  4. | コメント:0

96Boards ON Semiconductor Dual Camera Mezzanine の Reference-Designs をやってみる2

96Boards ON Semiconductor Dual Camera Mezzanine の Reference-Designs をやってみる1”の続き。

前回は、96Boards ON Semiconductor Dual Camera Mezzanine の Reference-Designs 用の MicroSD カードを作成した。今回は、その MicroSD カードを Ultra96V2 に挿入して PetaLinux を起動し、デュアル・カメラ用のアプリケーション・ソフトウェアを起動しよう。

96Boards ON Semiconductor Dual Camera Mezzanine を Ultra96V2 に装着した。
Ultra96_Dual_Camera_17_201109.jpg

Ultra96_Dual_Camera_18_201109.jpg

Ultra96_Dual_Camera_19_201109.jpg

前回作成した MicroSD カードを Ultra96V2 に挿入して PetaLinux を起動した。
Ultra96_Dual_Camera_12_201109.png

root, root でログインできた。

ifconfig すると、LAN は USB - LAN ケーブルが認識されて IP アドレスが振られていた。
無線LAN もドライバが実装されていた。

root@ultra96v2-2020-1:~# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:22:CF:00:0C:37  
          inet addr:192.168.3.23  Bcast:192.168.3.255  Mask:255.255.255.0
          inet6 addr: fe80::222:cfff:fe00:c37/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:206 errors:0 dropped:68 overruns:0 frame:0
          TX packets:174 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:21934 (21.4 KiB)  TX bytes:30373 (29.6 KiB)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:26 errors:0 dropped:0 overruns:0 frame:0
          TX packets:26 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:4599 (4.4 KiB)  TX bytes:4599 (4.4 KiB)

mon.p2p0  Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-63-00-00-00-00-00-00-00-00  
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

p2p0      Link encap:Ethernet  HWaddr FA:F0:05:C4:17:3C  
          inet addr:192.168.2.1  Bcast:192.168.2.255  Mask:255.255.255.0
          inet6 addr: fe80::f8f0:5ff:fec4:173c/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:54 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:10466 (10.2 KiB)

wlan0     Link encap:Ethernet  HWaddr F8:F0:05:C4:17:3C  
          inet6 addr: fe80::faf0:5ff:fec4:173c/64 Scope:Link
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:27 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:4207 (4.1 KiB)


run_1920_1080 を起動したが、エラーだった。
Ultra96_Dual_Camera_15_201109.png

root@ultra96v2-2020-1:~# run_1920_1080
711
failed to find mode "1920x1080" for connector 42
failed to create dumb buffer: Invalid argument
testing 1920x1080@YUYV overlay plane 38
Setting pipeline to PAUSED ...
ERROR: Pipeline doesn't want to pause.
ERROR: from element /GstPipeline:pipeline0/GstKMSSink:kmssink0: Could not get allowed GstCaps of device
Additional debug info:
../../../git/sys/kms/gstkmssink.c(1102): gst_kms_sink_start (): /GstPipeline:pipeline0/GstKMSSink:kmssink0:
driver does not provide mode settings configuration
Setting pipeline to NULL ...
Freeing pipeline ...
/usr/bin/run_1920_1080: line 20: kill: (711) - No such process


もう一度、コマンドを実行すると、エラーが無くなったが、画面は出ない。
reboot をしてから、もう一度、
run_1920_1080 を起動した。
Ultra96_Dual_Camera_13_201109.png

root@ultra96v2-2020-1:~# run_1920_1080
711
setting mode 1920x1080-60.00Hz@RG16 on connectors 42, crtc 40
testing 1920x1080@YUYV overlay plane 38
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
/GstPipeline:pipeline0/GstKMSSink:kmssink0: display-width = 1920
/GstPipeline:pipeline0/GstKMSSink:kmssink0: display-height = 1080
Setting pipeline to PLAYING ...
New clock: GstSystemClock
/GstPipeline:pipeline0/GstV4l2Src:v4l2src0.GstPad:src: caps = video/x-raw, width=(int)1920, height=(int)1080, format=(string)YUY2, framerate=(fraction)60/1, interlace-mode=(string)progressive, colorimetry=(string)bt709
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:src: caps = video/x-raw, width=(int)1920, height=(int)1080, format=(string)YUY2, framerate=(fraction)60/1, interlace-mode=(string)progressive, colorimetry=(string)bt709
/GstPipeline:pipeline0/GstVideoConvert:videoconvert0.GstPad:src: caps = video/x-raw, width=(int)1920, height=(int)1080, format=(string)YUY2, framerate=(fraction)60/1, interlace-mode=(string)progressive, colorimetry=(string)bt709
/GstPipeline:pipeline0/GstKMSSink:kmssink0.GstPad:sink: caps = video/x-raw, width=(int)1920, height=(int)1080, format=(string)YUY2, framerate=(fraction)60/1, interlace-mode=(string)progressive, colorimetry=(string)bt709
/GstPipeline:pipeline0/GstVideoConvert:videoconvert0.GstPad:sink: caps = video/x-raw, width=(int)1920, height=(int)1080, format=(string)YUY2, framerate=(fraction)60/1, interlace-mode=(string)progressive, colorimetry=(string)bt709
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:sink: caps = video/x-raw, width=(int)1920, height=(int)1080, format=(string)YUY2, framerate=(fraction)60/1, interlace-mode=(string)progressive, colorimetry=(string)bt709


デュアル・カメラの画像が表示された。これは家の天井と照明器具だ。
Ultra96_Dual_Camera_16_201109.jpg

ターミナルで CTRL-C を押して、アプリケーションを終了した。
Ultra96_Dual_Camera_14_201109.png

最後に PetaLinux の起動メッセージを示す。

Xilinx Zynq MP First Stage Boot Loader 
Release 2020.1   Aug 14 2020  -  22:53:13
NOTICE:  ATF running on XCZU3EG/silicon v4/RTL5.1 at 0xfffea000
NOTICE:  BL31: v2.2(release):v1.1-5588-g5918e656e
NOTICE:  BL31: Built : 22:34:55, Aug 14 2020


U-Boot 2020.01 (Aug 18 2020 - 17:33:39 +0000)

Model: Avnet Ultra96 Rev1
Board: Xilinx ZynqMP
DRAM:  2 GiB
PMUFW:  v1.1
EL Level:   EL2
Chip ID:    zu3eg
NAND:  0 MiB
MMC:   mmc@ff160000: 0, mmc@ff170000: 1
In:    serial@ff010000
Out:   serial@ff010000
Err:   serial@ff010000
Bootmode: SD_MODE
Reset reason:   EXTERNAL 
Net:   No ethernet found.
Hit any key to stop autoboot:  0 
switch to partitions #0, OK
mmc0 is current device
Scanning mmc 0:1...
Found U-Boot script /boot.scr
2007 bytes read in 19 ms (102.5 KiB/s)
## Executing script at 20000000
8313964 bytes read in 623 ms (12.7 MiB/s)
## Loading kernel from FIT Image at 10000000 ...
   Using 'conf@system-top.dtb' configuration
   Trying 'kernel@1' kernel subimage
     Description:  Linux kernel
     Type:         Kernel Image
     Compression:  gzip compressed
     Data Start:   0x100000f4
     Data Size:    8251525 Bytes = 7.9 MiB
     Architecture: AArch64
     OS:           Linux
     Load Address: 0x00080000
     Entry Point:  0x00080000
     Hash algo:    sha256
     Hash value:   22ed1c58ad614712b771a0e27ff96d52d6b3269321ee423885176b4c41550f32
   Verifying Hash Integrity ... sha256+ OK
## Loading fdt from FIT Image at 10000000 ...
   Using 'conf@system-top.dtb' configuration
   Trying 'fdt@system-top.dtb' fdt subimage
     Description:  Flattened Device Tree blob
     Type:         Flat Device Tree
     Compression:  uncompressed
     Data Start:   0x107dea8c
     Data Size:    60535 Bytes = 59.1 KiB
     Architecture: AArch64
     Hash algo:    sha256
     Hash value:   239f2beeb0c26cfc03521c3c00c8931a234b07770ea13e7fa072f91e0669b391
   Verifying Hash Integrity ... sha256+ OK
   Booting using the fdt blob at 0x107dea8c
   Uncompressing Kernel Image
   Loading Device Tree to 000000000ffee000, end 000000000ffffc76 ... OK

Starting kernel ...

[    0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd034]
[    0.000000] Linux version 5.4.0-xilinx-v2020.1 (oe-user@oe-host) (gcc version 9.2.0 (GCC)) #1 SMP Tue Aug 18 16:15:52 UTC 2020
[    0.000000] Machine model: Avnet Ultra96 Rev1
[    0.000000] earlycon: cdns0 at MMIO 0x00000000ff010000 (options '115200n8')
[    0.000000] printk: bootconsole [cdns0] enabled
[    0.000000] efi: Getting EFI parameters from FDT:
[    0.000000] efi: UEFI not found.
[    0.000000] Reserved memory: created DMA memory pool at 0x000000003ed40000, size 1 MiB
[    0.000000] OF: reserved mem: initialized node rproc@3ed400000, compatible id shared-dma-pool
[    0.000000] cma: Reserved 512 MiB at 0x000000005fc00000
[    0.000000] psci: probing for conduit method from DT.
[    0.000000] psci: PSCIv1.1 detected in firmware.
[    0.000000] psci: Using standard PSCI v0.2 function IDs
[    0.000000] psci: MIGRATE_INFO_TYPE not supported.
[    0.000000] psci: SMC Calling Convention v1.1
[    0.000000] percpu: Embedded 22 pages/cpu s49944 r8192 d31976 u90112
[    0.000000] Detected VIPT I-cache on CPU0
[    0.000000] CPU features: detected: ARM erratum 845719
[    0.000000] Speculative Store Bypass Disable mitigation not required
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 515524
[    0.000000] Kernel command line: earlycon console=ttyPS0,115200 clk_ignore_unused root=/dev/mmcblk0p2 rw rootwait cma=512M
[    0.000000] Dentry cache hash table entries: 262144 (order: 9, 2097152 bytes, linear)
[    0.000000] Inode-cache hash table entries: 131072 (order: 8, 1048576 bytes, linear)
[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] Memory: 1512432K/2094848K available (11836K kernel code, 690K rwdata, 3684K rodata, 704K init, 516K bss, 58128K reserved, 524288K cma-reserved)
[    0.000000] rcu: Hierarchical RCU implementation.
[    0.000000] rcu:     RCU event tracing is enabled.
[    0.000000] rcu:     RCU restricting CPUs from NR_CPUS=8 to nr_cpu_ids=4.
[    0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 25 jiffies.
[    0.000000] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=4
[    0.000000] NR_IRQS: 64, nr_irqs: 64, preallocated irqs: 0
[    0.000000] GIC: Adjusting CPU interface base to 0x00000000f902f000
[    0.000000] GIC: Using split EOI/Deactivate mode
[    0.000000] random: get_random_bytes called from start_kernel+0x2a8/0x42c with crng_init=0
[    0.000000] arch_timer: cp15 timer(s) running at 100.00MHz (phys).
[    0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x171024e7e0, max_idle_ns: 440795205315 ns
[    0.000004] sched_clock: 56 bits at 100MHz, resolution 10ns, wraps every 4398046511100ns
[    0.008477] Console: colour dummy device 80x25
[    0.012485] Calibrating delay loop (skipped), value calculated using timer frequency.. 200.00 BogoMIPS (lpj=400000)
[    0.022841] pid_max: default: 32768 minimum: 301
[    0.027603] Mount-cache hash table entries: 4096 (order: 3, 32768 bytes, linear)
[    0.034787] Mountpoint-cache hash table entries: 4096 (order: 3, 32768 bytes, linear)
[    0.043877] ASID allocator initialised with 32768 entries
[    0.047996] rcu: Hierarchical SRCU implementation.
[    0.052945] EFI services will not be available.
[    0.057348] smp: Bringing up secondary CPUs ...
[    0.062085] Detected VIPT I-cache on CPU1
[    0.062132] CPU1: Booted secondary processor 0x0000000001 [0x410fd034]
[    0.062534] Detected VIPT I-cache on CPU2
[    0.062555] CPU2: Booted secondary processor 0x0000000002 [0x410fd034]
[    0.062915] Detected VIPT I-cache on CPU3
[    0.062934] CPU3: Booted secondary processor 0x0000000003 [0x410fd034]
[    0.062983] smp: Brought up 1 node, 4 CPUs
[    0.097142] SMP: Total of 4 processors activated.
[    0.101814] CPU features: detected: 32-bit EL0 Support
[    0.106918] CPU features: detected: CRC32 instructions
[    0.112057] CPU: All CPU(s) started at EL2
[    0.116100] alternatives: patching kernel code
[    0.121617] devtmpfs: initialized
[    0.130533] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns
[    0.134632] futex hash table entries: 1024 (order: 4, 65536 bytes, linear)
[    0.156704] xor: measuring software checksum speed
[    0.193613]    8regs     :  2375.000 MB/sec
[    0.233639]    32regs    :  2725.000 MB/sec
[    0.273671]    arm64_neon:  2365.000 MB/sec
[    0.273712] xor: using function: 32regs (2725.000 MB/sec)
[    0.277588] pinctrl core: initialized pinctrl subsystem
[    0.283704] NET: Registered protocol family 16
[    0.288744] DMA: preallocated 256 KiB pool for atomic allocations
[    0.293266] audit: initializing netlink subsys (disabled)
[    0.298683] audit: type=2000 audit(0.240:1): state=initialized audit_enabled=0 res=1
[    0.306332] cpuidle: using governor menu
[    0.310370] hw-breakpoint: found 6 breakpoint and 4 watchpoint registers.
[    0.331383] HugeTLB registered 1.00 GiB page size, pre-allocated 0 pages
[    0.332436] HugeTLB registered 32.0 MiB page size, pre-allocated 0 pages
[    0.339106] HugeTLB registered 2.00 MiB page size, pre-allocated 0 pages
[    0.345765] HugeTLB registered 64.0 KiB page size, pre-allocated 0 pages
[    1.426856] DRBG: Continuing without Jitter RNG
[    1.503594] raid6: neonx8   gen()  1547 MB/s
[    1.571637] raid6: neonx8   xor()  1466 MB/s
[    1.639721] raid6: neonx4   gen()  1490 MB/s
[    1.707742] raid6: neonx4   xor()  1430 MB/s
[    1.775836] raid6: neonx2   gen()  1135 MB/s
[    1.843860] raid6: neonx2   xor()  1189 MB/s
[    1.911942] raid6: neonx1   gen()   740 MB/s
[    1.979957] raid6: neonx1   xor()   896 MB/s
[    2.048017] raid6: int64x8  gen()  1166 MB/s
[    2.116079] raid6: int64x8  xor()   763 MB/s
[    2.184142] raid6: int64x4  gen()   985 MB/s
[    2.252167] raid6: int64x4  xor()   740 MB/s
[    2.320266] raid6: int64x2  gen()   684 MB/s
[    2.388313] raid6: int64x2  xor()   600 MB/s
[    2.456335] raid6: int64x1  gen()   452 MB/s
[    2.524380] raid6: int64x1  xor()   460 MB/s
[    2.524422] raid6: using algorithm neonx8 gen() 1547 MB/s
[    2.528371] raid6: .... xor() 1466 MB/s, rmw enabled
[    2.533301] raid6: using neon recovery algorithm
[    2.538697] iommu: Default domain type: Translated 
[    2.542997] SCSI subsystem initialized
[    2.546620] usbcore: registered new interface driver usbfs
[    2.551928] usbcore: registered new interface driver hub
[    2.557208] usbcore: registered new device driver usb
[    2.562244] mc: Linux media interface: v0.10
[    2.566449] videodev: Linux video capture interface: v2.00
[    2.571900] pps_core: LinuxPPS API ver. 1 registered
[    2.576811] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[    2.585905] PTP clock support registered
[    2.589797] EDAC MC: Ver: 3.0.0
[    2.593353] zynqmp-ipi-mbox mailbox@ff990400: Registered ZynqMP IPI mbox with TX/RX channels.
[    2.601612] zynqmp-ipi-mbox mailbox@ff90000: Registered ZynqMP IPI mbox with TX/RX channels.
[    2.609875] FPGA manager framework
[    2.613288] Advanced Linux Sound Architecture Driver Initialized.
[    2.619537] Bluetooth: Core ver 2.22
[    2.622757] NET: Registered protocol family 31
[    2.627155] Bluetooth: HCI device and connection manager initialized
[    2.633473] Bluetooth: HCI socket layer initialized
[    2.638314] Bluetooth: L2CAP socket layer initialized
[    2.643337] Bluetooth: SCO socket layer initialized
[    2.648595] clocksource: Switched to clocksource arch_sys_counter
[    2.654371] VFS: Disk quotas dquot_6.6.0
[    2.658176] VFS: Dquot-cache hash table entries: 512 (order 0, 4096 bytes)
[    2.669267] NET: Registered protocol family 2
[    2.669730] tcp_listen_portaddr_hash hash table entries: 1024 (order: 2, 16384 bytes, linear)
[    2.677788] TCP established hash table entries: 16384 (order: 5, 131072 bytes, linear)
[    2.685735] TCP bind hash table entries: 16384 (order: 6, 262144 bytes, linear)
[    2.693234] TCP: Hash tables configured (established 16384 bind 16384)
[    2.699490] UDP hash table entries: 1024 (order: 3, 32768 bytes, linear)
[    2.706085] UDP-Lite hash table entries: 1024 (order: 3, 32768 bytes, linear)
[    2.713272] NET: Registered protocol family 1
[    2.717797] RPC: Registered named UNIX socket transport module.
[    2.723350] RPC: Registered udp transport module.
[    2.728018] RPC: Registered tcp transport module.
[    2.732686] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    2.739353] PCI: CLS 0 bytes, default 64
[    2.743567] hw perfevents: no interrupt-affinity property for /pmu, guessing.
[    2.750254] hw perfevents: enabled with armv8_pmuv3 PMU driver, 7 counters available
[    2.758755] Initialise system trusted keyrings
[    2.762293] workingset: timestamp_bits=46 max_order=19 bucket_order=0
[    2.769424] NFS: Registering the id_resolver key type
[    2.773617] Key type id_resolver registered
[    2.777751] Key type id_legacy registered
[    2.781738] nfs4filelayout_init: NFSv4 File Layout Driver Registering...
[    2.788408] jffs2: version 2.2. (NAND) © 2001-2006 Red Hat, Inc.
[    2.807599] NET: Registered protocol family 38
[    2.807646] Key type asymmetric registered
[    2.810470] Asymmetric key parser 'x509' registered
[    2.815334] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 247)
[    2.822665] io scheduler mq-deadline registered
[    2.827161] io scheduler kyber registered
[    2.831871] GPIO IRQ not connected
[    2.834525] XGpio: gpio@a0040000: registered, base is 504
[    2.841652] xilinx-frmbuf a0000000.v_frmbuf_wr: Xilinx AXI frmbuf DMA_DEV_TO_MEM
[    2.847293] xilinx-frmbuf a0000000.v_frmbuf_wr: Xilinx AXI FrameBuffer Engine Driver Probed!!
[    2.855817] xilinx-frmbuf a00c0000.v_frmbuf_rd: Xilinx AXI frmbuf DMA_MEM_TO_DEV
[    2.863114] xilinx-frmbuf a00c0000.v_frmbuf_rd: Xilinx AXI FrameBuffer Engine Driver Probed!!
[    2.898207] Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
[    2.903144] cacheinfo: Unable to detect cache hierarchy for CPU 0
[    2.909889] brd: module loaded
[    2.915569] loop: module loaded
[    2.916543] mtdoops: mtd device (mtddev=name/number) must be supplied
[    2.920843] libphy: Fixed MDIO Bus: probed
[    2.924544] tun: Universal TUN/TAP device driver, 1.6
[    2.928687] CAN device driver interface
[    2.933322] usbcore: registered new interface driver asix
[    2.937798] usbcore: registered new interface driver ax88179_178a
[    2.943810] usbcore: registered new interface driver cdc_ether
[    2.949603] usbcore: registered new interface driver net1080
[    2.955229] usbcore: registered new interface driver cdc_subset
[    2.961110] usbcore: registered new interface driver zaurus
[    2.966658] usbcore: registered new interface driver cdc_ncm
[    2.973187] usbcore: registered new interface driver uas
[    2.977559] usbcore: registered new interface driver usb-storage
[    2.983682] gadgetfs: USB Gadget filesystem, version 24 Aug 2004
[    2.989991] rtc_zynqmp ffa60000.rtc: registered as rtc0
[    2.994721] i2c /dev entries driver
[    2.998724] xilinx-video amba_pl@0:vcap_csi: device registered
[    3.004453] xilinx-csi2rxss a0020000.mipi_csi2_rx_subsystem: Xilinx CSI2 Rx Subsystem device found!
[    3.012913] xilinx-video amba_pl@0:vcap_csi: Entity type for entity a0020000.mipi_csi2_rx_subsystem was not initialized!
[    3.024676] xilinx-tpg a0050000.v_tpg: invalid number of ports 0
[    3.029691] xilinx-tpg: probe of a0050000.v_tpg failed with error -22
[    3.036314] xilinx-vpss-scaler a0080000.v_proc_ss: xlnx,v-vpss-scaler-2.2 - compatible string is getting deprecated!
[    3.046619] xilinx-video amba_pl@0:vcap_csi: Entity type for entity a0080000.v_proc_ss was not initialized!
[    3.056244] xilinx-vpss-scaler a0080000.v_proc_ss: Num Hori Taps 8
[    3.062384] xilinx-vpss-scaler a0080000.v_proc_ss: Num Vert Taps 8
[    3.068524] xilinx-vpss-scaler a0080000.v_proc_ss: VPSS Scaler Probe Successful
[    3.075925] xilinx-vtc a0060000.v_tc: device found, version 6.020
[    3.081911] usbcore: registered new interface driver uvcvideo
[    3.087552] USB Video Class driver (1.1.1)
[    3.092307] Bluetooth: HCI UART driver ver 2.3
[    3.096034] Bluetooth: HCI UART protocol H4 registered
[    3.101133] Bluetooth: HCI UART protocol BCSP registered
[    3.106425] Bluetooth: HCI UART protocol LL registered
[    3.111513] Bluetooth: HCI UART protocol ATH3K registered
[    3.116888] Bluetooth: HCI UART protocol Three-wire (H5) registered
[    3.123141] Bluetooth: HCI UART protocol Intel registered
[    3.128480] Bluetooth: HCI UART protocol QCA registered
[    3.133682] usbcore: registered new interface driver bcm203x
[    3.139319] usbcore: registered new interface driver bpa10x
[    3.144841] usbcore: registered new interface driver bfusb
[    3.150294] usbcore: registered new interface driver btusb
[    3.155756] usbcore: registered new interface driver ath3k
[    3.161282] EDAC MC: ECC not enabled
[    3.164879] EDAC DEVICE0: Giving out device to module zynqmp-ocm-edac controller zynqmp_ocm: DEV ff960000.memory-controller (INTERRUPT)
[    3.177344] sdhci: Secure Digital Host Controller Interface driver
[    3.182962] sdhci: Copyright(c) Pierre Ossman
[    3.187285] sdhci-pltfm: SDHCI platform and OF driver helper
[    3.193359] ledtrig-cpu: registered to indicate activity on CPUs
[    3.198929] zynqmp_firmware_probe Platform Management API v1.1
[    3.204676] zynqmp_firmware_probe Trustzone version v1.0
[    3.213574] zynqmp-pinctrl firmware:zynqmp-firmware:pinctrl: zynqmp pinctrl initialized
[    3.242291] alg: No test for xilinx-zynqmp-aes (zynqmp-aes)
[    3.242542] zynqmp_aes zynqmp_aes: AES Successfully Registered
[    3.242542] 
[    3.249801] alg: No test for xilinx-keccak-384 (zynqmp-keccak-384)
[    3.255998] alg: No test for xilinx-zynqmp-rsa (zynqmp-rsa)
[    3.261576] usbcore: registered new interface driver usbhid
[    3.266793] usbhid: USB HID core driver
[    3.270835] xlnk xlnk: Major 243
[    3.273922] xlnk xlnk: xlnk driver loaded
[    3.277779] xlnk xlnk: xlnk_pdev is not null
[    3.284511] fpga_manager fpga0: Xilinx ZynqMP FPGA Manager registered
[    3.288791] usbcore: registered new interface driver snd-usb-audio
[    3.295564] pktgen: Packet Generator for packet performance testing. Version: 2.75
[    3.302789] Initializing XFRM netlink socket
[    3.306424] NET: Registered protocol family 10
[    3.311234] Segment Routing with IPv6
[    3.314497] sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver
[    3.320658] NET: Registered protocol family 17
[    3.324671] NET: Registered protocol family 15
[    3.329088] bridge: filtering via arp/ip/ip6tables is no longer available by default. Update your scripts to load br_netfilter if you need this.
[    3.341958] can: controller area network core (rev 20170425 abi 9)
[    3.348134] NET: Registered protocol family 29
[    3.352514] can: raw protocol (rev 20170425)
[    3.356750] can: broadcast manager protocol (rev 20170425 t)
[    3.362374] can: netlink gateway (rev 20190810) max_hops=1
[    3.367947] Bluetooth: RFCOMM TTY layer initialized
[    3.372673] Bluetooth: RFCOMM socket layer initialized
[    3.377785] Bluetooth: RFCOMM ver 1.11
[    3.381501] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[    3.386764] Bluetooth: BNEP filters: protocol multicast
[    3.391955] Bluetooth: BNEP socket layer initialized
[    3.396883] Bluetooth: HIDP (Human Interface Emulation) ver 1.2
[    3.402768] Bluetooth: HIDP socket layer initialized
[    3.407854] 9pnet: Installing 9P2000 support
[    3.411965] Key type dns_resolver registered
[    3.416546] registered taskstats version 1
[    3.420246] Loading compiled-in X.509 certificates
[    3.425466] Btrfs loaded, crc32c=crc32c-generic
[    3.440670] ff000000.serial: ttyPS1 at MMIO 0xff000000 (irq = 40, base_baud = 6249999) is a xuartps
�    3.444659] f�&�S'��Srial: ɥ�ѭ���ͽ�������AM���*������5R��r��²����ɥ�ѭ���ͽ�������AM���*������5R��r���ʒ���ɥ�ѭ���э��ͽ���ڍ������"�ͅ����5R��r���ʒ���ɥ�ѭ���э��ͽ���ڍ������"�ͅ����5R��r����Š�z��2�����������2����2ձ��2u*
                   �U�V��
                         ��KVVH�[    3.483013] xilinx-dpdma fd4c0000.dma: Xilinx DPDMA engine is probed
[    3.489634] xilinx-zynqmp-dma fd500000.dma: ZynqMP DMA driver Probe success
[    3.496753] xilinx-zynqmp-dma fd510000.dma: ZynqMP DMA driver Probe success
[    3.503870] xilinx-zynqmp-dma fd520000.dma: ZynqMP DMA driver Probe success
[    3.510986] xilinx-zynqmp-dma fd530000.dma: ZynqMP DMA driver Probe success
[    3.518108] xilinx-zynqmp-dma fd540000.dma: ZynqMP DMA driver Probe success
[    3.525224] xilinx-zynqmp-dma fd550000.dma: ZynqMP DMA driver Probe success
[    3.532335] xilinx-zynqmp-dma fd560000.dma: ZynqMP DMA driver Probe success
[    3.539450] xilinx-zynqmp-dma fd570000.dma: ZynqMP DMA driver Probe success
[    3.546638] xilinx-zynqmp-dma ffa80000.dma: ZynqMP DMA driver Probe success
[    3.553752] xilinx-zynqmp-dma ffa90000.dma: ZynqMP DMA driver Probe success
[    3.560871] xilinx-zynqmp-dma ffaa0000.dma: ZynqMP DMA driver Probe success
[    3.567988] xilinx-zynqmp-dma ffab0000.dma: ZynqMP DMA driver Probe success
[    3.575107] xilinx-zynqmp-dma ffac0000.dma: ZynqMP DMA driver Probe success
[    3.582221] xilinx-zynqmp-dma ffad0000.dma: ZynqMP DMA driver Probe success
[    3.589339] xilinx-zynqmp-dma ffae0000.dma: ZynqMP DMA driver Probe success
[    3.596456] xilinx-zynqmp-dma ffaf0000.dma: ZynqMP DMA driver Probe success
[    3.603820] xilinx-psgtr fd400000.zynqmp_phy: Lane:1 type:8 protocol:4 pll_locked:yes
[    3.615673] zynqmp_clk_divider_set_rate() set divider failed for spi1_ref_div1, ret = -13
[    3.624499] xilinx-dp-snd-codec fd4a0000.zynqmp-display:zynqmp_dp_snd_codec0: Xilinx DisplayPort Sound Codec probed
[    3.635215] xilinx-dp-snd-pcm zynqmp_dp_snd_pcm0: Xilinx DisplayPort Sound PCM probed
[    3.643271] xilinx-dp-snd-pcm zynqmp_dp_snd_pcm1: Xilinx DisplayPort Sound PCM probed
[    3.651846] xilinx-dp-snd-card fd4a0000.zynqmp-display:zynqmp_dp_snd_card: xilinx-dp-snd-codec-dai <-> xilinx-dp-snd-codec-dai mapping ok
[    3.664403] xilinx-dp-snd-card fd4a0000.zynqmp-display:zynqmp_dp_snd_card: xilinx-dp-snd-codec-dai <-> xilinx-dp-snd-codec-dai mapping ok
[    3.677142] xilinx-dp-snd-card fd4a0000.zynqmp-display:zynqmp_dp_snd_card: Xilinx DisplayPort Sound Card probed
[    3.687327] OF: graph: no port node found in /amba/zynqmp-display@fd4a0000
[    3.694353] [drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
[    3.700962] [drm] No driver support for vblank timestamp query.
[    3.706976] xlnx-drm xlnx-drm.0: bound fd4a0000.zynqmp-display (ops 0xffffffc010cd78f0)
[    3.887698] Console: switching to colour frame buffer device 240x67
[    3.910621] zynqmp-display fd4a0000.zynqmp-display: fb0: xlnxdrmfb frame buffer device
[    3.918962] [drm] Initialized xlnx 1.0.0 20130509 for fd4a0000.zynqmp-display on minor 0
[    3.927091] zynqmp-display fd4a0000.zynqmp-display: ZynqMP DisplayPort Subsystem driver probed
[    3.937694] xilinx-axipmon ffa00000.perf-monitor: Probed Xilinx APM
[    3.944252] xilinx-axipmon fd0b0000.perf-monitor: Probed Xilinx APM
[    3.950757] xilinx-axipmon fd490000.perf-monitor: Probed Xilinx APM
[    3.957255] xilinx-axipmon ffa10000.perf-monitor: Probed Xilinx APM
[    3.964285] dwc3 fe200000.dwc3: Failed to get clk 'ref': -2
[    3.970093] xilinx-psgtr fd400000.zynqmp_phy: Lane:2 type:0 protocol:3 pll_locked:yes
[    3.981591] dwc3 fe300000.dwc3: Failed to get clk 'ref': -2
[    3.987376] xilinx-psgtr fd400000.zynqmp_phy: Lane:3 type:1 protocol:3 pll_locked:yes
[    3.997631] xhci-hcd xhci-hcd.0.auto: xHCI Host Controller
[    4.003128] xhci-hcd xhci-hcd.0.auto: new USB bus registered, assigned bus number 1
[    4.010925] xhci-hcd xhci-hcd.0.auto: hcc params 0x0238f625 hci version 0x100 quirks 0x0000000202010010
[    4.020336] xhci-hcd xhci-hcd.0.auto: irq 55, io mem 0xfe300000
[    4.026564] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 5.04
[    4.034831] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    4.042054] usb usb1: Product: xHCI Host Controller
[    4.046931] usb usb1: Manufacturer: Linux 5.4.0-xilinx-v2020.1 xhci-hcd
[    4.053541] usb usb1: SerialNumber: xhci-hcd.0.auto
[    4.058774] hub 1-0:1.0: USB hub found
[    4.062552] hub 1-0:1.0: 1 port detected
[    4.066679] xhci-hcd xhci-hcd.0.auto: xHCI Host Controller
[    4.072167] xhci-hcd xhci-hcd.0.auto: new USB bus registered, assigned bus number 2
[    4.079831] xhci-hcd xhci-hcd.0.auto: Host supports USB 3.0 SuperSpeed
[    4.086410] usb usb2: We don't know the algorithms for LPM for this host, disabling LPM.
[    4.094580] usb usb2: New USB device found, idVendor=1d6b, idProduct=0003, bcdDevice= 5.04
[    4.102846] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    4.110065] usb usb2: Product: xHCI Host Controller
[    4.114937] usb usb2: Manufacturer: Linux 5.4.0-xilinx-v2020.1 xhci-hcd
[    4.121541] usb usb2: SerialNumber: xhci-hcd.0.auto
[    4.126675] hub 2-0:1.0: USB hub found
[    4.130440] hub 2-0:1.0: 1 port detected
[    4.136226] i2c i2c-0: Added multiplexed i2c bus 2
[    4.141156] i2c i2c-0: Added multiplexed i2c bus 3
[    4.146207] i2c i2c-0: Added multiplexed i2c bus 4
[    4.151141] i2c i2c-0: Added multiplexed i2c bus 5
[    4.156626] tps65086 6-005e: Failed to read revision register
[    4.199630] random: fast init done
[    4.400602] usb 1-1: new high-speed USB device number 2 using xhci-hcd
[    4.553089] usb 1-1: New USB device found, idVendor=0424, idProduct=2744, bcdDevice= 2.05
[    4.561281] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[    4.568407] usb 1-1: Product: USB2744
[    4.572059] usb 1-1: Manufacturer: Microchip Tech
[    4.630497] hub 1-1:1.0: USB hub found
[    4.634286] hub 1-1:1.0: 4 ports detected
[    4.694455] usb 2-1: new SuperSpeed Gen 1 USB device number 2 using xhci-hcd
[    4.720981] usb 2-1: New USB device found, idVendor=0424, idProduct=5744, bcdDevice= 2.05
[    4.729165] usb 2-1: New USB device strings: Mfr=2, Product=3, SerialNumber=0
[    4.736295] usb 2-1: Product: USB5744
[    4.739947] usb 2-1: Manufacturer: Microchip Tech
[    4.774481] hub 2-1:1.0: USB hub found
[    4.778285] hub 2-1:1.0: 3 ports detected
[    4.988595] usb 1-1.1: new high-speed USB device number 3 using xhci-hcd
[    5.012081] i2c i2c-0: Added multiplexed i2c bus 6
[    5.017564] ina2xx_adc 7-0040: error configuring the device
[    5.023186] i2c i2c-0: Added multiplexed i2c bus 7
[    5.028125] i2c i2c-0: Added multiplexed i2c bus 8
[    5.033052] i2c i2c-0: Added multiplexed i2c bus 9
[    5.037849] pca954x 0-0075: registered 8 multiplexed busses for I2C switch pca9548
[    5.045458] cdns-i2c ff030000.i2c: 100 kHz mmio ff030000 irq 30
[    5.052359] cdns-wdt fd4d0000.watchdog: Xilinx Watchdog Timer with timeout 60s
[    5.059842] cdns-wdt ff150000.watchdog: Xilinx Watchdog Timer with timeout 10s
[    5.099856] mmc0: SDHCI controller on ff160000.mmc [ff160000.mmc] using ADMA 64-bit
[    5.108336] sdhci-arasan ff170000.mmc: allocated mmc-pwrseq
[    5.120382] usb 1-1.1: New USB device found, idVendor=0b95, idProduct=1780, bcdDevice= 0.01
[    5.128741] usb 1-1.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[    5.136046] usb 1-1.1: Product: GU-1000T
[    5.139965] usb 1-1.1: Manufacturer: PLANEX COM. Inc.
[    5.145012] usb 1-1.1: SerialNumber: 020707
[    5.161927] mmc1: SDHCI controller on ff170000.mmc [ff170000.mmc] using ADMA 64-bit
[    5.173609] input: gpio-keys as /devices/platform/gpio-keys/input/input0
[    5.180803] rtc_zynqmp ffa60000.rtc: setting system clock to 1970-01-01T00:00:07 UTC (7)
[    5.188889] of_cfs_init
[    5.191364] of_cfs_init: OK
[    5.194354] cfg80211: Loading compiled-in X.509 certificates for regulatory database
[    5.195149] mmc0: new high speed SDHC card at address aaaa
[    5.208389] mmcblk0: mmc0:aaaa SB32G 29.7 GiB 
[    5.216189] mmc1: new high speed SDIO card at address 0001
[    5.221898]  mmcblk0: p1 p2
[    5.341377] cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
[    5.347907] clk: Not disabling unused clocks
[    5.352176] ALSA device list:
[    5.355134]   #0: DisplayPort monitor
[    5.359288] platform regulatory.0: Direct firmware load for regulatory.db failed with error -2
[    5.367902] cfg80211: failed to load regulatory.db
[    5.557102] asix 1-1.1:1.0 eth0: register 'asix' at usb-xhci-hcd.0.auto-1.1, ASIX AX88178 USB 2.0 Ethernet, 00:22:cf:00:0c:37
[    5.594351] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
[    5.602481] VFS: Mounted root (ext4 filesystem) on device 179:2.
[    5.618313] devtmpfs: mounted
[    5.621589] Freeing unused kernel memory: 704K
[    5.626110] Run /sbin/init as init process
[    5.648617] usb 1-1.4: new high-speed USB device number 4 using xhci-hcd
INIT: version 2.88 booting[    5.753329] usb 1-1.4: New USB device found, idVendor=0424, idProduct=2740, bcdDevice= 2.00
[    5.761690] usb 1-1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[    5.768994] usb 1-1.4: Product: Hub Controller
[    5.773428] usb 1-1.4: Manufacturer: Microchip Tech

Starting udev
[    6.198059] udevd[163]: starting version 3.2.8
[    6.215632] random: udevd: uninitialized urandom read (16 bytes read)
[    6.222587] random: udevd: uninitialized urandom read (16 bytes read)
[    6.229094] random: udevd: uninitialized urandom read (16 bytes read)
[    6.288268] udevd[164]: starting eudev-3.2.8
[    6.457111] mali: loading out-of-tree module taints kernel.
[    6.470184] AP1302 4-003c: Probe: AP1302
[    6.474207] debugfs: Directory '4-003c' with parent 'regmap' already present!
[    6.512784] zynqmp_r5_remoteproc zynqmp-rpu: RPU core_conf: split
[    6.519260] remoteproc remoteproc0: r5@0 is available
[    6.583567] AP1302 4-003c: AP1302 Chip ID is 0x265
[    6.589603] AP1302 4-003c: AP1302 Chip Rev is 0x206
[    6.594560] AP1302 4-003c: Start to load firmware.
[    7.136702] FAT-fs (mmcblk0p1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
[   12.316602] random: crng init done
[   12.319998] random: 4 urandom warning(s) missed due to ratelimiting
[   13.109451] AP1302 4-003c: crc does not match. T:0xF80F F:0x1A5A
[   13.153438] AP1302 4-003c: AP1302 Chip ID is 0x265
[   13.159068] AP1302 4-003c: AP1302 Chip Rev is 0x206
[   13.163944] AP1302 4-003c: Start to load firmware.
[   19.666158] AP1302 4-003c: Load firmware successfully.
[   19.672797] AP1302 4-003c: AP1302 probe Success Done
[   19.751379] EXT4-fs (mmcblk0p2): re-mounted. Opts: (null)
Mon Nov  9 19:43:06 UTC 2020
Starting Ultra96 AP setup daemon.
Turning Ultra96 WiFi & Bluetooth LEDs ON...done.
 
[   21.273086] wifi_pm : 0
[   21.275529] wifi_pm : 1
Starting Flask server deamon to serve Ultra96 startup page[   21.279398] wilc_sdio mmc1:0001:1: Driver Initializing success
[   21.293084] WILC POWER UP
[   21.295739] wilc_sdio mmc1:0001:1: SDIO speed: 50000000
[   21.301274] wilc_sdio mmc1:0001:1: chipid 003000d0
.
INIT: Entering runlevel: 5
Starting system message bus: dbus.
Configuring network interfaces... Successfully initialized wpa_supplicant
done.
Starting Connection Manager
Starting haveged: haveged: listening socket at 3
haveged: haveged starting up


Starting Dropbear SSH server: dropbear.
Starting rpcbind daemon...done.
starting statd: haveged: haveged: ver: 1.9.5; arch: generic; vend: ; build: (gcc 9.2.0 CTV); collect: 128K

haveged: haveged: cpu: (VC); data: 16K (D); inst: 16K (D); idx: 11/40; sz: 15456/64452

haveged: haveged: tot tests(BA8): A:1/1 B:1/1 continuous tests(B):  last entropy estimate 7.99855

haveged: haveged: fills: 0, generated: 0 

done
Starting bluetooth: bluetoothd.
Starting internet superserver: inetd.
exportfs: can't open /etc/exports for reading
NFS daemon support not enabled in kernel
Starting ntpd: done
Starting syslogd/klogd: done
Starting internet superserver: xinetd.
 * Starting Avahi mDNS/DNS-SD Daemon: avahi-daemon                       [ ok ]
Starting Telephony daemon
Starting watchdog daemon...done
Starting Linux NFC daemon
Starting tcf-agent: OK

PetaLinux 2020.1 ultra96v2-2020-1 ttyPS0

ultra96v2-2020-1 login: [   26.489108] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready

  1. 2020年11月10日 05:12 |
  2. Ultra96
  3. | トラックバック:0
  4. | コメント:0

96Boards ON Semiconductor Dual Camera Mezzanine の Reference-Designs をやってみる1

96Boards ON Semiconductor Dual Camera Mezzanine の Getting Started Guide を見ながら、 Reference-Designs をやってみよう。

まずは、Reference-Designs をダウンロードした。

OnSemi_mezz_2020_1_1080p_OOB_200816.zip をダウンロードできたので、解凍した。
Ultra96_Dual_Camera_5_201109.png

OnSemi_mezz_2020_1_1080p_OOB_200816.img を解凍できた。
Ultra96_Dual_Camera_6_201109.png

このイメージを Etcher で MicroSD カードに書き込む。
今回は、イメージが 16 GB あったので、32 GB の MicroSD カードを用意した。 16 GB の MicroSD カードの実際の容量は 15.9 GB であるため、書き込むことができないと思う。
Ultra96_Dual_Camera_7_201109.png

書き込んでいるところだ。
Ultra96_Dual_Camera_8_201109.png

書き込み終了した。
Ultra96_Dual_Camera_9_201109.png

書き込み後の 1.0 GB ボリュームの内容を示す。
BOOT.BIN, boot.scr, image.ub があった。
Ultra96_Dual_Camera_10_201109.png

15 GB ボリュームは Root File System が入っているようだ。
Ultra96_Dual_Camera_11_201109.png
  1. 2020年11月09日 07:12 |
  2. Ultra96
  3. | トラックバック:0
  4. | コメント:0

Vitis 2020.1 で Application Timeline を確認する

Vitis 2020.1 で Application Timeline を確認してみよう。

Vitis 2020.1 の Protocol Checker をやってみた”の lap_filter_axis_dma_200 プロジェクトの で、 Assistant ウインドウの lap_filter_axis_dma_200_system -> lap_filter_axis_dma_200 -> Hardware を右クリックし、右クリックメニューから Run -> Run Configurations... を選択する。
Vitis_acc_option_57_201108.png

Debugger_lap_filter_axis_dma_200-Default が開く。
Enable profiling にチェックを入れて、
Generate timeline trace report: を Yes に変更する。
Collect Data Transfer Trace を Fine に
Collect Stall Trace を All に設定する。
Vitis_acc_option_58_201108.png

Apply ボタンをクリックし、Run ボタンをクリックした。

lap_fitler_axis_dma_200 アプリケーション・ソフトウェアが実行された。
Vitis_acc_option_59_201108.png

Assistant ウインドウの Debugger_lap_filter_axis_dma_200-Default の Run Summary (lap_filer_axis_dma_200.xclbin) をダブルクリックする。

Vitis Analyzer が起動した。
左のウインドウから Application Timeline を選択する。
Vitis_acc_option_61_201108.png

Application Timeline が表示されるが何のトランザクションも見えない。

終了時を拡大したところ、トランザクションが出てきた。
Vitis_acc_option_62_201108.png

でも、もしかして、データ転送これだけだろうか?
Vitis_acc_option_64_201108.png

最後に API Calls の Profile Summary を示す。
Vitis_acc_option_63_201108.png
  1. 2020年11月08日 09:11 |
  2. Vitis
  3. | トラックバック:0
  4. | コメント:0

96Boards ON Semiconductor Dual Camera Mezzanine が来ました

HDLAB のセミナ講師として新横浜に行っているうちに Avnet 社の 96Boards ON Semiconductor Dual Camera Mezzanine が来ました。

Avnet 社の 96Boards ON Semiconductor Dual Camera Mezzanine は Ultra96V2 に付けるデュアル・カメラです。 動かしてみるのが楽しみです。

Adam Taylor さんの”Avnet Ultra96 and OnSemi Dual MIPI Camera”も参考にしたい。

Ultra96_Dual_Camera_1_201107.jpg

Ultra96_Dual_Camera_2_201107.jpg

Ultra96_Dual_Camera_3_201107.jpg

Ultra96_Dual_Camera_4_201107.jpg
  1. 2020年11月07日 08:25 |
  2. Ultra96
  3. | トラックバック:0
  4. | コメント:0

Vitis 2020.1 の Protocol Checker をやってみた

Vitis 2020.1 で Protocol Checker を入れて試してみよう。
Protocol Checker は相当前に ChipScope AXI Monitor を試してみたことがあったが、それと同じようなものだろうか?

Assistant ウインドウの lap_filter_axis_dma_200_system -> lap_filter_axis_dma_200 -> Hardware を右クリックし右クリックメニューから Settings... を選択する。

Binary Container Settings ダイアログが開く。
左のウインドウで lap_filter_axis_dma_200_system -> lap_filter_axis_dma_200 -> Hardware を展開し、 lap_filter_axis_dma_200 をクリックする。

左のウインドウで lap_filter_axis_dma_200 -> lap_filter_axis_dma をクリックする。
Protocol Checker のチェックボックスをすべてチェックした。
Vitis_acc_option_50_201103.png

Explorer ウインドウで、 lap_filter_axis_dma_200_system -> lap_filter_axis_dma_200 を右クリックし、右クリックメニューから Build Project を選択してビルドした。クリーンしなくても Build Project だけで大丈夫のようだ。

ビルドが成功した。
Vitis_acc_option_51_201103.png

pfm/lap_filter_axis_dma_200/Hardware/package/sd_card のファイルも更新されている。
Vitis_acc_option_52_201103.png

Vivado プロジェクトのブロックデザインを見ると、lap_filter_axis_dma_1 に system_ila_0 だけじゃなく System_DPA が追加されていた。
Vitis_acc_option_53_201103.png

SFTP で Ultra96V2 の /media/sd-mmcblk0p1 ディレクトリから BOOT.BIN, image.ub, lap_filter_axis_dma_200, lap_filter_axis_dma_200.xclbin ファイルを削除した。

pfm/lap_filtger_axis_dma_200/Hardware/package/sd_card ディレクトリから Ultra96V2 の /media/sd-mmcblk0p1 ディレクトリに BOOT.BIN, image.ub, lap_filter_axis_dma_200.xclbin ファイルをコピーした。

Ultra96V2 をリブートした。
Vitis_acc_option_54_201103.png

Vivado を開く。
Assistant ウインドウの lap_filter_axis_dma_200_system -> lap_filter_axis_dma_200 -> Hardware -> lap_filter_axis_dma_200 を右クリックし右クリックメニューから Open Vivado Project を選択して、Vivado プロジェクトを開いた。

PROGRAM AND DEBUG -> Open Hardware Manage -> Open Target をクリックして、Auto Connect を選択する。
HARDWARE MANAGER が開いた。

hw_ila_1 ウインドウをフロートした。
左下のウインドウの Settings - hw_ila_1 タブをクリックして、Trigger position in window: に 100 クロックを入れた。
右下のウインドウの Trigger Setup - hw_ila_1 タブをクリックして、slot0: lap_filter_axis_dma_1_m_axi_gmem: ARVALID のトリガを R (立ち上がりエッジ)に設定した。

slot0 と slot1 に Protocol Checker Assertion が追加されていた。

Vitis の Assistant ウインドウの lap_filter_axis_dma_200_system -> lap_filter_axis_dma_200 -> Hardware を右クリックし右クリックメニューから Run -> Debugger_lap_filter_axis_dma_200-Default を選択して、実行を行った。
Vitis_acc_option_55_201103.png

Vivado を見るとトリガがかかっている。
Vitis_acc_option_56_201103.png

Protocol Checker Assertion は出ていなかった。
トリガを Protocol Checker Assertion でかけてみたが、変化は無かった。
Protocol Checker Assertion が出ていないということで、AXI4 インターフェースのプロトコル違反は無く正常な状態ということなんだろう ? と思う。
  1. 2020年11月04日 04:04 |
  2. Vitis
  3. | トラックバック:0
  4. | コメント:0

Vitis 2020.1 でカーネルの ChipScope Debug をやってみた

Vitis 2020.1 でカーネルの ChipScope Debug をやってみることにした。

Assistant ウインドウの lap_filter_axis_dma_200_system -> lap_filter_axis_dma_200 -> Hardware を右クリックし右クリックメニューから Settings... を選択する。

Binary Container Settings ダイアログが開く。
左のウインドウで lap_filter_axis_dma_200_system -> lap_filter_axis_dma_200 -> Hardware を展開し、 lap_filter_axis_dma_200 をクリックする。

左のウインドウで lap_filter_axis_dma_200 -> lap_filter_axis_dma をクリックする。
ChipScope Debug のチェックボックスをすべてチェックする。
Vitis_acc_option_37_201102.png

Explorer ウインドウで、 lap_filter_axis_dma_200_system -> lap_filter_axis_dma_200 を右クリックし、右クリックメニューから Clean Project を選択してクリーンし、続いて、Build Project を選択してビルドした。

ビルドが成功した。
Vitis_acc_option_38_201102.png

Vivado プロジェクトのブロックデザインを見ると、lap_filter_axis_dma_1 に system_ila_0 が追加されている。
Vitis_acc_option_39_201102.png

SFTP で Ultra96V2 の /media/sd-mmcblk0p1 ディレクトリから BOOT.BIN, image.ub, lap_filter_axis_dma_200, lap_filter_axis_dma_200.xclbin ファイルを削除した。

pfm/lap_filtger_axis_dma_200/Hardware/package/sd_card ディレクトリから Ultra96V2 の /media/sd-mmcblk0p1 ディレクトリに BOOT.BIN, image.ub, lap_filter_axis_dma_200.xclbin ファイルをコピーした。
Vitis_acc_option_43_201103.png

Vivado を開く。
Assistant ウインドウの lap_filter_axis_dma_200_system -> lap_filter_axis_dma_200 -> Hardware -> lap_filter_axis_dma_200 を右クリックし右クリックメニューから Open Vivado Project を選択して、Vivado プロジェクトを開いた。

PROGRAM AND DEBUG -> Open Hardware Manage -> Open Target をクリックして、Auto Connect を選択する。
HARDWARE MANAGER が開いた。
Vitis_acc_option_44_201103.png

hw_ila_1 ウインドウをフロートした。
左下のウインドウの Settings - hw_ila_1 タブをクリックして、Trigger position in window: に 100 クロックを入れた。
右下のウインドウの Trigger Setup - hw_ila_1 タブをクリックして、slot0: lap_filter_axis_dma_1_m_axi_gmem: ARVALID のトリガを R (立ち上がりエッジ)に設定した。
Vitis_acc_option_45_201103.png

Vitis の Assistant ウインドウの lap_filter_axis_dma_200_system -> lap_filter_axis_dma_200 -> Hardware を右クリックし右クリックメニューから Run -> Debugger_lap_filter_axis_dma_200-Default を選択して、実行を行った。
Vitis_acc_option_46_201103.png

Vivado を見るとトリガがかかっている。
Vitis_acc_option_47_201103.png

Vitis_acc_option_48_201103.png

拡大してみた。
AXI4 Write の WVALID の 0 の期間は 1 クロックだった。
Vitis_acc_option_49_201103.png
  1. 2020年11月03日 06:38 |
  2. Vitis
  3. | トラックバック:0
  4. | コメント:0

Vitis アクセラレーション・プラットフォームでデフォルト・クロックを変更する4(デフォルト・クロックを 300 MHz に変更2)

Vitis アクセラレーション・プラットフォームでデフォルト・クロックを変更する3(デフォルト・クロックを 300 MHz に変更)”の続き。

Vitis アクセラレーション・プラットフォームで、デフォルト・クロック( 100 MHz )を使用してアクセラレーション・ハードウェアを使用してきたが、他のクロックも使用したい。そこで、 前回は、動作周波数を 300 MHz にして Vitis のアクセラレーション・アプリケーション・プロジェクトをビルドすることができた。今回は、できあがったファイルを Ultra96V2 で試したところ成功し、実行時間も短くなった。

Ultra96V2 の /media/sd-mmcblk0p1 ディレクトリから BOOT.BIN, image.ub ファイルを削除した。

pfm/lap_filtger_axis_dma_300/Hardware/package/sd_card ディレクトリから Ultra96V2 の /media/sd-mmcblk0p1 ディレクトリに BOOT.BIN, image.ub, lap_filter_axis_dma_300.xclbin ファイルをコピーした。
Vitis_acc_option_29_201031.png

Assistant ウインドウの lap_filter_axis_dma_300_system -> lap_filter_axis_dma_300 -> Hardware を右クリックし右クリックメニューから Run -> Run Configurations... を選択する。

Run Configurations ダイアログが開く。
Single Application Debug をダブルクリックすると、Debugger_xxx (名前が何だったか忘れました)が生成され、Debugger_lap_filter_axis_dma_300-Default に名前を変更した。
Connection を 192.138.3.23 (Ultra96V2 の IP アドレス)に変更した。
Vitis_acc_option_30_201031.png

Apply ボタンをクリックして、 Run ボタンをクリックすると lap_filter_axis_dma_300 実行ファイルが lap_filter_axis_dma_300.xclbin 引数付きで実行された。
Vitis_acc_option_31_201031.png

成功だ。カーネルの実行時間は 2649260 ns 、約 2.649 ms となった。
カーネルの動作周波数が 100 MHz の時の実行時間は約 6.538 ms だったので、1/3 近くになっている。
実行時間は 2.649 / 6.538 X 100 ≒ 40.52 % になっている。
性能は 6.538 / 2.649 ≒ 2.47 倍になっている。
カーネル動作周波数は 300 MHz になっているようだ。

生成された profile_summary.csv を示す。
Vitis_acc_option_34_201101.png

Vitis_acc_option_35_201101.png

Vitis_acc_option_36_201101.png

ラプラシアンフィルタ処理後の temp_lap.bmp を貼っておく。正常にフィルタがかかっているようだ。
Vitis_acc_option_33_201101.jpg
  1. 2020年11月02日 04:03 |
  2. Vitis
  3. | トラックバック:0
  4. | コメント:0

Vitis アクセラレーション・プラットフォームでデフォルト・クロックを変更する3(デフォルト・クロックを 300 MHz に変更)

Vitis アクセラレーション・プラットフォームでデフォルト・クロックを変更する2(実機でテスト)”の続き。

Vitis アクセラレーション・プラットフォームで、デフォルト・クロック( 100 MHz )を使用してアクセラレーション・ハードウェアを使用してきたが、他のクロックも使用したい。そこで、 前回は、動作周波数を 200 MHz に変更して、できあがったバイナリと xclbin ファイルを Ultra96V2 で実行することができた。性能も向上した。今回は、動作周波数を 300 MHz にしてみよう。

lap_filter_axis_dma_300 アクセラレーション・アプリケーション・プロジェクトを作成した。(もうすでにビルド済みだが、気にしないでください)
Vitis_acc_option_22_201031.png

Assistant ウインドウの lap_filter_axis_dma_300_system -> lap_filter_axis_dma_300 -> Hardware を右クリックし右クリックメニューから Settings... を選択する。

Binary Container Settings ダイアログが開く。
左のウインドウで lap_filter_axis_dma_300_system -> lap_filter_axis_dma_300 -> Hardware を展開し、 lap_filter_axis_dma_300 をクリックする。
右のウインドウの V++ linker options: に --clock.defaultId 2 を追加した。
(注)この項目を表示するためには、一旦ビルドする必要があります。
Vitis_acc_option_23_201031.png

左のウインドウで lap_filter_axis_dma_300 -> lap_filter_axis_dma をクリックする。
右のウインドウで、 V++ compilter options: に --kernel_frequency 300 を追加した。
Vitis_acc_option_24_201031.png

Explorer ウインドウの lap_filter_axis_dma_300_system -> lap_filter_axis_dma_300 を右クリックし右クリックメニューから Bulid Project を選択してビルドを行った。ビルドが成功した。
Vitis_acc_option_22_201031.png

Vivado プロジェクトを開いて、ブロックデザインを確認した。
Assistant ウインドウの lap_filter_axis_dma_300_system -> lap_filter_axis_dma_300 -> Hardware -> lap_filter_axis_dma_300 を右クリックし右クリックメニューから Open Vivado Project を選択して、Vivado プロジェクトを開いた。
300 MHz の clk_out_3 が lap_filter_axis_dma_1 の ap_clk に接続されている。
Vitis_acc_option_25_201031.png

Assistant ウインドウの lap_filter_axis_dma_300_system -> lap_filter_axis_dma_300 -> Hardware -> lap_filter_axis_dma_300 を右クリックし右クリックメニューから Open in Vitis Analyzer を選択した。

Vitis Analyzer が立ち上がった。
lap_filter_axis_dma_300 (Hardware) -> System Estimate をクリックした。
Target Clock: は 100 MHz だが、 Timing Information (MHz) の Target Frequency は 300 MHz になっている。
Vitis_acc_option_26_201031.png

lap_filter_axis_dma (Hardware) -> Kernel Estimate をクリックした。
こちらの Target Clock: は 300 MHz だった。
Vitis_acc_option_27_201031.png

lap_filter_axis_dma (Hardware) -> HLS Synthesis をクリックした。
Latency (sycles) と Latency (ns) の対比を見ればクロックが 300 MHz であることが分かる。
300 MHz の場合はマイナス・スラックがでいるが、Vivado ではタイミングメットできている。
Vitis_acc_option_28_201031.png
  1. 2020年11月01日 04:24 |
  2. Vitis
  3. | トラックバック:0
  4. | コメント:0