日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

基于PYNQ-Z2重建BNN工程

發布時間:2023/12/19 编程问答 30 豆豆
生活随笔 收集整理的這篇文章主要介紹了 基于PYNQ-Z2重建BNN工程 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

基于PYNQ重建BNN工程

Github鏈接

環境:ubuntu18.04 vivado2018.3

參考步驟(源自Github的Readme)

Hardware design rebuilt

In order to rebuild the hardware designs, the repo should be cloned in a machine with installation of the Vivado Design Suite (tested with 2018.2).
Following the step-by-step instructions:

  • Clone the repository on your linux machine:
    git clone https://github.com/Xilinx/BNN-PYNQ.git --recursive;
  • Move to <clone_path>/BNN_PYNQ/bnn/src/network/
  • Set the XILINX_BNN_ROOT environment variable to <clone_path>/BNN_PYNQ/bnn/src/
  • Launch the shell script make-hw.sh with passing parameters for target network, target platform and mode, with the command
    ./make-hw.sh {network} {platform} {mode} where:
    • network can be cnvW1A1, cnvW1A2, cnvW2A2 or lfcW1A1, lfcW1A2;
    • platform can be pynqZ1-Z2 or ultra96;
    • mode can be h to launch Vivado HLS synthesis, b to launch the Vivado project (needs HLS synthesis results), a to launch both;
  • The results will be visible in clone_path/BNN_PYNQ/bnn/src/network/output/ that is organized as follows:
    • bitstream: contains the generated bitstream(s);
    • hls-syn: contains the Vivado HLS generated RTL and IP (in the subfolder named as the target network and target platform);
    • report: contains the Vivado and Vivado HLS reports;
    • vivado: contains the Vivado project;
  • Copy the generated bitstream, hwh and tcl script on the PYNQ board pip_installation_path/bnn/bitstreams/
  • 重建過程

    1.下載Github上的BNN項目壓縮包到自己制定的目錄下。(或者在Ubuntu上直接git clone,但Ubuntu無梯子,經常下到一半斷了,所以建議在Windows上下好壓縮包拷貝過去)

    2.解壓壓縮包至bnn文件夾下。

    unzip -d /home/yourname/bnn BNN_PYNQ.zip

    3.切換路徑到BNN-PYNQ-master中的network文件夾下

    cd /home/yourname/bnn/BNN-PYNQ-master/bnn/src/network/

    4.設置臨時的環境變量

    PATH=$PATH:/opt/Xilinx/Vivado/2018.2/bin XILINX_BNN_ROOT=$XILINX_BNN_ROOT:/home/yourname/bnn/BNN-PYNQ-master/bnn/src/

    5.執行shell腳本,生成hls IP。

    ./make-hw.sh cnvW1A1 pynqZ1-Z2 h

    問題:

    • make-hw.sh腳本中仍去git了兩個包,ubuntu無梯子也很容易失敗,建議在windows上下好兩個包放在指定路徑即可。將xilinx-tiny-cnn放在BNN-PYNQ-master/bnn/src文件夾下,將finn-hlslib放在BNN-PYNQ-master/bnn/src/library文件夾下。windows仍下不了的話我把兩個包的下載鏈接放于文章末尾。

    • 執行腳本時可以搭建工程,但csim報compiler error:*ERROR: [SIM 211-100] ‘csim_design’ failed: compilation error(s).*打開搭建好的工程發現testbench中部分庫文件找不到,報紅,但源文件沒問題,所以在hls-syn.tcl文件中直接刪除csim這一行,直接跑綜合,可以解決問題

    6.執行shell腳本,生成vivado工程

    ./make-hw.sh cnvW1A1 pynqZ1-Z2 b

    問題:

    將下圖路徑中所有的TCL文件中的vivado版本號修改,理論上應高于2018.2。

    7.重建完成

    注意事項:

    1.不要在Windows下重建工程。

    2.打開新終端時需重新執行步驟4,設置臨時變量。

    3.重建vivado工程時,由于ps7為只讀,部分參數設置不了,導致bit流最終仍存在一定問題,若想燒寫出正確的bit流請自行對照tcl文件修改ps7核的參數。

    重建項目下載鏈接

    finn-hlslib
    xilinx-tiny-cnn
    cnvW1A1_output
    cnvW1A2_output
    cnvW2A2_output
    lfcW1A1_output
    lfcW1A2_output

    總結

    以上是生活随笔為你收集整理的基于PYNQ-Z2重建BNN工程的全部內容,希望文章能夠幫你解決所遇到的問題。

    如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。