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

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

FPGAの部屋

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

KV260 の Petalinux の ls コマンド出力に色を付ける

lsコマンドの色を変更する方法”を参考にして、KV260 の Petalinux の ls コマンド出力に色を付けた。

KV260 の Petalinux の ls コマンド出力に色を付るのは、
ls --color=auto

と打てば良い。
そこで、ls を ls --color=auto にエイリアスすることにした。
alias ls='ls --color=auto'
kv260_median_platform_146_220531.png

~/.bashrc に追加した。
kv260_median_platform_147_220531.png
  1. 2022年05月31日 04:57 |
  2. PetaLinux
  3. | トラックバック:0
  4. | コメント:0

KV260 の Petalinux にインストールした OpenCV を使った C++ アプリケーション・ソフトウェアを cmake でコンパイルする

Xilinx の Petalinux イメージの KV260 に OpenCV 3.4.16 をインストールする”で OpenCV 3.4.16 をインストールすることができた。今回は、インストールした OpenCV 3.4.16 の関数を使った C++ アプリケーション・ソフトウェアを cmake でコンパイルする。

今回は参考にするのは、”OpenCVを使ったC++コードをコンパイルする(CMake, GCC, pkg-config)”だ。(参考にさせていただいて感謝する)

まずは、~/opencv に example ディレクトリを作成した。
その下に、独自の opencv_test.cpp を作成した。
単にファイルを imread() で読んで、 imwrite() でファイルに書き込みするだけのソフトウェアだ。
kv260_median_platform_140_220531.png

#include "opencv2/opencv.hpp"
#include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/imgcodecs/imgcodecs.hpp"
#include "opencv2/features2d.hpp"

int main(int argc, char** argv){
    cv::Mat in_img;

    if(argc < 3){
        printf("opencv_test [input files] [output files]\n");
        exit(0);
    }
    in_img = cv::imread(argv[1], 1);
    cv::imwrite(argv[2], in_img);

    return(0);
}


OpenCVを使ったC++コードをコンパイルする(CMake, GCC, pkg-config)”の CMakeLists.txt を引用した。ただし、KV260 上の Petalinux では日本語が表示できないので、コメントを Google 翻訳で英語に翻訳してある。途中のコメントは削除した。
kv260_median_platform_141_220531.png

# Declare the variable SOURCE_CORDE and enter the value opencv_test.
# Can be overwritten with cmake -D SOURCE_CODE = (source name)

set(SOURCE_CODE opencv_test CACHE NAME "Target object name")

cmake_minimum_required(VERSION 2.8)

project( ${SOURCE_CODE} )

find_package( OpenCV REQUIRED )

include_directories( ${OpenCV_INCLUDE_DIRS} )

add_executable( ${SOURCE_CODE} ${SOURCE_CODE}.cpp )

target_link_libraries( ${SOURCE_CODE} ${OpenCV_LIBS} )


build ディレクトリを作成して、build ディレクトリに移動した。

cmake を実行した。
cmake ..
kv260_median_platform_142_220531.png

make を実行した。
make
kv260_median_platform_143_220531.png

opencv_test 実行ファイルが作成された。

opencv_test 実行ファイルを走らせてみよう。
./opencv_test test2.jpg test2_copy.jpg
kv260_median_platform_144_220531.png

test2_copy.jpg が生成された。

test2_copy.jpg を示す。
kv260_median_platform_145_220531.jpg
  1. 2022年05月31日 04:41 |
  2. KRIA KV260 Vision AI Starter Kit
  3. | トラックバック:0
  4. | コメント:0

Xilinx の Petalinux イメージの KV260 に OpenCV 3.4.16 をインストールする

Xilinx の Petalinux イメージの KV260 に OpenCV 3.4.9 をインストールする”で OpenCV の make に失敗した。それで、最新の OpenCV 3.4.16 を Xilinx の Petalinux イメージの KV260 にインストールすることにした。

OpenCV 3.4.16 を wget して、名前を 3.4.16.zip から opencv-3.4.16.zip に変更した。
wget https://github.com/opencv/opencv/archive/3.4.16.zip
mv 3.4.16.zip opencv-3.4.16.zip


opencv_contrib を wget して、名前を 3.4.16.zip から opencv_contrib-3.4.16.zip に変更した。
wget https://github.com/opencv/opencv_contrib/archive/3.4.16.zip
mv 3.4.16.zip opencv_contrib-3.4.16.zip

kv260_median_platform_131_220528.png

opencv-3.4.16.zip を解凍し、 opencv-3.4.16 ディレクトリを opencv ディレクトリとしてシンボリック・リンクする。
opencv_contrib-3.4.16.zip を解凍し、opencv_contrib-3.4.16 ディレクトリを opencv_contrib ディレクトリとしてシンボリック・リンクする。
opencv ディレクトリに cd して、 build ディレクトリを作成し、 build ディレクトリに cd し、 環境変数の設定を行った。
unzip -q opencv-3.4.16.zip
ln -s opencv-3.4.16 opencv
unzip -q opencv_contrib-3.4.16.zip
ln -s opencv_contrib-3.4.16 opencv_contrib
mkdir build
cd build
export CC=gcc
export CXX=g++

kv260_median_platform_132_220528.png

cmake を行った。
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D OPENCV_EXTRA_MODULES_PATH=~/opencv/opencv_contrib/modules -D BUILD_NEW_PYTHON_SUPPORT=ON -D WITH_V4L=ON -D WITH_VTK=ON -D INSTALL_C_EXAMPLES=ON -D PYTHON3_EXECUTABLE=/usr/bin/python3.8 -D PYTHON_INCLUDE_DIR=/usr/include/python3.8 -D INSTALL_PYTHON_EXAMPLES=ON -D BUILD_EXAMPLES=ON -D ENABLE_FAST_MATH=1 -D WITH_CUDA=OFF ..
kv260_median_platform_133_220528.png
kv260_median_platform_134_220528.png

make
kv260_median_platform_135_220528.png
kv260_median_platform_136_220528.png

成功した。やったね。。。

sudo make install
kv260_median_platform_137_220528.png
kv260_median_platform_138_220528.png

sudo /bin/bash -c 'echo "/usr/local/lib" > /etc/ld.so.conf.d/opencv.conf'
sudo ldconfig

kv260_median_platform_139_220528.png

sudo /bin/bash -c 'echo "/usr/local/lib" > /etc/ld.so.conf.d/opencv.conf' はファイルが無かったようだ。

cmake の結果を貼っておく。

xilinx-k26-starterkit-2021_1:~/opencv/opencv/build$ cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D OPENCV_EXTRA_MODULES_PATH=~/opencv/opencv_contrib/modules -D BUILD_NEW_PYTHON_SUPPORT=ON -D WITH_V4L=ON -D WITH_VTK=ON -D INSTALL_C_EXAMPLES=ON -D PYTHON3_EXECUTABLE=/usr/bin/python3.8 -D PYTHON_INCLUDE_DIR=/usr/include/python3.8 -D INSTALL_PYTHON_EXAMPLES=ON -D BUILD_EXAMPLES=ON -D ENABLE_FAST_MATH=1 -D WITH_CUDA=OFF ..
-- The CXX compiler identification is GNU 10.2.0
-- The C compiler identification is GNU 10.2.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/g++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/gcc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detected processor: aarch64
-- Performing Test HAVE_CXX11 (check file: cmake/checks/cxx11.cpp)
-- Performing Test HAVE_CXX11 - Success
-- Could NOT find PythonInterp (missing: PYTHON_EXECUTABLE) (Required is at least version "2.7")
-- Found PythonInterp: /usr/bin/python3.8 (found suitable version "3.8.5", minimum required is "3.2") 
-- Found PythonLibs: /usr/lib/libpython3.8.so (found suitable exact version "3.8.5") 
-- Looking for ccache - not found
-- Performing Test HAVE_CXX_FSIGNED_CHAR
-- Performing Test HAVE_CXX_FSIGNED_CHAR - Success
-- Performing Test HAVE_C_FSIGNED_CHAR
-- Performing Test HAVE_C_FSIGNED_CHAR - Success
-- Performing Test HAVE_CXX_FFAST_MATH
-- Performing Test HAVE_CXX_FFAST_MATH - Success
-- Performing Test HAVE_C_FFAST_MATH
-- Performing Test HAVE_C_FFAST_MATH - Success
-- Performing Test HAVE_CXX_W
-- Performing Test HAVE_CXX_W - Success
-- Performing Test HAVE_C_W
-- Performing Test HAVE_C_W - Success
-- Performing Test HAVE_CXX_WALL
-- Performing Test HAVE_CXX_WALL - Success
-- Performing Test HAVE_C_WALL
-- Performing Test HAVE_C_WALL - Success
-- Performing Test HAVE_CXX_WERROR_RETURN_TYPE
-- Performing Test HAVE_CXX_WERROR_RETURN_TYPE - Success
-- Performing Test HAVE_C_WERROR_RETURN_TYPE
-- Performing Test HAVE_C_WERROR_RETURN_TYPE - Success
-- Performing Test HAVE_CXX_WERROR_NON_VIRTUAL_DTOR
-- Performing Test HAVE_CXX_WERROR_NON_VIRTUAL_DTOR - Success
-- Performing Test HAVE_C_WERROR_NON_VIRTUAL_DTOR
-- Performing Test HAVE_C_WERROR_NON_VIRTUAL_DTOR - Failed
-- Performing Test HAVE_CXX_WERROR_ADDRESS
-- Performing Test HAVE_CXX_WERROR_ADDRESS - Success
-- Performing Test HAVE_C_WERROR_ADDRESS
-- Performing Test HAVE_C_WERROR_ADDRESS - Success
-- Performing Test HAVE_CXX_WERROR_SEQUENCE_POINT
-- Performing Test HAVE_CXX_WERROR_SEQUENCE_POINT - Success
-- Performing Test HAVE_C_WERROR_SEQUENCE_POINT
-- Performing Test HAVE_C_WERROR_SEQUENCE_POINT - Success
-- Performing Test HAVE_CXX_WFORMAT
-- Performing Test HAVE_CXX_WFORMAT - Success
-- Performing Test HAVE_C_WFORMAT
-- Performing Test HAVE_C_WFORMAT - Success
-- Performing Test HAVE_CXX_WERROR_FORMAT_SECURITY
-- Performing Test HAVE_CXX_WERROR_FORMAT_SECURITY - Success
-- Performing Test HAVE_C_WERROR_FORMAT_SECURITY
-- Performing Test HAVE_C_WERROR_FORMAT_SECURITY - Success
-- Performing Test HAVE_CXX_WMISSING_DECLARATIONS
-- Performing Test HAVE_CXX_WMISSING_DECLARATIONS - Success
-- Performing Test HAVE_C_WMISSING_DECLARATIONS
-- Performing Test HAVE_C_WMISSING_DECLARATIONS - Success
-- Performing Test HAVE_CXX_WMISSING_PROTOTYPES
-- Performing Test HAVE_CXX_WMISSING_PROTOTYPES - Failed
-- Performing Test HAVE_C_WMISSING_PROTOTYPES
-- Performing Test HAVE_C_WMISSING_PROTOTYPES - Success
-- Performing Test HAVE_CXX_WSTRICT_PROTOTYPES
-- Performing Test HAVE_CXX_WSTRICT_PROTOTYPES - Failed
-- Performing Test HAVE_C_WSTRICT_PROTOTYPES
-- Performing Test HAVE_C_WSTRICT_PROTOTYPES - Success
-- Performing Test HAVE_CXX_WUNDEF
-- Performing Test HAVE_CXX_WUNDEF - Success
-- Performing Test HAVE_C_WUNDEF
-- Performing Test HAVE_C_WUNDEF - Success
-- Performing Test HAVE_CXX_WINIT_SELF
-- Performing Test HAVE_CXX_WINIT_SELF - Success
-- Performing Test HAVE_C_WINIT_SELF
-- Performing Test HAVE_C_WINIT_SELF - Success
-- Performing Test HAVE_CXX_WPOINTER_ARITH
-- Performing Test HAVE_CXX_WPOINTER_ARITH - Success
-- Performing Test HAVE_C_WPOINTER_ARITH
-- Performing Test HAVE_C_WPOINTER_ARITH - Success
-- Performing Test HAVE_CXX_WSHADOW
-- Performing Test HAVE_CXX_WSHADOW - Success
-- Performing Test HAVE_C_WSHADOW
-- Performing Test HAVE_C_WSHADOW - Success
-- Performing Test HAVE_CXX_WSIGN_PROMO
-- Performing Test HAVE_CXX_WSIGN_PROMO - Success
-- Performing Test HAVE_C_WSIGN_PROMO
-- Performing Test HAVE_C_WSIGN_PROMO - Failed
-- Performing Test HAVE_CXX_WUNINITIALIZED
-- Performing Test HAVE_CXX_WUNINITIALIZED - Success
-- Performing Test HAVE_C_WUNINITIALIZED
-- Performing Test HAVE_C_WUNINITIALIZED - Success
-- Performing Test HAVE_CXX_WSUGGEST_OVERRIDE
-- Performing Test HAVE_CXX_WSUGGEST_OVERRIDE - Success
-- Performing Test HAVE_C_WSUGGEST_OVERRIDE
-- Performing Test HAVE_C_WSUGGEST_OVERRIDE - Failed
-- Performing Test HAVE_CXX_WNO_DELETE_NON_VIRTUAL_DTOR
-- Performing Test HAVE_CXX_WNO_DELETE_NON_VIRTUAL_DTOR - Success
-- Performing Test HAVE_C_WNO_DELETE_NON_VIRTUAL_DTOR
-- Performing Test HAVE_C_WNO_DELETE_NON_VIRTUAL_DTOR - Failed
-- Performing Test HAVE_CXX_WNO_UNNAMED_TYPE_TEMPLATE_ARGS
-- Performing Test HAVE_CXX_WNO_UNNAMED_TYPE_TEMPLATE_ARGS - Failed
-- Performing Test HAVE_C_WNO_UNNAMED_TYPE_TEMPLATE_ARGS
-- Performing Test HAVE_C_WNO_UNNAMED_TYPE_TEMPLATE_ARGS - Failed
-- Performing Test HAVE_CXX_WNO_COMMENT
-- Performing Test HAVE_CXX_WNO_COMMENT - Success
-- Performing Test HAVE_C_WNO_COMMENT
-- Performing Test HAVE_C_WNO_COMMENT - Success
-- Performing Test HAVE_CXX_WIMPLICIT_FALLTHROUGH_3
-- Performing Test HAVE_CXX_WIMPLICIT_FALLTHROUGH_3 - Success
-- Performing Test HAVE_C_WIMPLICIT_FALLTHROUGH_3
-- Performing Test HAVE_C_WIMPLICIT_FALLTHROUGH_3 - Success
-- Performing Test HAVE_CXX_WNO_STRICT_OVERFLOW
-- Performing Test HAVE_CXX_WNO_STRICT_OVERFLOW - Success
-- Performing Test HAVE_C_WNO_STRICT_OVERFLOW
-- Performing Test HAVE_C_WNO_STRICT_OVERFLOW - Success
-- Performing Test HAVE_CXX_FDIAGNOSTICS_SHOW_OPTION
-- Performing Test HAVE_CXX_FDIAGNOSTICS_SHOW_OPTION - Success
-- Performing Test HAVE_C_FDIAGNOSTICS_SHOW_OPTION
-- Performing Test HAVE_C_FDIAGNOSTICS_SHOW_OPTION - Success
-- Performing Test HAVE_CXX_PTHREAD
-- Performing Test HAVE_CXX_PTHREAD - Success
-- Performing Test HAVE_C_PTHREAD
-- Performing Test HAVE_C_PTHREAD - Success
-- Performing Test HAVE_CXX_FOMIT_FRAME_POINTER
-- Performing Test HAVE_CXX_FOMIT_FRAME_POINTER - Success
-- Performing Test HAVE_C_FOMIT_FRAME_POINTER
-- Performing Test HAVE_C_FOMIT_FRAME_POINTER - Success
-- Performing Test HAVE_CXX_FFUNCTION_SECTIONS
-- Performing Test HAVE_CXX_FFUNCTION_SECTIONS - Success
-- Performing Test HAVE_C_FFUNCTION_SECTIONS
-- Performing Test HAVE_C_FFUNCTION_SECTIONS - Success
-- Performing Test HAVE_CXX_FDATA_SECTIONS
-- Performing Test HAVE_CXX_FDATA_SECTIONS - Success
-- Performing Test HAVE_C_FDATA_SECTIONS
-- Performing Test HAVE_C_FDATA_SECTIONS - Success
-- Performing Test HAVE_CPU_NEON_SUPPORT (check file: cmake/checks/cpu_neon.cpp)
-- Performing Test HAVE_CPU_NEON_SUPPORT - Success
-- Performing Test HAVE_CPU_FP16_SUPPORT (check file: cmake/checks/cpu_fp16.cpp)
-- Performing Test HAVE_CPU_FP16_SUPPORT - Success
-- Performing Test HAVE_CPU_BASELINE_FLAGS
-- Performing Test HAVE_CPU_BASELINE_FLAGS - Success
-- Performing Test HAVE_CXX_FVISIBILITY_HIDDEN
-- Performing Test HAVE_CXX_FVISIBILITY_HIDDEN - Success
-- Performing Test HAVE_C_FVISIBILITY_HIDDEN
-- Performing Test HAVE_C_FVISIBILITY_HIDDEN - Success
-- Performing Test HAVE_CXX_FVISIBILITY_INLINES_HIDDEN
-- Performing Test HAVE_CXX_FVISIBILITY_INLINES_HIDDEN - Success
-- Performing Test HAVE_C_FVISIBILITY_INLINES_HIDDEN
-- Performing Test HAVE_C_FVISIBILITY_INLINES_HIDDEN - Failed
-- Performing Test HAVE_LINK_AS_NEEDED
-- Performing Test HAVE_LINK_AS_NEEDED - Success
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for posix_memalign
-- Looking for posix_memalign - found
-- Looking for malloc.h
-- Looking for malloc.h - found
-- Looking for memalign
-- Looking for memalign - found
-- Check if the system is big endian
-- Searching 16 bit integer
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of unsigned short
-- Check size of unsigned short - done
-- Searching 16 bit integer - Using unsigned short
-- Check if the system is big endian - little endian
-- Found ZLIB: /usr/lib/libz.so (found suitable version "1.2.11", minimum required is "1.2.3") 
-- Found JPEG: /usr/lib/libjpeg.so (found version "62") 
-- Found TIFF: /usr/lib/libtiff.so (found version "4.1.0") 
-- Found WebP: /usr/lib/libwebp.so  
-- Could NOT find Jasper (missing: JASPER_LIBRARIES JASPER_INCLUDE_DIR) 
-- Performing Test HAVE_C_WNO_IMPLICIT_FUNCTION_DECLARATION
-- Performing Test HAVE_C_WNO_IMPLICIT_FUNCTION_DECLARATION - Success
-- Performing Test HAVE_C_WNO_UNINITIALIZED
-- Performing Test HAVE_C_WNO_UNINITIALIZED - Success
-- Performing Test HAVE_C_WNO_MISSING_PROTOTYPES
-- Performing Test HAVE_C_WNO_MISSING_PROTOTYPES - Success
-- Performing Test HAVE_C_WNO_UNUSED_BUT_SET_PARAMETER
-- Performing Test HAVE_C_WNO_UNUSED_BUT_SET_PARAMETER - Success
-- Performing Test HAVE_C_WNO_MISSING_DECLARATIONS
-- Performing Test HAVE_C_WNO_MISSING_DECLARATIONS - Success
-- Performing Test HAVE_C_WNO_UNUSED
-- Performing Test HAVE_C_WNO_UNUSED - Success
-- Performing Test HAVE_C_WNO_SHADOW
-- Performing Test HAVE_C_WNO_SHADOW - Success
-- Performing Test HAVE_C_WNO_SIGN_COMPARE
-- Performing Test HAVE_C_WNO_SIGN_COMPARE - Success
-- Performing Test HAVE_C_WNO_POINTER_COMPARE
-- Performing Test HAVE_C_WNO_POINTER_COMPARE - Success
-- Performing Test HAVE_C_WNO_ABSOLUTE_VALUE
-- Performing Test HAVE_C_WNO_ABSOLUTE_VALUE - Success
-- Performing Test HAVE_C_WNO_IMPLICIT_FALLTHROUGH
-- Performing Test HAVE_C_WNO_IMPLICIT_FALLTHROUGH - Success
-- Performing Test HAVE_C_WNO_UNUSED_PARAMETER
-- Performing Test HAVE_C_WNO_UNUSED_PARAMETER - Success
-- Performing Test HAVE_C_WNO_STRICT_PROTOTYPES
-- Performing Test HAVE_C_WNO_STRICT_PROTOTYPES - Success
-- Found ZLIB: /usr/lib/libz.so (found version "1.2.11") 
-- Found PNG: /usr/lib/libpng.so (found version "1.6.37") 
-- Looking for /usr/include/libpng/png.h
-- Looking for /usr/include/libpng/png.h - not found
-- Looking for semaphore.h
-- Looking for semaphore.h - found
-- Performing Test HAVE_CXX_WNO_SHADOW
-- Performing Test HAVE_CXX_WNO_SHADOW - Success
-- Performing Test HAVE_CXX_WNO_UNUSED
-- Performing Test HAVE_CXX_WNO_UNUSED - Success
-- Performing Test HAVE_CXX_WNO_SIGN_COMPARE
-- Performing Test HAVE_CXX_WNO_SIGN_COMPARE - Success
-- Performing Test HAVE_CXX_WNO_UNDEF
-- Performing Test HAVE_CXX_WNO_UNDEF - Success
-- Performing Test HAVE_CXX_WNO_MISSING_DECLARATIONS
-- Performing Test HAVE_CXX_WNO_MISSING_DECLARATIONS - Success
-- Performing Test HAVE_CXX_WNO_UNINITIALIZED
-- Performing Test HAVE_CXX_WNO_UNINITIALIZED - Success
-- Performing Test HAVE_CXX_WNO_SWITCH
-- Performing Test HAVE_CXX_WNO_SWITCH - Success
-- Performing Test HAVE_CXX_WNO_PARENTHESES
-- Performing Test HAVE_CXX_WNO_PARENTHESES - Success
-- Performing Test HAVE_CXX_WNO_ARRAY_BOUNDS
-- Performing Test HAVE_CXX_WNO_ARRAY_BOUNDS - Success
-- Performing Test HAVE_CXX_WNO_EXTRA
-- Performing Test HAVE_CXX_WNO_EXTRA - Success
-- Performing Test HAVE_CXX_WNO_DEPRECATED_DECLARATIONS
-- Performing Test HAVE_CXX_WNO_DEPRECATED_DECLARATIONS - Success
-- Performing Test HAVE_CXX_WNO_MISLEADING_INDENTATION
-- Performing Test HAVE_CXX_WNO_MISLEADING_INDENTATION - Success
-- Performing Test HAVE_CXX_WNO_DEPRECATED
-- Performing Test HAVE_CXX_WNO_DEPRECATED - Success
-- Performing Test HAVE_CXX_WNO_SUGGEST_OVERRIDE
-- Performing Test HAVE_CXX_WNO_SUGGEST_OVERRIDE - Success
-- Performing Test HAVE_CXX_WNO_INCONSISTENT_MISSING_OVERRIDE
-- Performing Test HAVE_CXX_WNO_INCONSISTENT_MISSING_OVERRIDE - Failed
-- Performing Test HAVE_CXX_WNO_IMPLICIT_FALLTHROUGH
-- Performing Test HAVE_CXX_WNO_IMPLICIT_FALLTHROUGH - Success
-- Performing Test HAVE_CXX_WNO_TAUTOLOGICAL_COMPARE
-- Performing Test HAVE_CXX_WNO_TAUTOLOGICAL_COMPARE - Success
-- Performing Test HAVE_CXX_WNO_MISSING_PROTOTYPES
-- Performing Test HAVE_CXX_WNO_MISSING_PROTOTYPES - Failed
-- Performing Test HAVE_CXX_WNO_REORDER
-- Performing Test HAVE_CXX_WNO_REORDER - Success
-- Performing Test HAVE_CXX_WNO_UNUSED_RESULT
-- Performing Test HAVE_CXX_WNO_UNUSED_RESULT - Success
-- Performing Test HAVE_CXX_WNO_CLASS_MEMACCESS
-- Performing Test HAVE_CXX_WNO_CLASS_MEMACCESS - Success
-- Looking for linux/videodev.h
-- Looking for linux/videodev.h - not found
-- Looking for linux/videodev2.h
-- Looking for linux/videodev2.h - found
-- Looking for sys/videoio.h
-- Looking for sys/videoio.h - not found
-- Can't find ffmpeg - 'pkg-config' utility is missing
-- Could not find OpenBLAS include. Turning OpenBLAS_FOUND off
-- Could not find OpenBLAS lib. Turning OpenBLAS_FOUND off
-- Could NOT find Atlas (missing: Atlas_CBLAS_INCLUDE_DIR Atlas_CLAPACK_INCLUDE_DIR Atlas_CBLAS_LIBRARY Atlas_BLAS_LIBRARY Atlas_LAPACK_LIBRARY) 
-- Looking for sgemm_
-- Looking for sgemm_ - not found
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE  
-- Could NOT find BLAS (missing: BLAS_LIBRARIES) 
-- LAPACK requires BLAS
-- A library with LAPACK API not found. Please specify library location.
-- Performing Test HAVE_CXX_WNO_UNUSED_PARAMETER
-- Performing Test HAVE_CXX_WNO_UNUSED_PARAMETER - Success
-- Performing Test HAVE_CXX_WNO_UNUSED_LOCAL_TYPEDEFS
-- Performing Test HAVE_CXX_WNO_UNUSED_LOCAL_TYPEDEFS - Success
-- Performing Test HAVE_CXX_WNO_SIGN_PROMO
-- Performing Test HAVE_CXX_WNO_SIGN_PROMO - Success
-- Performing Test HAVE_CXX_WNO_TAUTOLOGICAL_UNDEFINED_COMPARE
-- Performing Test HAVE_CXX_WNO_TAUTOLOGICAL_UNDEFINED_COMPARE - Failed
-- Performing Test HAVE_CXX_WNO_IGNORED_QUALIFIERS
-- Performing Test HAVE_CXX_WNO_IGNORED_QUALIFIERS - Success
-- Performing Test HAVE_CXX_WNO_UNUSED_FUNCTION
-- Performing Test HAVE_CXX_WNO_UNUSED_FUNCTION - Success
-- Performing Test HAVE_CXX_WNO_UNUSED_CONST_VARIABLE
-- Performing Test HAVE_CXX_WNO_UNUSED_CONST_VARIABLE - Success
-- Performing Test HAVE_CXX_WNO_SHORTEN_64_TO_32
-- Performing Test HAVE_CXX_WNO_SHORTEN_64_TO_32 - Failed
-- Performing Test HAVE_CXX_WNO_INVALID_OFFSETOF
-- Performing Test HAVE_CXX_WNO_INVALID_OFFSETOF - Success
-- Performing Test HAVE_CXX_WNO_ENUM_COMPARE_SWITCH
-- Performing Test HAVE_CXX_WNO_ENUM_COMPARE_SWITCH - Failed
-- Could NOT find JNI (missing: JAVA_AWT_LIBRARY JAVA_JVM_LIBRARY JAVA_INCLUDE_PATH JAVA_INCLUDE_PATH2 JAVA_AWT_INCLUDE_PATH) 
-- Could NOT find Pylint (missing: PYLINT_EXECUTABLE) 
-- Could NOT find Flake8 (missing: FLAKE8_EXECUTABLE) 
-- VTK is not found. Please set -DVTK_DIR in CMake to VTK build directory, or to VTK install subdirectory with VTKConfig.cmake file
-- Performing Test HAVE_C_WNO_UNUSED_VARIABLE
-- Performing Test HAVE_C_WNO_UNUSED_VARIABLE - Success
-- Looking for dlerror in dl
-- Looking for dlerror in dl - found
-- Performing Test HAVE_C_WNO_UNDEF
-- Performing Test HAVE_C_WNO_UNDEF - Success
-- OpenCV Python: during development append to PYTHONPATH: /home/petalinux/opencv/opencv/build/python_loader
-- freetype2:   NO
-- harfbuzz:    NO
/usr/h5cc
dir is /usr
/usr/bin/h5cc: line 32: pkg-config: command not found
/usr/bin/h5cc: line 32: /scratch/jenkins-BUILDS-eSDK-2021.1_stable-pipeline-build-190_ZynqMpEvFull/build/tmp/work/cortexa72-cortexa53-xilinx-linux/hdf5/1.8.21-r0/recipe-sysroot-native/usr/bin/aarch64-xilinx-linux/aarch64-xilinx-linux-gcc: No such file or directory
-- HDF5 C compiler wrapper is unable to compile a minimal HDF5 program.
-- Could NOT find HDF5 (missing: HDF5_LIBRARIES HDF5_INCLUDE_DIRS) (found version "")
-- Module opencv_ovis disabled because OGRE3D was not found
-- Checking SFM glog/gflags deps... TRUE
-- CERES support is disabled. Ceres Solver for reconstruction API is required.
-- Tesseract:   NO
-- Allocator metrics storage type: 'int'
-- Excluding from source files list: <BUILD>/modules/core/test/test_intrin128.sse2.cpp
-- Excluding from source files list: <BUILD>/modules/core/test/test_intrin128.sse3.cpp
-- Excluding from source files list: <BUILD>/modules/core/test/test_intrin128.ssse3.cpp
-- Excluding from source files list: <BUILD>/modules/core/test/test_intrin128.sse4_1.cpp
-- Excluding from source files list: <BUILD>/modules/core/test/test_intrin128.sse4_2.cpp
-- Excluding from source files list: <BUILD>/modules/core/test/test_intrin128.avx.cpp
-- Excluding from source files list: <BUILD>/modules/core/test/test_intrin128.avx2.cpp
-- Excluding from source files list: <BUILD>/modules/core/test/test_intrin128.avx512_skx.cpp
-- Excluding from source files list: <BUILD>/modules/core/test/test_intrin256.avx2.cpp
-- Excluding from source files list: <BUILD>/modules/core/test/test_intrin256.avx512_skx.cpp
-- Excluding from source files list: <BUILD>/modules/core/test/test_intrin512.avx512_skx.cpp
-- Excluding from source files list: modules/imgproc/src/corner.avx.cpp
-- Excluding from source files list: modules/imgproc/src/imgwarp.avx2.cpp
-- Excluding from source files list: modules/imgproc/src/imgwarp.sse4_1.cpp
-- Excluding from source files list: modules/imgproc/src/resize.avx2.cpp
-- Excluding from source files list: modules/imgproc/src/resize.sse4_1.cpp
-- Excluding from source files list: <BUILD>/modules/dnn/layers/layers_common.avx.cpp
-- Excluding from source files list: <BUILD>/modules/dnn/layers/layers_common.avx2.cpp
-- Excluding from source files list: <BUILD>/modules/dnn/layers/layers_common.avx512_skx.cpp
-- Excluding from source files list: modules/features2d/src/fast.avx2.cpp
-- Performing Test HAVE_CXX_WNO_OVERLOADED_VIRTUAL
-- Performing Test HAVE_CXX_WNO_OVERLOADED_VIRTUAL - Success
-- Excluding from source files list: modules/objdetect/src/haar.avx.cpp
-- xfeatures2d/boostdesc: Download: boostdesc_bgm.i
-- xfeatures2d/boostdesc: Download: boostdesc_bgm_bi.i
-- xfeatures2d/boostdesc: Download: boostdesc_bgm_hd.i
-- xfeatures2d/boostdesc: Download: boostdesc_binboost_064.i
-- xfeatures2d/boostdesc: Download: boostdesc_binboost_128.i
-- xfeatures2d/boostdesc: Download: boostdesc_binboost_256.i
-- xfeatures2d/boostdesc: Download: boostdesc_lbgm.i
-- xfeatures2d/vgg: Download: vgg_generated_48.i
-- xfeatures2d/vgg: Download: vgg_generated_64.i
-- xfeatures2d/vgg: Download: vgg_generated_80.i
-- xfeatures2d/vgg: Download: vgg_generated_120.i
-- data: Download: face_landmark_model.dat
-- CERES support is disabled. Ceres Solver for reconstruction API is required.
-- Performing Test HAVE_CXX_WNO_UNUSED_BUT_SET_VARIABLE
-- Performing Test HAVE_CXX_WNO_UNUSED_BUT_SET_VARIABLE - Success
-- Performing Test HAVE_CXX_WNO_DEPRECATED_COPY
-- Performing Test HAVE_CXX_WNO_DEPRECATED_COPY - Success
-- Performing Test HAVE_CXX_WNO_UNUSED_PRIVATE_FIELD
-- Performing Test HAVE_CXX_WNO_UNUSED_PRIVATE_FIELD - Failed
-- OpenCL samples are skipped: OpenCL SDK is required
-- 
-- General configuration for OpenCV 3.4.16 =====================================
--   Version control:               unknown
-- 
--   Extra modules:
--     Location (extra):            /home/petalinux/opencv/opencv_contrib/modules
--     Version control (extra):     unknown
-- 
--   Platform:
--     Timestamp:                   2022-05-28T08:55:17Z
--     Host:                        Linux 5.10.0-xilinx-v2021.1 aarch64
--     CMake:                       3.18.2
--     CMake generator:             Unix Makefiles
--     CMake build tool:            /usr/bin/gmake
--     Configuration:               RELEASE
-- 
--   CPU/HW features:
--     Baseline:                    NEON FP16
-- 
--   C/C++:
--     Built as dynamic libs?:      YES
--     C++11:                       YES
--     C++ Compiler:                /usr/bin/g++  (ver 10.2.0)
--     C++ flags (Release):         -fsigned-char -ffast-math -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Wsuggest-override -Wno-delete-non-virtual-dtor -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections    -fvisibility=hidden -fvisibility-inlines-hidden -O3 -DNDEBUG  -DNDEBUG
--     C++ flags (Debug):           -fsigned-char -ffast-math -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Wsuggest-override -Wno-delete-non-virtual-dtor -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections    -fvisibility=hidden -fvisibility-inlines-hidden -g  -O0 -DDEBUG -D_DEBUG
--     C Compiler:                  /usr/bin/gcc
--     C flags (Release):           -fsigned-char -ffast-math -W -Wall -Werror=return-type -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections    -fvisibility=hidden -O3 -DNDEBUG  -DNDEBUG
--     C flags (Debug):             -fsigned-char -ffast-math -W -Wall -Werror=return-type -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections    -fvisibility=hidden -g  -O0 -DDEBUG -D_DEBUG
--     Linker flags (Release):      -Wl,--gc-sections -Wl,--as-needed  
--     Linker flags (Debug):        -Wl,--gc-sections -Wl,--as-needed  
--     ccache:                      NO
--     Precompiled headers:         NO
--     Extra dependencies:          dl m pthread rt
--     3rdparty dependencies:
-- 
--   OpenCV modules:
--     To be built:                 aruco bgsegm bioinspired calib3d ccalib core datasets dnn dnn_objdetect dpm face features2d flann fuzzy hfs highgui img_hash imgcodecs imgproc line_descriptor ml objdetect optflow phase_unwrapping photo plot python3 reg rgbd saliency sfm shape stereo stitching structured_light superres surface_matching text tracking ts video videoio videostab xfeatures2d ximgproc xobjdetect xphoto
--     Disabled:                    world
--     Disabled by dependency:      -
--     Unavailable:                 cudaarithm cudabgsegm cudacodec cudafeatures2d cudafilters cudaimgproc cudalegacy cudaobjdetect cudaoptflow cudastereo cudawarping cudev cvv freetype hdf java matlab ovis python2 viz
--     Applications:                tests perf_tests examples apps
--     Documentation:               NO
--     Non-free algorithms:         NO
-- 
--   GUI: 
--     GTK+:                        NO
--     VTK support:                 NO
-- 
--   Media I/O: 
--     ZLib:                        /usr/lib/libz.so (ver 1.2.11)
--     JPEG:                        /usr/lib/libjpeg.so (ver 62)
--     WEBP:                        /usr/lib/libwebp.so (ver encoder: 0x020f)
--     PNG:                         /usr/lib/libpng.so (ver 1.6.37)
--     TIFF:                        /usr/lib/libtiff.so (ver 42 / 4.1.0)
--     JPEG 2000:                   build (ver 1.900.1)
--     OpenEXR:                     build (ver 2.3.0)
--     HDR:                         YES
--     SUNRASTER:                   YES
--     PXM:                         YES
-- 
--   Video I/O:
--     DC1394:                      NO
--     FFMPEG:                      NO
--       avcodec:                   NO
--       avformat:                  NO
--       avutil:                    NO
--       swscale:                   NO
--       avresample:                NO
--     GStreamer:                   NO
--     libv4l/libv4l2:              NO
--     v4l/v4l2:                    linux/videodev2.h
-- 
--   Parallel framework:            pthreads
-- 
--   Trace:                         YES (with Intel ITT)
-- 
--   Other third-party libraries:
--     Lapack:                      NO
--     Eigen:                       YES (ver 3.3.7)
--     Custom HAL:                  YES (carotene (ver 0.0.1))
--     Protobuf:                    build (3.5.1)
-- 
--   OpenCL:                        YES (no extra features)
--     Include path:                /home/petalinux/opencv/opencv/3rdparty/include/opencl/1.2
--     Link libraries:              Dynamic load
-- 
--   Python 3:
--     Interpreter:                 /usr/bin/python3.8 (ver 3.8.5)
--     Libraries:                   /usr/lib/libpython3.8.so (ver 3.8.5)
--     numpy:                       /usr/lib/python3.8/site-packages/numpy/core/include (ver 1.19.1)
--     install path:                lib/python3.8/site-packages/cv2/python-3.8
-- 
--   Python (for build):            /usr/bin/python3.8
-- 
--   Java:                          
--     ant:                         NO
--     JNI:                         NO
--     Java wrappers:               NO
--     Java tests:                  NO
-- 
--   Install to:                    /usr/local
-- -----------------------------------------------------------------
-- 
-- Configuring done
-- Generating done
-- Build files have been written to: /home/petalinux/opencv/opencv/build

  1. 2022年05月29日 07:04 |
  2. KRIA KV260 Vision AI Starter Kit
  3. | トラックバック:0
  4. | コメント:0

Xilinx の Petalinux イメージの KV260 に OpenCV 3.4.9 をインストールする

Xilinx の Petalinux イメージの KV260 に OpenCV 3.4.9 のソースコードをダウンロードしてインストールしようとしたが、make でエラーになってしまった。

OpenCV 3.4.9 はソースコードからビルドすることにして、”Ubuntu 18.04 LTS のパソコンに OpenCV 3.4.9 をインストールする”を参考にして、インストールしていこうと思う。

今回も試行錯誤していたので、記憶が多少曖昧になっているところがある。
まずは、dnf で wget, git, cmake をインストールした。(例: sudo dnf install wget

OpenCV 3.4.9 を wget して、名前を 3.4.9.zip から opencv-3.4.9.zip に変更した。
wget https://github.com/opencv/opencv/archive/3.4.9.zip
mv 3.4.9.zip opencv-3.4.9.zip

kv260_median_platform_125_220527.png

opencv_contrib を wget して、名前を 3.4.9.zip から opencv_contrib-3.4.9.zip に変更した。
wget https://github.com/opencv/opencv_contrib/archive/3.4.9.zip
mv 3.4.9.zip opencv_contrib-3.4.9.zip

kv260_median_platform_126_220527.png

opencv-3.4.9.zip を解凍し、 opencv-3.4.9 ディレクトリを opencv ディレクトリとしてシンボリック・リンクする。
opencv_contrib-3.4.9.zip を解凍し、opencv_contrib-3.4.9 ディレクトリを opencv_contrib ディレクトリとしてシンボリック・リンクする。
unzip -q opencv-3.4.9.zip
ln -s opencv-3.4.9 opencv
unzip -q opencv_contrib-3.4.9.zip
ln -s opencv_contrib-3.4.9 opencv_contrib

kv260_median_platform_126_220527.png

opencv ディレクトリに cd して、 build ディレクトリを作成し、 build ディレクトリに cd し、 環境変数の設定を行った。
cd opencv
mkdir build
cd build
export CC=gcc
export CXX=g++


cmake を行った。
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D OPENCV_EXTRA_MODULES_PATH=~/opencv/opencv_contrib/modules -D BUILD_NEW_PYTHON_SUPPORT=ON -D WITH_V4L=ON -D WITH_VTK=ON -D INSTALL_C_EXAMPLES=ON -D PYTHON3_EXECUTABLE=/usr/bin/python3.8 -D PYTHON_INCLUDE_DIR=/usr/include/python3.8 -D INSTALL_PYTHON_EXAMPLES=ON -D BUILD_EXAMPLES=ON -D ENABLE_FAST_MATH=1 -D WITH_CUDA=OFF ..
kv260_median_platform_127_220527.png

make を行った。
make -j4
kv260_median_platform_128_220527.png

9 % 辺りでエラーになってしまった。
kv260_median_platform_129_220527.png
kv260_median_platform_130_220527.png

エラー内容は、

g++: error: unrecognized command-line option '--param=ipcp-unit-growth=100000'; did you mean '--param=ipa-cp-unit-growth='?
g++: error: unrecognized command-line option '--param=ipcp-unit-growth=100000'; did you mean '--param=ipa-cp-unit-growth='?


だった。
検索してみると、”unrecognized command-line option ‘--param=ipcp-unit-growth=100000’ #19037”がヒットした。
それによると新しい OpenCV をビルドしろということなので、もっと新しい OpenCV をダウンロードしてビルドしてみよう。

最後に cmake の結果を貼っておく。

xilinx-k26-starterkit-2021_1:~/opencv/opencv/build$ cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D OPENCV_EXTRA_MODULES_PATH=~/opencv/opencv_contrib/modules -D BUILD_NEW_PYTHON_SUPPORT=ON -D WITH_V4L=ON -D WITH_VTK=ON -D INSTALL_C_EXAMPLES=ON -D PYTHON3_EXECUTABLE=/usr/bin/python3.8 -D PYTHON_INCLUDE_DIR=/usr/include/python3.8 -D INSTALL_PYTHON_EXAMPLES=ON -D BUILD_EXAMPLES=ON -D ENABLE_FAST_MATH=1 -D WITH_CUDA=OFF ..
-- The CXX compiler identification is GNU 10.2.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/g++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Detected processor: aarch64
-- Performing Test HAVE_CXX11 (check file: cmake/checks/cxx11.cpp)
-- Performing Test HAVE_CXX11 - Success
-- Performing Test HAVE_CXX_ATOMICS_WITHOUT_LIB (check file: cmake/checks/atomic_check.cpp)
-- Performing Test HAVE_CXX_ATOMICS_WITHOUT_LIB - Success
CMake Warning at cmake/OpenCVUtils.cmake:721 (message):
  Unexpected option: WITH_CUBLAS (=1)

  Condition: IF (WITH_CUDA)
Call Stack (most recent call first):
  CMakeLists.txt:243 (OCV_OPTION)


-- Could NOT find PythonInterp (missing: PYTHON_EXECUTABLE) (Required is at least version "2.7")
-- Found PythonInterp: /usr/bin/python3.8 (found suitable version "3.8.5", minimum required is "3.2") 
-- Found PythonLibs: /usr/lib/x86_64-linux-gnu/libpython3.6m.so (found suitable exact version "3.8.5") 
-- Looking for ccache - not found
-- Performing Test HAVE_CXX_FSIGNED_CHAR
-- Performing Test HAVE_CXX_FSIGNED_CHAR - Success
-- Performing Test HAVE_C_FSIGNED_CHAR
-- Performing Test HAVE_C_FSIGNED_CHAR - Success
-- Performing Test HAVE_CXX_FFAST_MATH
-- Performing Test HAVE_CXX_FFAST_MATH - Success
-- Performing Test HAVE_C_FFAST_MATH
-- Performing Test HAVE_C_FFAST_MATH - Success
-- Performing Test HAVE_CXX_W
-- Performing Test HAVE_CXX_W - Success
-- Performing Test HAVE_C_W
-- Performing Test HAVE_C_W - Success
-- Performing Test HAVE_CXX_WALL
-- Performing Test HAVE_CXX_WALL - Success
-- Performing Test HAVE_C_WALL
-- Performing Test HAVE_C_WALL - Success
-- Performing Test HAVE_CXX_WERROR_RETURN_TYPE
-- Performing Test HAVE_CXX_WERROR_RETURN_TYPE - Success
-- Performing Test HAVE_C_WERROR_RETURN_TYPE
-- Performing Test HAVE_C_WERROR_RETURN_TYPE - Success
-- Performing Test HAVE_CXX_WERROR_NON_VIRTUAL_DTOR
-- Performing Test HAVE_CXX_WERROR_NON_VIRTUAL_DTOR - Success
-- Performing Test HAVE_C_WERROR_NON_VIRTUAL_DTOR
-- Performing Test HAVE_C_WERROR_NON_VIRTUAL_DTOR - Failed
-- Performing Test HAVE_CXX_WERROR_ADDRESS
-- Performing Test HAVE_CXX_WERROR_ADDRESS - Success
-- Performing Test HAVE_C_WERROR_ADDRESS
-- Performing Test HAVE_C_WERROR_ADDRESS - Success
-- Performing Test HAVE_CXX_WERROR_SEQUENCE_POINT
-- Performing Test HAVE_CXX_WERROR_SEQUENCE_POINT - Success
-- Performing Test HAVE_C_WERROR_SEQUENCE_POINT
-- Performing Test HAVE_C_WERROR_SEQUENCE_POINT - Success
-- Performing Test HAVE_CXX_WFORMAT
-- Performing Test HAVE_CXX_WFORMAT - Success
-- Performing Test HAVE_C_WFORMAT
-- Performing Test HAVE_C_WFORMAT - Success
-- Performing Test HAVE_CXX_WERROR_FORMAT_SECURITY
-- Performing Test HAVE_CXX_WERROR_FORMAT_SECURITY - Success
-- Performing Test HAVE_C_WERROR_FORMAT_SECURITY
-- Performing Test HAVE_C_WERROR_FORMAT_SECURITY - Success
-- Performing Test HAVE_CXX_WMISSING_DECLARATIONS
-- Performing Test HAVE_CXX_WMISSING_DECLARATIONS - Success
-- Performing Test HAVE_C_WMISSING_DECLARATIONS
-- Performing Test HAVE_C_WMISSING_DECLARATIONS - Success
-- Performing Test HAVE_CXX_WMISSING_PROTOTYPES
-- Performing Test HAVE_CXX_WMISSING_PROTOTYPES - Success
-- Performing Test HAVE_C_WMISSING_PROTOTYPES
-- Performing Test HAVE_C_WMISSING_PROTOTYPES - Success
-- Performing Test HAVE_CXX_WSTRICT_PROTOTYPES
-- Performing Test HAVE_CXX_WSTRICT_PROTOTYPES - Success
-- Performing Test HAVE_C_WSTRICT_PROTOTYPES
-- Performing Test HAVE_C_WSTRICT_PROTOTYPES - Success
-- Performing Test HAVE_CXX_WUNDEF
-- Performing Test HAVE_CXX_WUNDEF - Success
-- Performing Test HAVE_C_WUNDEF
-- Performing Test HAVE_C_WUNDEF - Success
-- Performing Test HAVE_CXX_WINIT_SELF
-- Performing Test HAVE_CXX_WINIT_SELF - Success
-- Performing Test HAVE_C_WINIT_SELF
-- Performing Test HAVE_C_WINIT_SELF - Success
-- Performing Test HAVE_CXX_WPOINTER_ARITH
-- Performing Test HAVE_CXX_WPOINTER_ARITH - Success
-- Performing Test HAVE_C_WPOINTER_ARITH
-- Performing Test HAVE_C_WPOINTER_ARITH - Success
-- Performing Test HAVE_CXX_WSHADOW
-- Performing Test HAVE_CXX_WSHADOW - Success
-- Performing Test HAVE_C_WSHADOW
-- Performing Test HAVE_C_WSHADOW - Success
-- Performing Test HAVE_CXX_WSIGN_PROMO
-- Performing Test HAVE_CXX_WSIGN_PROMO - Success
-- Performing Test HAVE_C_WSIGN_PROMO
-- Performing Test HAVE_C_WSIGN_PROMO - Success
-- Performing Test HAVE_CXX_WUNINITIALIZED
-- Performing Test HAVE_CXX_WUNINITIALIZED - Success
-- Performing Test HAVE_C_WUNINITIALIZED
-- Performing Test HAVE_C_WUNINITIALIZED - Success
-- Performing Test HAVE_CXX_WSUGGEST_OVERRIDE
-- Performing Test HAVE_CXX_WSUGGEST_OVERRIDE - Success
-- Performing Test HAVE_C_WSUGGEST_OVERRIDE
-- Performing Test HAVE_C_WSUGGEST_OVERRIDE - Success
-- Performing Test HAVE_CXX_WNO_DELETE_NON_VIRTUAL_DTOR
-- Performing Test HAVE_CXX_WNO_DELETE_NON_VIRTUAL_DTOR - Success
-- Performing Test HAVE_C_WNO_DELETE_NON_VIRTUAL_DTOR
-- Performing Test HAVE_C_WNO_DELETE_NON_VIRTUAL_DTOR - Success
-- Performing Test HAVE_CXX_WNO_UNNAMED_TYPE_TEMPLATE_ARGS
-- Performing Test HAVE_CXX_WNO_UNNAMED_TYPE_TEMPLATE_ARGS - Failed
-- Performing Test HAVE_C_WNO_UNNAMED_TYPE_TEMPLATE_ARGS
-- Performing Test HAVE_C_WNO_UNNAMED_TYPE_TEMPLATE_ARGS - Failed
-- Performing Test HAVE_CXX_WNO_COMMENT
-- Performing Test HAVE_CXX_WNO_COMMENT - Success
-- Performing Test HAVE_C_WNO_COMMENT
-- Performing Test HAVE_C_WNO_COMMENT - Success
-- Performing Test HAVE_CXX_WIMPLICIT_FALLTHROUGH_3
-- Performing Test HAVE_CXX_WIMPLICIT_FALLTHROUGH_3 - Success
-- Performing Test HAVE_C_WIMPLICIT_FALLTHROUGH_3
-- Performing Test HAVE_C_WIMPLICIT_FALLTHROUGH_3 - Success
-- Performing Test HAVE_CXX_WNO_STRICT_OVERFLOW
-- Performing Test HAVE_CXX_WNO_STRICT_OVERFLOW - Success
-- Performing Test HAVE_C_WNO_STRICT_OVERFLOW
-- Performing Test HAVE_C_WNO_STRICT_OVERFLOW - Success
-- Performing Test HAVE_CXX_FDIAGNOSTICS_SHOW_OPTION
-- Performing Test HAVE_CXX_FDIAGNOSTICS_SHOW_OPTION - Success
-- Performing Test HAVE_C_FDIAGNOSTICS_SHOW_OPTION
-- Performing Test HAVE_C_FDIAGNOSTICS_SHOW_OPTION - Success
-- Performing Test HAVE_CXX_PTHREAD
-- Performing Test HAVE_CXX_PTHREAD - Success
-- Performing Test HAVE_C_PTHREAD
-- Performing Test HAVE_C_PTHREAD - Success
-- Performing Test HAVE_CXX_FOMIT_FRAME_POINTER
-- Performing Test HAVE_CXX_FOMIT_FRAME_POINTER - Success
-- Performing Test HAVE_C_FOMIT_FRAME_POINTER
-- Performing Test HAVE_C_FOMIT_FRAME_POINTER - Success
-- Performing Test HAVE_CXX_FFUNCTION_SECTIONS
-- Performing Test HAVE_CXX_FFUNCTION_SECTIONS - Success
-- Performing Test HAVE_C_FFUNCTION_SECTIONS
-- Performing Test HAVE_C_FFUNCTION_SECTIONS - Success
-- Performing Test HAVE_CXX_FDATA_SECTIONS
-- Performing Test HAVE_CXX_FDATA_SECTIONS - Success
-- Performing Test HAVE_C_FDATA_SECTIONS
-- Performing Test HAVE_C_FDATA_SECTIONS - Success
-- Performing Test HAVE_CPU_NEON_SUPPORT (check file: cmake/checks/cpu_neon.cpp)
-- Performing Test HAVE_CPU_NEON_SUPPORT - Success
-- Performing Test HAVE_CPU_FP16_SUPPORT (check file: cmake/checks/cpu_fp16.cpp)
-- Performing Test HAVE_CPU_FP16_SUPPORT - Success
-- Performing Test HAVE_CPU_BASELINE_FLAGS
-- Performing Test HAVE_CPU_BASELINE_FLAGS - Success
-- Performing Test HAVE_CXX_FVISIBILITY_HIDDEN
-- Performing Test HAVE_CXX_FVISIBILITY_HIDDEN - Success
-- Performing Test HAVE_C_FVISIBILITY_HIDDEN
-- Performing Test HAVE_C_FVISIBILITY_HIDDEN - Success
-- Performing Test HAVE_CXX_FVISIBILITY_INLINES_HIDDEN
-- Performing Test HAVE_CXX_FVISIBILITY_INLINES_HIDDEN - Success
-- Performing Test HAVE_C_FVISIBILITY_INLINES_HIDDEN
-- Performing Test HAVE_C_FVISIBILITY_INLINES_HIDDEN - Success
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for posix_memalign
-- Looking for posix_memalign - found
-- Looking for malloc.h
-- Looking for malloc.h - found
-- Looking for memalign
-- Looking for memalign - found
-- Check if the system is big endian
-- Searching 16 bit integer
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of unsigned short
-- Check size of unsigned short - done
-- Searching 16 bit integer - Using unsigned short
-- Check if the system is big endian - little endian
-- Found ZLIB: /usr/lib/libz.so (found suitable version "1.2.11", minimum required is "1.2.3") 
-- Found JPEG: /usr/lib/libjpeg.so (found version "62") 
-- Found TIFF: /usr/lib/libtiff.so (found version "4.1.0") 
-- Found WebP: /usr/lib/libwebp.so  
-- Could NOT find Jasper (missing: JASPER_LIBRARIES JASPER_INCLUDE_DIR) 
-- Performing Test HAVE_C_WNO_IMPLICIT_FUNCTION_DECLARATION
-- Performing Test HAVE_C_WNO_IMPLICIT_FUNCTION_DECLARATION - Success
-- Performing Test HAVE_C_WNO_UNINITIALIZED
-- Performing Test HAVE_C_WNO_UNINITIALIZED - Success
-- Performing Test HAVE_C_WNO_MISSING_PROTOTYPES
-- Performing Test HAVE_C_WNO_MISSING_PROTOTYPES - Success
-- Performing Test HAVE_C_WNO_UNUSED_BUT_SET_PARAMETER
-- Performing Test HAVE_C_WNO_UNUSED_BUT_SET_PARAMETER - Success
-- Performing Test HAVE_C_WNO_MISSING_DECLARATIONS
-- Performing Test HAVE_C_WNO_MISSING_DECLARATIONS - Success
-- Performing Test HAVE_C_WNO_UNUSED
-- Performing Test HAVE_C_WNO_UNUSED - Success
-- Performing Test HAVE_C_WNO_SHADOW
-- Performing Test HAVE_C_WNO_SHADOW - Success
-- Performing Test HAVE_C_WNO_SIGN_COMPARE
-- Performing Test HAVE_C_WNO_SIGN_COMPARE - Success
-- Performing Test HAVE_C_WNO_POINTER_COMPARE
-- Performing Test HAVE_C_WNO_POINTER_COMPARE - Success
-- Performing Test HAVE_C_WNO_ABSOLUTE_VALUE
-- Performing Test HAVE_C_WNO_ABSOLUTE_VALUE - Success
-- Performing Test HAVE_C_WNO_IMPLICIT_FALLTHROUGH
-- Performing Test HAVE_C_WNO_IMPLICIT_FALLTHROUGH - Success
-- Performing Test HAVE_C_WNO_UNUSED_PARAMETER
-- Performing Test HAVE_C_WNO_UNUSED_PARAMETER - Success
-- Performing Test HAVE_C_WNO_STRICT_PROTOTYPES
-- Performing Test HAVE_C_WNO_STRICT_PROTOTYPES - Success
-- Found ZLIB: /usr/lib/libz.so (found version "1.2.11") 
-- Found PNG: /usr/lib/libpng.so (found version "1.6.37") 
-- Looking for /usr/include/libpng/png.h
-- Looking for /usr/include/libpng/png.h - not found
-- Looking for semaphore.h
-- Looking for semaphore.h - found
-- Performing Test HAVE_CXX_WNO_SHADOW
-- Performing Test HAVE_CXX_WNO_SHADOW - Success
-- Performing Test HAVE_CXX_WNO_UNUSED
-- Performing Test HAVE_CXX_WNO_UNUSED - Success
-- Performing Test HAVE_CXX_WNO_SIGN_COMPARE
-- Performing Test HAVE_CXX_WNO_SIGN_COMPARE - Success
-- Performing Test HAVE_CXX_WNO_UNDEF
-- Performing Test HAVE_CXX_WNO_UNDEF - Success
-- Performing Test HAVE_CXX_WNO_MISSING_DECLARATIONS
-- Performing Test HAVE_CXX_WNO_MISSING_DECLARATIONS - Success
-- Performing Test HAVE_CXX_WNO_UNINITIALIZED
-- Performing Test HAVE_CXX_WNO_UNINITIALIZED - Success
-- Performing Test HAVE_CXX_WNO_SWITCH
-- Performing Test HAVE_CXX_WNO_SWITCH - Success
-- Performing Test HAVE_CXX_WNO_PARENTHESES
-- Performing Test HAVE_CXX_WNO_PARENTHESES - Success
-- Performing Test HAVE_CXX_WNO_ARRAY_BOUNDS
-- Performing Test HAVE_CXX_WNO_ARRAY_BOUNDS - Success
-- Performing Test HAVE_CXX_WNO_EXTRA
-- Performing Test HAVE_CXX_WNO_EXTRA - Success
-- Performing Test HAVE_CXX_WNO_DEPRECATED_DECLARATIONS
-- Performing Test HAVE_CXX_WNO_DEPRECATED_DECLARATIONS - Success
-- Performing Test HAVE_CXX_WNO_MISLEADING_INDENTATION
-- Performing Test HAVE_CXX_WNO_MISLEADING_INDENTATION - Success
-- Performing Test HAVE_CXX_WNO_DEPRECATED
-- Performing Test HAVE_CXX_WNO_DEPRECATED - Success
-- Performing Test HAVE_CXX_WNO_SUGGEST_OVERRIDE
-- Performing Test HAVE_CXX_WNO_SUGGEST_OVERRIDE - Success
-- Performing Test HAVE_CXX_WNO_INCONSISTENT_MISSING_OVERRIDE
-- Performing Test HAVE_CXX_WNO_INCONSISTENT_MISSING_OVERRIDE - Failed
-- Performing Test HAVE_CXX_WNO_IMPLICIT_FALLTHROUGH
-- Performing Test HAVE_CXX_WNO_IMPLICIT_FALLTHROUGH - Success
-- Performing Test HAVE_CXX_WNO_TAUTOLOGICAL_COMPARE
-- Performing Test HAVE_CXX_WNO_TAUTOLOGICAL_COMPARE - Success
-- Performing Test HAVE_CXX_WNO_MISSING_PROTOTYPES
-- Performing Test HAVE_CXX_WNO_MISSING_PROTOTYPES - Success
-- Performing Test HAVE_CXX_WNO_REORDER
-- Performing Test HAVE_CXX_WNO_REORDER - Success
-- Performing Test HAVE_CXX_WNO_UNUSED_RESULT
-- Performing Test HAVE_CXX_WNO_UNUSED_RESULT - Success
-- Performing Test HAVE_CXX_WNO_CLASS_MEMACCESS
-- Performing Test HAVE_CXX_WNO_CLASS_MEMACCESS - Success
-- Looking for linux/videodev.h
-- Looking for linux/videodev.h - not found
-- Looking for linux/videodev2.h
-- Looking for linux/videodev2.h - found
-- Looking for sys/videoio.h
-- Looking for sys/videoio.h - not found
-- Can't find ffmpeg - 'pkg-config' utility is missing
-- Could not find OpenBLAS include. Turning OpenBLAS_FOUND off
-- Could not find OpenBLAS lib. Turning OpenBLAS_FOUND off
-- Could NOT find Atlas (missing: Atlas_CBLAS_INCLUDE_DIR Atlas_CLAPACK_INCLUDE_DIR Atlas_CBLAS_LIBRARY Atlas_BLAS_LIBRARY Atlas_LAPACK_LIBRARY) 
-- Looking for sgemm_
-- Looking for sgemm_ - not found
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE  
-- Could NOT find BLAS (missing: BLAS_LIBRARIES) 
-- LAPACK requires BLAS
-- A library with LAPACK API not found. Please specify library location.
-- Performing Test HAVE_CXX_WNO_UNUSED_PARAMETER
-- Performing Test HAVE_CXX_WNO_UNUSED_PARAMETER - Success
-- Performing Test HAVE_CXX_WNO_UNUSED_LOCAL_TYPEDEFS
-- Performing Test HAVE_CXX_WNO_UNUSED_LOCAL_TYPEDEFS - Success
-- Performing Test HAVE_CXX_WNO_SIGN_PROMO
-- Performing Test HAVE_CXX_WNO_SIGN_PROMO - Success
-- Performing Test HAVE_CXX_WNO_TAUTOLOGICAL_UNDEFINED_COMPARE
-- Performing Test HAVE_CXX_WNO_TAUTOLOGICAL_UNDEFINED_COMPARE - Failed
-- Performing Test HAVE_CXX_WNO_IGNORED_QUALIFIERS
-- Performing Test HAVE_CXX_WNO_IGNORED_QUALIFIERS - Success
-- Performing Test HAVE_CXX_WNO_UNUSED_FUNCTION
-- Performing Test HAVE_CXX_WNO_UNUSED_FUNCTION - Success
-- Performing Test HAVE_CXX_WNO_UNUSED_CONST_VARIABLE
-- Performing Test HAVE_CXX_WNO_UNUSED_CONST_VARIABLE - Success
-- Performing Test HAVE_CXX_WNO_SHORTEN_64_TO_32
-- Performing Test HAVE_CXX_WNO_SHORTEN_64_TO_32 - Failed
-- Performing Test HAVE_CXX_WNO_INVALID_OFFSETOF
-- Performing Test HAVE_CXX_WNO_INVALID_OFFSETOF - Success
-- Performing Test HAVE_CXX_WNO_ENUM_COMPARE_SWITCH
-- Performing Test HAVE_CXX_WNO_ENUM_COMPARE_SWITCH - Failed
-- Could NOT find JNI (missing: JAVA_AWT_LIBRARY JAVA_JVM_LIBRARY JAVA_INCLUDE_PATH JAVA_INCLUDE_PATH2 JAVA_AWT_INCLUDE_PATH) 
-- Could NOT find Pylint (missing: PYLINT_EXECUTABLE) 
-- Could NOT find Flake8 (missing: FLAKE8_EXECUTABLE) 
-- VTK is not found. Please set -DVTK_DIR in CMake to VTK build directory, or to VTK install subdirectory with VTKConfig.cmake file
-- Performing Test HAVE_C_WNO_UNUSED_VARIABLE
-- Performing Test HAVE_C_WNO_UNUSED_VARIABLE - Success
-- Performing Test CXX_HAS_MFPU_NEON
-- Performing Test CXX_HAS_MFPU_NEON - Failed
-- Performing Test C_HAS_MFPU_NEON
-- Performing Test C_HAS_MFPU_NEON - Failed
-- Looking for dlerror in dl
-- Looking for dlerror in dl - found
-- Performing Test HAVE_C_WNO_UNDEF
-- Performing Test HAVE_C_WNO_UNDEF - Success
-- OpenCV Python: during development append to PYTHONPATH: /home/petalinux/opencv/opencv/build/python_loader
-- Caffe:   NO
-- Protobuf:   NO
-- Glog:   YES
-- freetype2:   NO
-- harfbuzz:    NO
/usr/h5cc
dir is /usr
/usr/bin/h5cc: line 32: pkg-config: command not found
/usr/bin/h5cc: line 32: /scratch/jenkins-BUILDS-eSDK-2021.1_stable-pipeline-build-190_ZynqMpEvFull/build/tmp/work/cortexa72-cortexa53-xilinx-linux/hdf5/1.8.21-r0/recipe-sysroot-native/usr/bin/aarch64-xilinx-linux/aarch64-xilinx-linux-gcc: No such file or directory
-- HDF5 C compiler wrapper is unable to compile a minimal HDF5 program.
-- Could NOT find HDF5 (missing: HDF5_LIBRARIES HDF5_INCLUDE_DIRS) (found version "")
-- Module opencv_ovis disabled because OGRE3D was not found
-- No preference for use of exported gflags CMake configuration set, and no hints for include/library directories provided. Defaulting to preferring an installed/exported gflags CMake configuration if available.
-- Found installed version of gflags: /usr/lib/cmake/gflags
-- Detected gflags version: 2.2.2
-- Checking SFM deps... TRUE
-- CERES support is disabled. Ceres Solver for reconstruction API is required.
-- Tesseract:   NO
-- Excluding from source files list: <BUILD>/modules/core/test/test_intrin128.sse2.cpp
-- Excluding from source files list: <BUILD>/modules/core/test/test_intrin128.sse3.cpp
-- Excluding from source files list: <BUILD>/modules/core/test/test_intrin128.ssse3.cpp
-- Excluding from source files list: <BUILD>/modules/core/test/test_intrin128.sse4_1.cpp
-- Excluding from source files list: <BUILD>/modules/core/test/test_intrin128.sse4_2.cpp
-- Excluding from source files list: <BUILD>/modules/core/test/test_intrin128.avx.cpp
-- Excluding from source files list: <BUILD>/modules/core/test/test_intrin128.avx2.cpp
-- Excluding from source files list: <BUILD>/modules/core/test/test_intrin128.avx512_skx.cpp
-- Excluding from source files list: <BUILD>/modules/core/test/test_intrin256.avx2.cpp
-- Excluding from source files list: <BUILD>/modules/core/test/test_intrin256.avx512_skx.cpp
-- Excluding from source files list: <BUILD>/modules/core/test/test_intrin512.avx512_skx.cpp
-- Excluding from source files list: modules/imgproc/src/corner.avx.cpp
-- Excluding from source files list: modules/imgproc/src/imgwarp.avx2.cpp
-- Excluding from source files list: modules/imgproc/src/imgwarp.sse4_1.cpp
-- Excluding from source files list: modules/imgproc/src/resize.avx2.cpp
-- Excluding from source files list: modules/imgproc/src/resize.sse4_1.cpp
-- Excluding from source files list: modules/imgproc/src/sumpixels.avx512_skx.cpp
-- Excluding from source files list: <BUILD>/modules/dnn/layers/layers_common.avx.cpp
-- Excluding from source files list: <BUILD>/modules/dnn/layers/layers_common.avx2.cpp
-- Excluding from source files list: <BUILD>/modules/dnn/layers/layers_common.avx512_skx.cpp
-- Excluding from source files list: modules/features2d/src/fast.avx2.cpp
-- Performing Test HAVE_CXX_WNO_OVERLOADED_VIRTUAL
-- Performing Test HAVE_CXX_WNO_OVERLOADED_VIRTUAL - Success
-- Excluding from source files list: modules/objdetect/src/haar.avx.cpp
-- xfeatures2d/boostdesc: Download: boostdesc_bgm.i
-- xfeatures2d/boostdesc: Download: boostdesc_bgm_bi.i
-- xfeatures2d/boostdesc: Download: boostdesc_bgm_hd.i
-- xfeatures2d/boostdesc: Download: boostdesc_binboost_064.i
-- xfeatures2d/boostdesc: Download: boostdesc_binboost_128.i
-- xfeatures2d/boostdesc: Download: boostdesc_binboost_256.i
-- xfeatures2d/boostdesc: Download: boostdesc_lbgm.i
-- xfeatures2d/vgg: Download: vgg_generated_48.i
-- xfeatures2d/vgg: Download: vgg_generated_64.i
-- xfeatures2d/vgg: Download: vgg_generated_80.i
-- xfeatures2d/vgg: Download: vgg_generated_120.i
-- data: Download: face_landmark_model.dat
-- No preference for use of exported gflags CMake configuration set, and no hints for include/library directories provided. Defaulting to preferring an installed/exported gflags CMake configuration if available.
-- Found installed version of gflags: /usr/lib/cmake/gflags
-- Detected gflags version: 2.2.2
-- Checking SFM deps... TRUE
-- CERES support is disabled. Ceres Solver for reconstruction API is required.
-- Performing Test HAVE_CXX_WNO_UNUSED_BUT_SET_VARIABLE
-- Performing Test HAVE_CXX_WNO_UNUSED_BUT_SET_VARIABLE - Success
-- Performing Test HAVE_CXX_WNO_DEPRECATED_COPY
-- Performing Test HAVE_CXX_WNO_DEPRECATED_COPY - Success
-- Performing Test HAVE_CXX_WNO_UNUSED_PRIVATE_FIELD
-- Performing Test HAVE_CXX_WNO_UNUSED_PRIVATE_FIELD - Failed
-- OpenCL samples are skipped: OpenCL SDK is required
-- 
-- General configuration for OpenCV 3.4.9 =====================================
--   Version control:               unknown
-- 
--   Extra modules:
--     Location (extra):            /home/petalinux/opencv/opencv_contrib/modules
--     Version control (extra):     unknown
-- 
--   Platform:
--     Timestamp:                   2022-05-27T11:49:44Z
--     Host:                        Linux 5.10.0-xilinx-v2021.1 aarch64
--     CMake:                       3.18.2
--     CMake generator:             Unix Makefiles
--     CMake build tool:            /usr/bin/gmake
--     Configuration:               RELEASE
-- 
--   CPU/HW features:
--     Baseline:                    NEON FP16
--       required:                  NEON
--       disabled:                  VFPV3
-- 
--   C/C++:
--     Built as dynamic libs?:      YES
--     C++11:                       YES
--     C++ Compiler:                /usr/bin/g++  (ver 10.2.0)
--     C++ flags (Release):         -fsigned-char -ffast-math -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winit-self -Wsuggest-override -Wno-delete-non-virtual-dtor -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections    -fvisibility=hidden -fvisibility-inlines-hidden   -DNDEBUG
--     C++ flags (Debug):           -fsigned-char -ffast-math -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winit-self -Wsuggest-override -Wno-delete-non-virtual-dtor -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections    -fvisibility=hidden -fvisibility-inlines-hidden   -O0 -DDEBUG -D_DEBUG
--     C Compiler:                  /usr/bin/cc
--     C flags (Release):           -fsigned-char -ffast-math -W -Wall -Werror=return-type -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winit-self -Wsuggest-override -Wno-delete-non-virtual-dtor -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections    -fvisibility=hidden -fvisibility-inlines-hidden -O3 -DNDEBUG  -DNDEBUG
--     C flags (Debug):             -fsigned-char -ffast-math -W -Wall -Werror=return-type -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winit-self -Wsuggest-override -Wno-delete-non-virtual-dtor -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections    -fvisibility=hidden -fvisibility-inlines-hidden -g  -O0 -DDEBUG -D_DEBUG
--     Linker flags (Release):      -Wl,--gc-sections  
--     Linker flags (Debug):        -Wl,--gc-sections  
--     ccache:                      NO
--     Precompiled headers:         NO
--     Extra dependencies:          dl m pthread rt
--     3rdparty dependencies:
-- 
--   OpenCV modules:
--     To be built:                 aruco bgsegm bioinspired calib3d ccalib core datasets dnn dnn_objdetect dpm face features2d flann fuzzy hfs highgui img_hash imgcodecs imgproc line_descriptor ml objdetect optflow phase_unwrapping photo plot python3 reg rgbd saliency sfm shape stereo stitching structured_light superres surface_matching text tracking ts video videoio videostab xfeatures2d ximgproc xobjdetect xphoto
--     Disabled:                    world
--     Disabled by dependency:      -
--     Unavailable:                 cnn_3dobj cudaarithm cudabgsegm cudacodec cudafeatures2d cudafilters cudaimgproc cudalegacy cudaobjdetect cudaoptflow cudastereo cudawarping cudev cvv freetype hdf java js matlab ovis python2 viz
--     Applications:                tests perf_tests examples apps
--     Documentation:               NO
--     Non-free algorithms:         NO
-- 
--   GUI: 
--     GTK+:                        NO
--     OpenGL support:              NO
--     VTK support:                 NO
-- 
--   Media I/O: 
--     ZLib:                        /usr/lib/libz.so (ver 1.2.11)
--     JPEG:                        /usr/lib/libjpeg.so (ver 62)
--     WEBP:                        /usr/lib/libwebp.so (ver encoder: 0x020f)
--     PNG:                         /usr/lib/libpng.so (ver 1.6.37)
--     TIFF:                        /usr/lib/libtiff.so (ver 42 / 4.1.0)
--     JPEG 2000:                   build (ver 1.900.1)
--     OpenEXR:                     build (ver 2.3.0)
--     HDR:                         YES
--     SUNRASTER:                   YES
--     PXM:                         YES
-- 
--   Video I/O:
--     DC1394:                      NO
--     FFMPEG:                      NO
--       avcodec:                   NO
--       avformat:                  NO
--       avutil:                    NO
--       swscale:                   NO
--       avresample:                NO
--     GStreamer:                   NO
--     libv4l/libv4l2:              NO
--     v4l/v4l2:                    linux/videodev2.h
-- 
--   Parallel framework:            pthreads
-- 
--   Trace:                         YES (with Intel ITT)
-- 
--   Other third-party libraries:
--     Lapack:                      NO
--     Eigen:                       YES (ver 3.3.7)
--     Custom HAL:                  YES (carotene (ver 0.0.1))
--     Protobuf:                    build (3.5.1)
-- 
--   OpenCL:                        YES (no extra features)
--     Include path:                /home/petalinux/opencv/opencv/3rdparty/include/opencl/1.2
--     Link libraries:              Dynamic load
-- 
--   Python 3:
--     Interpreter:                 /usr/bin/python3.8 (ver 3.8.5)
--     Libraries:                   /usr/lib/x86_64-linux-gnu/libpython3.6m.so (ver 3.8.5)
--     numpy:                       /usr/include/python3.6m/numpy (ver 1.19.1)
--     install path:                lib/python3.8/site-packages/cv2/python-3.8
-- 
--   Python (for build):            /usr/bin/python3.8
-- 
--   Java:                          
--     ant:                         NO
--     JNI:                         NO
--     Java wrappers:               NO
--     Java tests:                  NO
-- 
--   Install to:                    /usr/local
-- -----------------------------------------------------------------
-- 
-- Configuring done
-- Generating done
-- Build files have been written to: /home/petalinux/opencv/opencv/build


  1. 2022年05月28日 04:46 |
  2. KRIA KV260 Vision AI Starter Kit
  3. | トラックバック:0
  4. | コメント:0

memread, memwrite を使用して kv260_median_platform を使用した vadd アプリケーション・プロジェクトの IP にアクセスする

Xilinx の Petalinux イメージの KV260 に gcc をインストールする”で作成した memread を使用して、”メディアン・フィルタを含んだ Vitis アクセラレーション・プラットフォームを作成する9(プラットフォームのテスト2)”でテストしている vadd アプリケーション・プロジェクトの メディアン・フィルタ IP と vadd IP にアクセスしてみよう。

KV260 の Petalinux にログインする。
tools ディレクトリに移動する。 cd tools
ここで、
./memread 0x80020000
を実行すると、結果が出てこないどころか、全部の Linux 実行が止まってしまった。考えてみれば、まだ、ビットストリームをダウンロードしていないので、現在は存在しないアドレスにアクセスして、応答を永遠に待っている状態になっているようだ。
なお、0x80020000 はメディアン・フィルタ IP のベース・アドレスである。

vadd のビルド済みの Vivado 2021.1 のプロジェクトの Address Editor 画面を示す。
kv260_median_platform_80_220517.png

system ブロック・デザインを示す。
kv260_median_platform_79_220517.png

すでにロードされているハードウェアをアンロードして、mvadd をロードする。
sudo xmutil unloadapp
sudo xmutil loadapp mvadd
sudo xmutil listapps

kv260_median_platform_118_220525.png

これでもう一度
./memread 0x80020000
を実行すると 0x00000004 が読めた。
kv260_median_platform_119_220525.png

メディアン・フィルタ IP の AXI4-Lite インターフェースのレジスタ・マップを示す。

// ==============================================================
// Vitis HLS - High-Level Synthesis from C, C++ and OpenCL v2021.2 (64-bit)
// Copyright 1986-2021 Xilinx, Inc. All Rights Reserved.
// ==============================================================
// control
// 0x00 : Control signals
//        bit 0  - ap_start (Read/Write/COH)
//        bit 1  - ap_done (Read/COR)
//        bit 2  - ap_idle (Read)
//        bit 3  - ap_ready (Read/COR)
//        bit 7  - auto_restart (Read/Write)
//        others - reserved
// 0x04 : Global Interrupt Enable Register
//        bit 0  - Global Interrupt Enable (Read/Write)
//        others - reserved
// 0x08 : IP Interrupt Enable Register (Read/Write)
//        bit 0 - enable ap_done interrupt (Read/Write)
//        bit 1 - enable ap_ready interrupt (Read/Write)
//        bit 5 - enable ap_local_deadlock interrupt (Read/Write)
//        others - reserved
// 0x0c : IP Interrupt Status Register (Read/TOW)
//        bit 0 - ap_done (COR/TOW)
//        bit 1 - ap_ready (COR/TOW)
//        bit 5 - ap_local_deadlock (COR/TOW)
//        others - reserved
// 0x10 : Data signal of ap_return
//        bit 31~0 - ap_return[31:0] (Read)
// 0x18 : Data signal of function_r
//        bit 31~0 - function_r[31:0] (Read/Write)
// 0x1c : reserved
// 0x20 : Data signal of row_size
//        bit 31~0 - row_size[31:0] (Read/Write)
// 0x24 : reserved
// 0x28 : Data signal of col_size
//        bit 31~0 - col_size[31:0] (Read/Write)
// 0x2c : reserved
// (SC = Self Clear, COR = Clear on Read, TOW = Toggle on Write, COH = Clear on Handshake)


0x80020000 はメディアン・フィルタのベース・アドレスなので、0x00 : Control signals のレジスタを read している。
つまり、ap_idle のみが 1 になっていることを示している。

次にメディアン・フィルタを Run 状態にしてみよう。(今の所、終わらす当てが無いが。。。)
0x00 : Control signals のレジスタに 1 を書くと Run 状態になる。
sudo ./memwrite 0x80020000 1
./memread 0x80020000

すると、1 が read できた。つまり、ap_start のみが 1 になっている。
kv260_median_platform_120_220526.png

なお、0x80030000 の vadd も memread ができているので、madd をロードすると vadd IP もロードされている。
  1. 2022年05月27日 04:00 |
  2. KRIA KV260 Vision AI Starter Kit
  3. | トラックバック:0
  4. | コメント:0

Xilinx の Petalinux イメージの KV260 に gcc をインストールする

Xilinx の Petalinux イメージの KV260 に dnf で gcc をインストールしてみる。

Xilinx の Petalinux イメージには、Ubuntu などの apt と同様なコマンド dnf がインストールされているので、これでインストールしてみよう。

最初に
sudo dnf install gcc をやってみたのだが、gcc と入力してもコマンドが無かった。

次に、ライブラリのリストを見るために
sudo dnf search gcc
を実行した。
kv260_median_platform_116_220525.png

xilinx-k26-starterkit-2021_1:~/tools/gcc-12.1.0$ sudo dnf search gcc
Password: 
Last metadata expiration check: 1 day, 1:23:21 ago on Mon May 23 11:36:33 2022.
====================================== Name & Summary Matched: gcc =======================================
gcc.cortexa72_cortexa53 : GNU cc and gcc C compilers
gcc-dbg.cortexa72_cortexa53 : GNU cc and gcc C compilers - Debugging files
gcc-dev.cortexa72_cortexa53 : GNU cc and gcc C compilers - Development files
gcc-doc.cortexa72_cortexa53 : GNU cc and gcc C compilers - Documentation files
gcc-lic.cortexa72_cortexa53 : GNU cc and gcc C compilers
gcc-locale-be.cortexa72_cortexa53 : GNU cc and gcc C compilers - be translations
gcc-locale-ca.cortexa72_cortexa53 : GNU cc and gcc C compilers - ca translations
gcc-locale-da.cortexa72_cortexa53 : GNU cc and gcc C compilers - da translations
gcc-locale-de.cortexa72_cortexa53 : GNU cc and gcc C compilers - de translations
gcc-locale-el.cortexa72_cortexa53 : GNU cc and gcc C compilers - el translations
gcc-locale-eo.cortexa72_cortexa53 : GNU cc and gcc C compilers - eo translations
gcc-locale-es.cortexa72_cortexa53 : GNU cc and gcc C compilers - es translations
gcc-locale-fi.cortexa72_cortexa53 : GNU cc and gcc C compilers - fi translations
gcc-locale-fr.cortexa72_cortexa53 : GNU cc and gcc C compilers - fr translations
gcc-locale-hr.cortexa72_cortexa53 : GNU cc and gcc C compilers - hr translations
gcc-locale-id.cortexa72_cortexa53 : GNU cc and gcc C compilers - id translations
gcc-locale-ja.cortexa72_cortexa53 : GNU cc and gcc C compilers - ja translations
gcc-locale-nl.cortexa72_cortexa53 : GNU cc and gcc C compilers - nl translations
gcc-locale-pt-br.cortexa72_cortexa53 : GNU cc and gcc C compilers - pt_BR translations
gcc-locale-ru.cortexa72_cortexa53 : GNU cc and gcc C compilers - ru translations
gcc-locale-sr.cortexa72_cortexa53 : GNU cc and gcc C compilers - sr translations
gcc-locale-sv.cortexa72_cortexa53 : GNU cc and gcc C compilers - sv translations
gcc-locale-tr.cortexa72_cortexa53 : GNU cc and gcc C compilers - tr translations
gcc-locale-uk.cortexa72_cortexa53 : GNU cc and gcc C compilers - uk translations
gcc-locale-vi.cortexa72_cortexa53 : GNU cc and gcc C compilers - vi translations
gcc-locale-zh-cn.cortexa72_cortexa53 : GNU cc and gcc C compilers - zh_CN translations
gcc-locale-zh-tw.cortexa72_cortexa53 : GNU cc and gcc C compilers - zh_TW translations
gcc-plugins.cortexa72_cortexa53 : GNU cc and gcc C compilers
gcc-runtime-dbg.cortexa72_cortexa53 : Runtime libraries from GCC - Debugging files
gcc-runtime-lic.cortexa72_cortexa53 : Runtime libraries from GCC
gcc-sanitizers.cortexa72_cortexa53 : GNU cc and gcc C compilers
gcc-sanitizers-dbg.cortexa72_cortexa53 : GNU cc and gcc C compilers - Debugging files
gcc-sanitizers-lic.cortexa72_cortexa53 : GNU cc and gcc C compilers
gcc-src.cortexa72_cortexa53 : GNU cc and gcc C compilers - Source files
gcc-symlinks.cortexa72_cortexa53 : GNU cc and gcc C compilers
libgcc-s-dbg.cortexa72_cortexa53 : GNU cc and gcc C compilers - Debugging files
libgcc-s-dev.cortexa72_cortexa53 : GNU cc and gcc C compilers - Development files
libgcc-s-lic.cortexa72_cortexa53 : GNU cc and gcc C compilers
libgcc-s-src.cortexa72_cortexa53 : GNU cc and gcc C compilers - Source files
libgcc1.cortexa72_cortexa53 : GNU cc and gcc C compilers
perl-module-extutils-cbuilder-platform-windows-gcc.cortexa72_cortexa53 : perl module
                                                                       : extutils-cbuilder-platform-windows-gcc
========================================== Summary Matched: gcc ==========================================
cpp.cortexa72_cortexa53 : GNU cc and gcc C compilers
cpp-symlinks.cortexa72_cortexa53 : GNU cc and gcc C compilers
g++.cortexa72_cortexa53 : GNU cc and gcc C compilers
g++-symlinks.cortexa72_cortexa53 : GNU cc and gcc C compilers
gcov.cortexa72_cortexa53 : GNU cc and gcc C compilers
gcov-symlinks.cortexa72_cortexa53 : GNU cc and gcc C compilers
libasan-dev.cortexa72_cortexa53 : GNU cc and gcc C compilers
libasan6.cortexa72_cortexa53 : GNU cc and gcc C compilers
liblsan-dev.cortexa72_cortexa53 : GNU cc and gcc C compilers
liblsan0.cortexa72_cortexa53 : GNU cc and gcc C compilers
libtsan-dev.cortexa72_cortexa53 : GNU cc and gcc C compilers
libtsan0.cortexa72_cortexa53 : GNU cc and gcc C compilers
libubsan-dev.cortexa72_cortexa53 : GNU cc and gcc C compilers
libubsan1.cortexa72_cortexa53 : GNU cc and gcc C compilers


これらのライブラリを次々にインストールしていった。
sudo dnf install gcc-dev.cortexa72_cortexa53
sudo dnf install gcc-dev.cortexa72_cortexa53
sudo dnf install gcc-doc.cortexa72_cortexa53
sudo dnf install gcc-lic.cortexa72_cortexa53


後は次のライブラリをインストールした。
gcc-plugins.cortexa72_cortexa53, gcc-runtime-dbg.cortexa72_cortexa53, gcc-runtime-lic.cortexa72_cortexa53, gcc-src.cortexa72_cortexa53, libgcc-s-dev.cortexa72_cortexa53, libgcc1.cortexa72_cortexa53

これでもまだ、gcc コマンドは使えなかったのだが、最後にこれを実行したら gcc が実行できるようになった。
sudo dnf install gcc.cortexa72_cortexa53

どれが効いたのか?良く分からないが、とにかく gcc は使えるようになった。

Ultra96 MIPI拡張ボードに接続したPcam5C の画像をDisplayPort に表示する7(現状確認2)”の memread.c
Ultra96のDisplayPortを使用するためのテスト3(実機テスト)”の memwrite.c を gcc でコンパイルしてみたが成功した。
gcc -o memread memread.c
gcc -o memwrite memwrite.c

kv260_median_platform_117_220525.png
  1. 2022年05月26日 04:00 |
  2. KRIA KV260 Vision AI Starter Kit
  3. | トラックバック:0
  4. | コメント:0

メディアン・フィルタを含んだ Vitis アクセラレーション・プラットフォームを作成する10(UIO を使ったレジスタ設定に失敗)

メディアン・フィルタを含んだ Vitis アクセラレーション・プラットフォームを作成する10(メディアン・フィルタのレジスタにアクセスに失敗)”の続き。

ZYBO (Zynq) 初心者ガイド (16) Linuxから自作IPをUIOで制御する”を参考にさせていただいて、プラットフォームに含まれるメディアン・フィルタや axi_dma を UIO にマップしようとしたが、今回のプラットフォームは Xilinx イメージで作られた SD カードでブートされた Petalinux 上でデバイス・ツリー・オーバーレイでロードされているので、UIO ドライバを有効にすることができていない。

いろいろとトライはしてみた。”ZYBO (Zynq) 初心者ガイド (16) Linuxから自作IPをUIOで制御する”を参考に project-spec/meta-user/recipes-bsp/device-tree/files/system-user.dtsi を編集してみたが、axi_dma_0 と median_axis_RGB24_0 の名前がないと言われてしまった。
kv260_median_platform_112_220523.png
kv260_median_platform_110_220523.png

pl.dtsi を示す。
kv260_median_platform_111_220523.png

system-user.dtsi に書くならば、オーバーレイを使っているので、オーバーレイ番号を書く必要があるようだ。
(”Xilinx Wiki/Linux/Linux Articles Device Tree Tips 9.3 Adding a New Node or Update existing Device-tree Overlay nodes”参照)

次からは /dev/mem を使ってアクセスしてみよう。
  1. 2022年05月24日 03:54 |
  2. Vitis
  3. | トラックバック:0
  4. | コメント:0

メディアン・フィルタを含んだ Vitis アクセラレーション・プラットフォームを作成する10(メディアン・フィルタのレジスタにアクセスに失敗)

メディアン・フィルタを含んだ Vitis アクセラレーション・プラットフォームを作成する9(プラットフォームのテスト2)”の続き。

結論としては、Vitis アクセラレーション・プラットフォームで、プラットフォームに含まれるメディアン・フィルタにアクセスしようとしているが krnl.read_register() では、Vitis で作られたアクセレーション・カーネルのみアクセスすることができて、プラットフォームの IP にはアクセスすることができないようだ。

今までやってきたことは失敗なのだが、プラットフォームに含まれるメディアン・フィルタのレジスタに UIO でアクセスして見ようと思う。
次からは、”ZYBO (Zynq) 初心者ガイド (16) Linuxから自作IPをUIOで制御する”を参考にさせていただいて、プラットフォームに含まれるメディアン・フィルタや axi_dma を UIO にマップしよう。

そういえば、Vitis テンプレートの Native XRT Examples -> Hello World XRT (XRT Native API's) サンプルを使って、そこに、krnl.read_register() を追加してやってみた。
kv260_median_platform_94_220521.png

kv260_median_platform_95_220521.png

これだとダメだった。krnl.read_register() を使用する時は、auto krnl = xrt::kernel() の 4 個目の引数を設定してやる必要があるようだ。

    auto krnl = xrt::kernel(device, uuid, "vadd", xrt::kernel::cu_access_mode::exclusive);
    auto read_offset = krnl.offset(0);
    auto read_data = krnl.read_register(read_offset);
    std::cout << "median_reg00 = " << read_data << "\n";

  1. 2022年05月22日 04:52 |
  2. Vitis
  3. | トラックバック:0
  4. | コメント:0

メディアン・フィルタを含んだ Vitis アクセラレーション・プラットフォームを作成する9(プラットフォームのテスト2)

メディアン・フィルタを含んだ Vitis アクセラレーション・プラットフォームを作成する8(プラットフォームのテスト1)”の続き。

メディアン・フィルタ IP を使用した Vitis アクセラレーション・プラットフォームの kv260_median_platform を作るということで、前回は、vadd アプリケーション・プロジェクトを作成し、ビルドして成功した。そして、Vitis HLS 2021.1 のプロジェクトと Vivado 2021.1 のプロジェクトを見た。今回は、KV260 に転送するファイルを準備して、KV260 にファイルを転送し、KV260 で vadd を動作させた。

KV260 に転送するファイルを準備する
bin ファイルを用意する
system.bit は kv260_median_platform/kv260_median_pkg/vadd_system/Hardware/package.build/package にある。
kv260_median_platform_82_220518.png

system.bit から vadd.bit.bin を作成する。
cd /media/masaaki/Ubuntu_Disk/KRIA_KV260/2021.1/kv260_median_platform/kv260_median_pkg/vadd_system/Hardware/package.build/package
echo 'all:{system.bit}'>bootgen.bif
bootgen -w -arch zynqmp -process_bitstream bin -image bootgen.bif
mv system.bit.bin vadd.bit.bin

kv260_median_platform_83_220518.png
kv260_median_platform_84_220518.png

vadd.dtbo ファイルを用意する
pl.dtsi ファイルを編集して、pl.dtbo ファイルを再度作成する。
pl.dtsi ファイルは kv260_median_platform/device-tree-xlnx ディレクトリにある。
kv260_median_platform_85_220518.png

pl.dtsi を開いて 16 行目の kv260_median_platform.bit.bin を vadd.bit.bin に変更する。
kv260_median_platform_86_220518.png

pl.dtsi を再度コンパイルして、pl.dtbo を作成し、名前を vadd.dtbo に変更した。
cd /media/masaaki/Ubuntu_Disk/KRIA_KV260/2021.1/kv260_median_platform/device-tree-xlnx
dtc -@ -O dtb -o pl.dtbo pl.dtsi
mv pl.dtbo vadd.dtbo

kv260_median_platform_87_220518.png

shell.json ファイルを作成する
kv260_median_platform/kv260_median_pkg/pfm/shell.json を作成した。

{
  "shell_type" : "XRT_FLAT",
  "num_slots": "1"
}


kv260_median_platform_89_220518.png

KV260 にファイルを転送する
KV260 の petalinux のホーム・ディレクトリに kv260_median/vadd ディレクトリを作成した。
以下のファイルを KV260 の ~/kv260_median/vadd ディレクトリに FileZilla で転送した。

kv260_median_platform/device-tree-xlnx/vadd.dtbo
kv260_median_platform/kv260_median_pkg/vadd_system/Hardware/package.build/package/vadd.bit.bin
kv260_median_platform/kv260_median_pkg/pfm/shell.json
kv260_median_platform/kv260_median_pkg/vadd/Hardware/vadd
kv260_median_platform/kv260_median_pkg/vadd_system/Hardware/binary_container_1.xclbin


kv260_median_platform_90_220518.png

/lib/firmware/xilinx/mvadd を作成し、vadd.dtbo vadd.bit.bin shell.json を /lib/firmware/xilinx/mvadd に転送する。
sudo mkdir /lib/firmware/xilinx/mvadd
sudo mv vadd.dtbo vadd.bit.bin shell.json /lib/firmware/xilinx/mvadd
ls -l /lib/firmware/xilinx/mvadd

kv260_median_platform_91_220518.png

すでにロードされているハードウェアをアンロードして、mvadd をロードする。
sudo xmutil listapps
sudo xmutil unloadapp
sudo xmutil loadapp mvadd

kv260_median_platform_92_220518.png

vadd を走らせる
vadd を走らせると”TEST PASSED”が表示されて成功した。。。やった〜。
./vadd binary_container_1.xclbin
kv260_median_platform_93_220518.png
  1. 2022年05月21日 04:00 |
  2. Vitis
  3. | トラックバック:0
  4. | コメント:0

メディアン・フィルタを含んだ Vitis アクセラレーション・プラットフォームを作成する8(プラットフォームのテスト1)

メディアン・フィルタを含んだ Vitis アクセラレーション・プラットフォームを作成する7(プラットフォームの作成2)”の続き。

メディアン・フィルタ IP を使用した Vitis アクセラレーション・プラットフォームの kv260_median_platform を作るということで、前回は、Vitis 2021.1 で kv260_median アクセラレーション・プラットフォームを作成した。今回は、vadd アプリケーション・プロジェクトを作成し、ビルドして成功した。そして、Vitis HLS 2021.1 のプロジェクトと Vivado 2021.1 のプロジェクトを見ていこう。

現在の Vitis 2021.1 の様子を示す。
kv260_median_platform_70_220516.png

vadd アプリケーション・プロジェクトの作成
Vitis 2021.1 で File メニューから New -> Application Project... を選択する。
New Application Project ダイアログの Create a New Application Project 画面が開く。
Next > ボタンをクリックする。

Platform 画面
kv260_custom プラットフォームを選択する。
kv260_median_platform_71_220516.png

Application Project Detail 画面
Application project name に vadd と入力する。
kv260_median_platform_72_220516.png

Domain 画面
sysroot path: に kv260_median_platform/kv260_median_pkg/sysroots/cortexa72-cortexa53-xilinx-linux を指定した。
Root FS: に kv260_median_platform/kv260_median_plnx/images/linux/rootfs.ext4 を指定した。
Kernel Image: に kv260_median_platform/kv260_median_plnx/images/linux/Image を指定した。
kv260_median_platform_73_220516.png

Templates 画面
Vector Addition を選択した。
Finish ボタンをクリックした。
kv260_median_platform_74_220516.png

vadd プロジェクトが生成された。
Hardware でビルドしてみよう。
Active build configuration を Hardware に変更する。
Explorer から vadd_system を選択する。
トンカチ・ボタンをクリックして、ビルドを行う。
kv260_median_platform_75_220516.png

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

Vitis HLS 2021.1 の krnl_vadd プロジェクトを見てみよう。
krnl_vadd プロジェクトは、kv260_median_platform/kv260_median_pkg/vadd_kernels/Hardware/build/krnl_vadd/krnl_vadd/krnl_vadd にあった。
C コードの合成結果を示す。
kv260_median_platform_77_220517.png

次に、Vivado 2021.1 のプロジェクトは、kv260_median_platform/kv260_median_pkg/vadd_system_hw_link/Hardware/binary_container_1.build/link/vivado/vpl/prj にあった。
kv260_median_platform_78_220517.png

system ブロック・デザインを示す。
ちゃんとメディアン・フィルタも実装されている。
kv260_median_platform_79_220517.png

Address Editor を示す。
kv260_median_platform_80_220517.png

Project Summary を示す。
kv260_median_platform_81_220517.png
  1. 2022年05月20日 04:00 |
  2. Vitis
  3. | トラックバック:0
  4. | コメント:0

メディアン・フィルタを含んだ Vitis アクセラレーション・プラットフォームを作成する7(プラットフォームの作成2)

メディアン・フィルタを含んだ Vitis アクセラレーション・プラットフォームを作成する6(プラットフォームの作成1)”の続き。

メディアン・フィルタ IP を使用した Vitis アクセラレーション・プラットフォームの kv260_median_platform を作るということで、前回は、sysroot をインストールし、 boot ディレクトリと sd_dir ディレクトリを用意した。今回は、Vitis 2021.1 で kv260_median アクセラレーション・プラットフォームを作成する。

Vitis 2021.1 を起動した。

Vitis IDE Launcher ダイアログが開いた。
Workspace に kv260_median_platform/kv260_median_pkg を指定して、Launch ボタンをクリックする。
kv260_median_platform_62_220515.png

Vitis IDE が起動した。
File -> New -> Platform Project... を選択する。
New Platform Project ダイアログが開いた。
Create new platform project 画面
Platform project name に kv260_median と入力した。
kv260_median_platform_63_220515.png

platform 画面
XSA file に kv260_median_platform/kv260_median_platform/kv260_median_platform.xsa を指定した。
Operation system に Linux を指定した。
Processor に psu_cortexa53 を指定した。
Architecture に 64-bit を指定した。
Boot Components の Generate boot components のチェックボックスのチェックを外した。
Finish ボタンをクリックした。
kv260_median_platform_64_220516.png

kv260_median プラットフォーム・プロジェクトが生成された。
kv260_median_platform_65_220516.png

kv260_median プラットフォームの psu_cortexa53 → Linux on psu_cortexa53 をクリックする。
以下のように設定する。
Bif Files: Brows... の右横の下向き三角をクリックするとドロップダウンメニューが表示されるので、Generate BIF を選択する。
Boot Components Directory: Brows... ボタンをクリックして、kv260_median_pkg/pfm/boot ディレクトリを選択する。
FAT32 Partition Directory: Brows... ボタンをクリックして、kv260_median_pkg/pfm/sd_dir を選択する。
kv260_median_platform_66_220516.png

トンカチ・ボタンをクリックしてビルドを行った。
kv260_median_platform_67_220516.png

ビルドが終了した。
kv260_median_platform_68_220516.png

kv260_median プラットフォームは export ディレクトリ以下に生成されている。
kv260_median_platform_69_220516.png
  1. 2022年05月19日 04:00 |
  2. Vitis
  3. | トラックバック:0
  4. | コメント:0

メディアン・フィルタを含んだ Vitis アクセラレーション・プラットフォームを作成する6(プラットフォームの作成1)

メディアン・フィルタを含んだ Vitis アクセラレーション・プラットフォームを作成する5(ソフトウェア・コンポーネント編2)”の続き。

メディアン・フィルタ IP を使用した Vitis アクセラレーション・プラットフォームの kv260_median_platform を作るということで、前回は、デバイス・ツリー・オーバーレイを生成した。今回は、sysroot をインストールし、 boot ディレクトリと sd_dir ディレクトリを用意する。

kv260_median_platform ディレクトリの下に kv_median_pkg ディレクトリを新規作成し、その下に pfm ディレクトリを新規作成した。
cd ..
mkdir kv260_median_pkg
cd kv260_median_pkg
mkdir pfm

kv260_median_platform_54_220515.png

sysroot をインストールする。
cd ../kv260_median_plnx/images/linux
./sdk.sh -d /media/masaaki/Ubuntu_Disk/KRIA_KV260/2021.1/kv260_median_platform/kv260_median_pkg

kv260_median_platform_55_220515.png
kv260_median_platform_56_220515.png

kv260_median_platform_57_220515.png

kv260_median_pkg/pfm ディレクトリに boot ディレクトリと sd_dir ディレクトリを新規作成する。
cd ../../kv260_median_pkg/pfm
mkdir boot
mkdir sd_dir

kv260_median_platform_58_220515.png

kv260_median_plnx/imges/linux ディレクトリの以下のファイルを kv260_median_pkg/pfm/boot ディレクトリにコピーする。

zynqmp_fsbl.elf
pmufw.elf
bl31.elf
u-boot-dtb.elf (名前をu-boot.elfに変更する)
system.dtb


kv260_median_platform_59_220515.png

kv260_median_platform_60_220515.png

kv260_median_plnx/imges/linux ディレクトリの以下のファイルを kv260_median_pkg/pfm/sd_dir ディレクトリにコピーする。

boot.scr (u-boot初期化用のスクリプト)
system.dtb (Linuxがシステム・セットアップを理解するために起動中に読み取るデバイス・ツリー・ブロブ)


kv260_median_platform_61_220515.png
  1. 2022年05月18日 03:58 |
  2. Vitis
  3. | トラックバック:0
  4. | コメント:0

メディアン・フィルタを含んだ Vitis アクセラレーション・プラットフォームを作成する5(ソフトウェア・コンポーネント編2)

メディアン・フィルタを含んだ Vitis アクセラレーション・プラットフォームを作成する4(ソフトウェア・コンポーネント編1)”の続き。

メディアン・フィルタ IP を使用した Vitis アクセラレーション・プラットフォームの kv260_median_platform を作るということで、前回は、Petalinux で kv260_median_platform 用の Petalinux をビルドした。今回は、デバイス・ツリー・オーバーレイを生成する。

DTG をインストールする。
cd ..
git clone https://github.com/Xilinx/device-tree-xlnx
cd device-tree-xlnx

kv260_median_platform_45_220515.png

DTG のバージョン 2021.1 をチェックアウトして、xsct を起動する。なお、Vitis の setting64.sh は起動してある。
git checkout xlnx_rel_v2021.1
xsct

kv260_median_platform_46_220515.png

XSA ファイルを読み取って、DTS を生成する。
hsi open_hw_design /media/masaaki/Ubuntu_Disk/KRIA_KV260/2021.1/kv260_median_platform/kv260_median_platform/kv260_median_platform.xsa
hsi set_repo_path /media/masaaki/Ubuntu_Disk/KRIA_KV260/2021.1/kv260_median_platform/device-tree-xlnx
hsi create_sw_design device-tree -os device_tree -proc psu_cortexa53_0
hsi set_property CONFIG.dt_overlay true [hsi::get_os]
hsi set_property CONFIG.dt_zocl true [hsi::get_os]
hsi generate_target -dir /media/masaaki/Ubuntu_Disk/KRIA_KV260/2021.1/kv260_median_platform/device-tree-xlnx
hsi close_hw_design [hsi current_hw_design]
exit

kv260_median_platform_47_220515.png
kv260_median_platform_48_220515.png
kv260_median_platform_49_220515.png

ログを示す。

xsct% hsi generate_target -dir /media/masaaki/Ubuntu_Disk/KRIA_KV260/2021.1/kv260_median_platform/device-tree-xlnx
WARNING: Interrupt pin "mm2s_introut" of IP block: "axi_dma_0" is not connected to any interrupt controller

WARNING: Interrupt pin "s2mm_introut" of IP block: "axi_dma_0" is not connected to any interrupt controller

WARNING: no s_axi_aclk for clockwizard IP block: " clk_wiz_0"

WARNING: Clock pin "s_axi_lite_aclk" of IP block "axi_dma_0" is not connected to any of the pl_clk"

WARNING: no s_axi_aclk for clockwizard IP block: " clk_wiz_0"

WARNING: Clock pin "m_axi_mm2s_aclk" of IP block "axi_dma_0" is not connected to any of the pl_clk"

WARNING: no s_axi_aclk for clockwizard IP block: " clk_wiz_0"

WARNING: Clock pin "m_axi_s2mm_aclk" of IP block "axi_dma_0" is not connected to any of the pl_clk"

WARNING: no s_axi_aclk for clockwizard IP block: " clk_wiz_0"                   

WARNING: Clock pin "s_axi_aclk" of IP block "axi_intc_0" is not connected to any of the pl_clk"

WARNING: Interrupt pin "interrupt" of IP block: "median_axis_RGB24_0" is not connected to any interrupt controller

WARNING: no s_axi_aclk for clockwizard IP block: " clk_wiz_0"

WARNING: Clock pin "ap_clk" of IP block "median_axis_RGB24_0" is not connected to any of the pl_clk"

zocl:true                                                                       
ext_platform:
intr_ctrl_len:1
WARNING: ERROR: axi_dma_0: mm2s_introut port is not connected                   
WARNING: ERROR: axi_dma_0: s2mm_introut port is not connected
hsi::generate_target: Time (s): cpu = 00:00:25 ; elapsed = 00:00:28 . Memory (MB): peak = 2079.957 ; gain = 0.000 ; free physical = 3512 ; free virtual = 36054


pl.dtsi が生成された。
kv260_median_platform_50_220515.png

pl.dtsi には、axi_dma_0 と median_axis_RGB24 のエントリも見えた。
kv260_median_platform_53_220515.png

pl.dtbi をコンパイルして pl.dtbo を生成する。
dtc -@ -O dtb -o pl.dtbo pl.dtsi
kv260_median_platform_51_220515.png

pl.dtbo が生成された。
kv260_median_platform_52_220515.png
  1. 2022年05月17日 04:00 |
  2. Vitis
  3. | トラックバック:0
  4. | コメント:0

メディアン・フィルタを含んだ Vitis アクセラレーション・プラットフォームを作成する4(ソフトウェア・コンポーネント編1)

メディアン・フィルタを含んだ Vitis アクセラレーション・プラットフォームを作成する3(Vivado で kv260_median_platform プロジェクトを作成3)”の続き。

メディアン・フィルタ IP を使用した Vitis アクセラレーション・プラットフォームの kv260_median_platform を作るということで、前回は、Vivado 2021.1 で XSA ファイルを生成して、Vivado パートは終了した。今回は、Petalinux で kv260_median_platform 用の Petalinux をビルドした。

xilinx-k26-starterkit-v2021.1-final.bsp を使用するが、もうすでに””Vitis Custom Embedded Platform Creation Example on KV260”をやってみよう6(Step 2: Create the Software Components その2)”でダウンロード済みなので、それを使用する。

Petalinux 2021.1 の環境を設定した。
source /media/masaaki/Ubuntu_Disk/tools/Xilinx/PetaLinux/2021.1/settings.sh
kv260_median_platform_32_220514.png

ools/Xilinx/PetaLinux/2021.1/components/yocto/source/aarch64 の入れ替えももうすでに””Vitis Custom Embedded Platform Creation Example on KV260”をやってみよう6(Step 2: Create the Software Components その2)”でやってあるので、省略。

Petalinux プロジェクトの作成
cd /media/masaaki/Ubuntu_Disk/KRIA_KV260/2021.1/kv260_median_platform
petalinux-create --type project -s ../../xilinx-k26-starterkit-v2021.1-final.bsp -n kv260_median_plnx
cd kv260_median_plnx
echo 'BOARD_VARIANT = "kv"' >> project-spec/meta-user/conf/petalinuxbsp.conf

kv260_median_platform_33_220514.png

XSA ファイルを使用して petalinux-config する。
petalinux-config --get-hw-description=/media/masaaki/Ubuntu_Disk/KRIA_KV260/2021.1/kv260_median_platform/kv260_median_platform
kv260_median_platform_34_220514.png

petalinux-config 画面
→キーを押して、< Exit > を選択して、Enter キーを押す。
kv260_median_platform_35_220514.png

セーブ画面
< Yes > を選択して Enter キーを押す。
kv260_median_platform_36_220514.png

ターミナルに戻った。
kv260_median_platform_37_220514.png

rootfs の xrt を有効にする。
petalinux-config -c rootfs
kv260_median_platform_38_220514.png

Filesystem packages -> libs -> xrt を有効にする。(スペースキー)
kv260_median_platform_39_220514.png

→キーを押して、< Exit > を選択して、Enter キーを何回か実行し、セーブ画面で< Yes > を選択して Enter キーを押してターミナルに戻った。
kv260_median_platform_40_220514.png

ビルド
petalinux-build
成功した。
kv260_median_platform_41_220514.png
kv260_median_platform_42_220514.png

petalinux-build --sdk
kv260_median_platform_43_220514.png

kv260_median_platform/kv260_median_plnx/images/linux ディレクトリの内容を示す。
kv260_median_platform_44_220514.png
  1. 2022年05月16日 04:00 |
  2. Vitis
  3. | トラックバック:0
  4. | コメント:0

メディアン・フィルタを含んだ Vitis アクセラレーション・プラットフォームを作成する3(Vivado で kv260_median_platform プロジェクトを作成3)

メディアン・フィルタを含んだ Vitis アクセラレーション・プラットフォームを作成する2(Vivado で kv260_median_platform プロジェクトを作成2)”の続き。

メディアン・フィルタ IP を使用した kv260_median_platform プロジェクトを Vivado 2021.1 で作成するということで、前回は、Platform Setup ウインドウの設定を紹介し、エミュレーション設定をして、論理合成、インプリメンテーション、ビットストリームの生成を行って成功した。今回は、ハードウェアをエクスポートして、XSA ファイルを生成した。

File -> Export -> Export Platform を選択した。
Export Hardware Platform ダイアログが開く。
Next > ボタンをクリックする。

Platform Type 画面
Hardware and Hardware Emulation ラジオボタンをクリックした。
Next > ボタンをクリックする。
kv260_median_platform_25_220514.png

Platform State 画面
Pre-synthesis ラジオボタンをクリックする。(デフォルト)
Include bitstream チェックボックスにチェックを入れた。
Next > ボタンをクリックする。
kv260_median_platform_26_220514.png

Platform Properties 画面
Name に kv260_median_platform を入力した。
後はデフォルトのままとする。
Next > ボタンをクリックする。
kv260_median_platform_27_220514.png

Output File 画面
XSA file name に kv260_median_platform と入力した。
Next > ボタンをクリックする。
kv260_median_platform_28_220514.png

Exporting Hardware Platform 画面
Finish ボタンをクリックした。
kv260_median_platform_29_220514.png

現在の kv260_median_platform の様子を示す。
kv260_median_platform_30_220514.png

kv260_median_platform が出力された。
kv260_median_platform_31_220514.png
  1. 2022年05月15日 04:24 |
  2. Vitis
  3. | トラックバック:0
  4. | コメント:0

メディアン・フィルタを含んだ Vitis アクセラレーション・プラットフォームを作成する2(Vivado で kv260_median_platform プロジェクトを作成2)

メディアン・フィルタを含んだ Vitis アクセラレーション・プラットフォームを作成する1(Vivado で kv260_median_platform プロジェクトを作成1)”の続き。

メディアン・フィルタ IP を使用した kv260_median_platform プロジェクトを Vivado 2021.1 で作成するということで、前回は、kv260_median_platform プロジェクトを作成し、system ブロック・デザインを紹介した。今回は、Platform Setup ウインドウの設定を紹介し、エミュレーション設定をして、論理合成、インプリメンテーション、ビットストリームの生成を行って成功した。

Platform Setup ウインドウの AXI Port の設定を紹介する。
zynq_ultra_ps_e_0 の M_AXI_HPM0_FPD と M_AXI_HPM1_FPD をイネーブルする。
Memport は M_AXI_GP で、 SP Tag は空とする。デフォルトのままとする。

zynq_ultra_ps_e_0 の以下の AXI インターフェースをイネーブルする。
S_AXI_HPC1_FPD, S_AXI_HP0_FPD, S_AXI_HP1_FPD, S_AXI_HP2_FPD, S_AXI_HP3_FPD

S_AXI_HPC0_FPD の Memport を S_AXI_HP に変更する。
SP Tag に HPC1, HP0, HP1, HP2, HP3 を入力する。
kv260_median_platform_17_220512.png

ps8_0_axi_periph の M03_AXI から M09_AXI までをイネーブルする。
Memport は M_AXI_GP で、 SP Tag は空とする。デフォルトのままとする。
kv260_median_platform_18_220512.png

Platform Setup ウインドウの Clock の設定を紹介する。
clk_out1, clk_out2, clk_out3 の Enable チェックボックスをクリックする。

IDを
clk_out1 を 0
clk_out2 を 1
clk_out3 を 2 に設定する。

clk_ou2 の Is Default ラジオボタンをクリックして選択する。

Info に”Info: No problem with Clock interface.”が表示されていることを確認する。
kv260_median_platform_19_220512.png

Platform Setup ウインドウの Interrupt の設定を紹介する。
axi_intc_0 の intr のチェックボックスにチェックを入れた。
kv260_median_platform_20_220512.png

Platform Setup ウインドウの Platform Name の設定はデフォルトのままとした。
kv260_median_platform_21_220512.png

エミュレーション設定(オプション)
Diagram ウインドウで zynq_ultra_ps_e_0 をクリックする。
SELECTED_SIM_MODEL を tlm に変更した。
kv260_median_platform_22_220512.png

論理合成、インプリメンテーション、ビットストリームの生成
Vivado 2022.1 の FLow Navigator で PROGRAM AND DEBUG の Generate Bitstream をクリックして論理合成、インプリメンテーション、ビットストリームの生成を行った。

途中で、/axi_intc_0/intr がつながっていないクリティカル・メッセージが出た。
kv260_median_platform_23_220512.png

ビットストリームの生成が成功した。
Project Summary を示す。
kv260_median_platform_24_220512.png
  1. 2022年05月14日 04:51 |
  2. Vitis
  3. | トラックバック:0
  4. | コメント:0

メディアン・フィルタを含んだ Vitis アクセラレーション・プラットフォームを作成する1(Vivado で kv260_median_platform プロジェクトを作成1)

RGB 24 ビット・データ入出力対応のメディアン・フィルタを Vitis HLS 2021.2 で作成する3”のメディアン・フィルタ IP を使用して、kv260_median_platform プロジェクトを Vivado 2021.1 で作成する。

Vivado 2021.1 を立ち上げて、KV260 用の kv260_median_platform プロジェクトを作成した。
作成時にProject Type 画面では、
Do not spcify source at this time Project is an extensible Vitis platform のチェックボックスにチェックを入れた。

Default Part 画面では、
Kria KV260 Vision Starter Kit を選択した。

kv260_median_platform プロジェクトが新規作成された。(なぜか?、ビットストリームの生成まで終了しているが。。。)
kv260_median_platform_8_220512.png

kv260_median_platform プロジェクト内に median_axis_RGB24 ディレクトリを作成し、”RGB 24 ビット・データ入出力対応のメディアン・フィルタを Vitis HLS 2021.2 で作成する3”の solution1/impl/export.zip の中身を median_axis_RGB24 ディレクトリにコピーした。
kv260_median_platform_9_220512.png

IP Catalog のリポジトリに median_axis_RGB24 IP を登録した。

system プロック・デザインを作成した。
基本的には、PYNQ の時の回路を参考にして、メディアン・フィルタを実装している。メディアン・フィルタ回路の動作周波数は 200 MHz となっている。その他は、””Vitis Custom Embedded Platform Creation Example on KV260”をやってみよう3(Step 1: Create the Vivado Hardware Design and Generate XSA その3)”と同じだ。
kv260_median_platform_10_220512.png

各 IP の設定を示す。

Zynq UltraScale+ MPSoC は AXI HPM0 LPDAXI HPC0 FPD を活かしてある。
kv260_median_platform_11_220512.png

AXI Direct Memory Access の 設定を示す。
kv260_median_platform_12_220512.png

axis_dwidth_converter_0 の設定を示す。
Master Interface TDATA Width (bytes) を 3 に設定した。
kv260_median_platform_13_220512.png

axis_dwidth_converter_1 の設定を示す。
Master Interface TDATA Width (bytes) を 4 に設定した。
kv260_median_platform_14_220512.png

Clocking Wizard の設定を示す。
Output Clocks タブをクリックし、
clk_out1 を 100 MHz
clk_out2 を 200 MHz
clk_out3 を 400 MHz に設定した。
Reset Type を Active Low に設定した。
kv260_median_platform_15_220512.png

Address Editor 画面を示す。
kv260_median_platform_16_220512.png
  1. 2022年05月13日 04:18 |
  2. Vitis
  3. | トラックバック:0
  4. | コメント:0

RGB 24 ビット・データ入出力対応のメディアン・フィルタを Vitis HLS 2021.2 で作成する3

RGB 24 ビット・データ入出力対応のメディアン・フィルタを Vitis HLS 2021.2 で作成する2”の続き。

前回から時間が経っているが、前回は、RGB 24 ビット・データ入出力対応のメディアン・フィルタ median_axis_RGB24 の C シミュレーション、C コードの合成、C/RTL 協調シミュレーション、Export RTL、Implementation を行った。前回は、100 MHz 対応の solution1 だったが、200 MHz 対応の solution2 を作成し、C コードの合成、C/RTL 協調シミュレーション、Export RTL、Implementation を行った。

Clock Period を 5 ns に設定して solution2 を作成した。
kv260_median_platform_7_220512.png

kv260_median_platform_1_220512.png

C コードの合成を行った。結果を示す。
kv260_median_platform_2_220512.png
kv260_median_platform_3_220512.png

C/RTL 協調シミュレーションを行った。結果を示す。
kv260_median_platform_4_220512.png

開始間隔(II)は 480057 クロックだった。画像の大きさは 800 ピクセル x 600 行 = 480000 ピクセルなので、スループットは高いと言える。

Export RTL を行った。
median_axis_RGB24/solution2/impl に export.zip が生成された。
kv260_median_platform_5_220512.png

Implementation を行った。
kv260_median_platform_6_220512.png

CP achieved post-implementation は 4.544 ns で大丈夫そうだ。
  1. 2022年05月12日 03:19 |
  2. KRIA KV260 Vision AI Starter Kit
  3. | トラックバック:0
  4. | コメント:0

AXI4-Lite インターフェースの FIFO を作成する2

AXI4-Lite インターフェースの FIFO を作成する1”の続き。

AXI4-Lite インターフェースを AXI4-Stream に変換する axilw2stream IPAXI4-Stream を AXI4-Lite インターフェースに変換する stream2axilr IP を使用し、その間に AXI Stream Data FIFO を挟んで AXI4-Lite インターフェースの FIFO を作成する。

前回は、ZYBO Z7-10 用の axi4l_stream プロジェクトを Vivado 2022.1 で作成し、system ブロック・デザインを作成し、論理合成、インプリメンテーション、ビットストリームの生成を行った。今回は、ハードウェアをエクスポートし、Vitis 2022.1 を立ち上げて、プラットフォームと axi4l_stream アプリケーション・プロジェクトを作成し、ZYBO Z7-10 で実機動作を確認した。

Vivado 2022.1 でハードウェアをエクポートして、system_wrapper.xsa ファイルを生成した。
axil2stream_26_220511.png

Vitis 2022.1 を起動して、system_wrapper.xsa ファイルを元に system_wrapper プラットフォームを作成し、それを参照して axi4l_stream アプリケーション・プロジェクトを作成した。
axi4l_stream.c アプリケーション・ソフトウェアを作成した。
axil2stream_27_220511.png

axi4l_stream.c アプリケーション・ソフトウェアを貼っておく。

// axi4l_stream.c
// 2022/05/09 by marsee
//

#include <stdio.h>
#include <stdint.h>
#include "xaxilw2stream.h"
#include "xstream2axilr.h"
#include "xparameters.h"

void input2fifo(XAxilw2stream *axil2st, uint8_t c){
    while(!XAxilw2stream_IsIdle(axil2st));
    XAxilw2stream_Set_ins(axil2st, (u32)c);
    XAxilw2stream_Start(axil2st);
    while(!XAxilw2stream_IsDone(axil2st));
}

void output2fifo(XStream2axilr *st2axil, uint8_t *fo){
    while(!XStream2axilr_IsIdle(st2axil));
    XStream2axilr_Start(st2axil);
    while(!XStream2axilr_IsDone(st2axil));
    *fo = XStream2axilr_Get_outs(st2axil);
}

int main(){
    uint8_t str[] ="abcdefghijklmnopqrstuvwxyz0123456789\n012345";
    XAxilw2stream axil2st;
    XStream2axilr st2axil;
    uint8_t c, fo;
    volatile uint32_t *axi_gpio0;

    XAxilw2stream_Initialize(&axil2st, XPAR_AXILW2STREAM_0_DEVICE_ID);
    XStream2axilr_Initialize(&st2axil, XPAR_STREAM2AXILR_0_DEVICE_ID);
    axi_gpio0 = (volatile uint32_t *)XPAR_GPIO_0_BASEADDR;

    for(int i=0; i<200; i++){
        c = str[i];
        while(axi_gpio0[0] >> 1) ; // full
        input2fifo(&axil2st, c);
        if(c == NULL)
            break;
    }
    for(int i=0; i<200; i++){
        while(axi_gpio0[0] & 1) ; // empty
        output2fifo(&st2axil, &fo);
        printf("%c", fo);
        fflush(stdout);
        if(fo == '\n')
            break;
    }
    printf("end\n");
    return(0);
}


axi4l_stream アプリケーション・プロジェクトのビルドを行って、成功した。

axi4l_stream アプリケーション・プロジェクトを Run すると、gtk_term に以下の文字列が表示された。
axil2stream_28_220511.png

AXI4-Lite インターフェースの FIFO ができた。
なお、AXI4-Stream Data FIFO の prog_empty のスレッショルドを 5 に設定したが、7 個目のデータが入った時点で 0 になるようだ。
  1. 2022年05月11日 04:35 |
  2. IP
  3. | トラックバック:0
  4. | コメント:0

AXI4-Lite インターフェースの FIFO を作成する1

AXI4-Lite インターフェースを AXI4-Stream に変換する axilw2stream IP AXI4-Stream を AXI4-Lite インターフェースに変換する stream2axilr IP を使用し、その間に AXI Stream Data FIFO を挟んで AXI4-Lite インターフェースの FIFO を作成する。

今回は、ZYBO Z7-10 用の axi4l_stream プロジェクトを Vivado 2022.1 で作成し、system ブロック・デザインを作成し、論理合成、インプリメンテーション、ビットストリームの生成を行った。

ZYBO Z7-10 用の axi4l_stream プロジェクトを Vivado 2022.1 で作成した。
axil2stream_17_220509.png

axi4l_stream プロジェクトのディレクトリに AXI4-Lite インターフェースを AXI4-Stream に変換する axilw2stream IP AXI4-Stream を AXI4-Lite インターフェースに変換する stream2axilr IP のディレクトリを作成して、中に export.zip の中身を入れた。
axil2stream_18_220509.png

IP Catalog で 2 つの IP をリポジトリに追加した。
axil2stream_19_220509.png

Vivado 2022.1 で system ブロック・デザインを作成した。
axil2stream_20_220509.png

ZYNQ7 Processing System の FCLK_CLK0 は 100 MHz に設定されている。
axil2stream_21_220509.png

AXI4-Stream Data FIFO の設定を示す。
FIFO depth を 8192 に設定した。
axil2stream_22_220509.png

Enable programmable full を YES に設定し、Progammable full threshold を 8187 に設定した。
Enable programmable empty を YES に設定し、Progammable empty threshold を 5 に設定した。
axil2stream_23_220509.png

Address Editor を示す。
axil2stream_24_220509.png

論理合成、インプリメンテーション、ビットストリームの生成を行って、成功した。
Project Summary を示す。
axil2stream_25_220509.png
  1. 2022年05月10日 03:42 |
  2. IP
  3. | トラックバック:0
  4. | コメント:0

AXI4-Stream を AXI4-Lite インターフェースに変換する2

AXI4-Stream を AXI4-Lite インターフェースに変換する1”の続き。

前回は、AXI4-Stream を AXI4-Lite インターフェースに変換する stream2axilr IP を作成するということで、ソースコードとテストベンチを貼って、Vits HLS 2022.1 で stream2axilr プロジェクトを作成した。今回は、C シミュレーション、C コードの合成、C/RTL 協調シミュレーション、Exprot RTL、Implementation を行う。

C シミュレーションを行った。結果を示す。
axil2stream_10_220508.png

C コードの合成を行った。結果を示す。
axil2stream_11_220509.png
axil2stream_12_220509.png

Latency が 0 クロックなので、組み合わせ回路のようだ。

C/RTL 協調シミュレーションを行った。
開始間隔は 28 クロックだった。
axil2stream_13_220509.png

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

Export RTL を行った。
solution1/impl ディレクトリに export.zip と ip ディレクトリが生成された。
axil2stream_15_220509.png

Implementation を行った。
タイミング的にも問題ない。
axil2stream_16_220509.png
  1. 2022年05月09日 05:01 |
  2. Vitis HLS
  3. | トラックバック:0
  4. | コメント:0

AXI4-Stream を AXI4-Lite インターフェースに変換する1

前回までは、AXI4-Lite インターフェースを AXI4-Stream に変換する Vitis HLS 2022.1 で作った axilw2Stream IP を作成した。今回は、AXI4-Stream を AXI4-Lite インターフェースに変換する stream2axilr IP を作成する。ソースコードとテストベンチを貼って、Vits HLS 2022.1 で stream2axilr プロジェクトを作成した。

最初にソースコードの stream2axilr.cpp を貼っておく。

// stream2axilr.cpp
// 2022/04/20 by marsee
//

#include <ap_int.h>
#include <hls_stream.h>
#include <ap_axi_sdata.h>

void stream2axilr(hls::stream<ap_uint<8> >& ins, ap_uint<8>& outs){
#pragma HLS INTERFACE mode=s_axilite port=outs
#pragma HLS INTERFACE mode=axis register_mode=both port=ins register
#pragma HLS INTERFACE mode=s_axilite port=return

    outs = ins.read();
}


テストベンチの stream2axilr_tb.cpp を貼っておく。

// stream2axilr_tb.cpp
// 2022/04/20 by marsee
//

#include <stdint.h>
#include <ap_int.h>
#include <hls_stream.h>
#include <ap_axi_sdata.h>

void stream2axilr(hls::stream<ap_uint<8> >& ins, ap_uint<8>& outs);

int main(){
    hls::stream<ap_uint<8> > ins;
    ap_uint<8> outs;
    int errflag = 0;

    for(ap_uint<8> i=0; i<10; i++){
        ins.write(i);
        stream2axilr(ins, outs);
        if(outs != i){
            printf("i = %d, outs = %d\n");
            errflag = 1;
        }
    }

    if(errflag == 0){
        printf("No Error\n");
        return 0;
    } else {
        return 1;
    }
}


Vitis HLS 2022.1 で stream2axilr プロジェクトを作成した。
axil2stream_9_220508.png
  1. 2022年05月08日 11:59 |
  2. Vitis HLS
  3. | トラックバック:0
  4. | コメント:0

AXI4-Lite インターフェースを AXI4-Stream に変換する2

AXI4-Lite インターフェースを AXI4-Stream に変換する1”の続き。

AXI4-Lite インターフェースを AXI4-Stream に変換する IP を Vitis HLS 2022.1 で作成するということで、前回は、ソースコードの axilw2stream.cpp とテストベンチの axilw2stream_tb.cpp を貼って、Vitis HLS 2022.1 の axilw2stream プロジェクトを作成した。今回は、C シミュレーション、C コードの合成、C/RTL 協調シミュレーション、Export RTL、Implementation を行った。

C シミュレーションを行った。結果を示す。
axil2stream_2_220506.png

C コードの合成を行った。結果を示す。
axil2stream_3_220506.png
axil2stream_4_220506.png

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

開始間隔は 31 クロックで、レイテンシは 1 クロックだった。

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

outs_TDATA が 0 から 9 まで出力されているのが分かる。

Export RTL を行った。
axil2stream_7_220506.png

solution1/impl に IP を凍結した export.zip ができている。さらに ip ディレクトリも生成されている。

Implementation を行った。結果を示す。
axil2stream_8_220507.png

問題無さそうだ
  1. 2022年05月07日 04:34 |
  2. Vitis HLS
  3. | トラックバック:0
  4. | コメント:0

AXI4-Lite インターフェースを AXI4-Stream に変換する1

AXI4-Lite インターフェースを AXI4-Stream に変換する IP を Vitis HLS 2022.1 で作成する。

ソースコードは axilw2stream.cpp だ。それを貼っておく。
データ幅は 8 ビットでシリアルデータを扱うためそうなった。

// axilw2stream.cpp
// 2022/04/20 by marsee
//

#include <ap_int.h>
#include <hls_stream.h>
#include <ap_axi_sdata.h>

void axilw2stream(ap_uint<8> ins, hls::stream<ap_uint<8> >& outs){
#pragma HLS INTERFACE mode=axis register_mode=both port=outs register
#pragma HLS INTERFACE mode=s_axilite port=ins
#pragma HLS INTERFACE mode=s_axilite port=return

    outs.write(ins);
}


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

// axilw2stream_tb.cpp
// 2022/04/20 by marsee
//

#include <stdint.h>
#include <ap_int.h>
#include <hls_stream.h>
#include <ap_axi_sdata.h>

void axilw2stream(ap_uint<8> ins, hls::stream<ap_uint<8> >& outs);

int main(){
    hls::stream<ap_uint<8> > outs;
    ap_uint<8> ins, ret;
    int err_flag = 0;

    for(ins=0; ins<10; ins++){
        axilw2stream(ins, outs);
        ret = outs.read();
        if(ret != ins){
            printf("error: i = %d, ret = %d\n");
            err_flag = 1;
        }
    }

    if(err_flag == 0){
        printf("No Error\n");
        return 0;
    } else {
        return 1;
    }
}


Vits HLS 2022.1 で ZYBO Z7-10 用の axilw2stream プロジェクトを作成した。
axil2stream_1_220506.png
  1. 2022年05月06日 05:01 |
  2. Vitis HLS
  3. | トラックバック:0
  4. | コメント:0

Vitis の Native XRT Examples の Hello World XRT をやってみる2

Vitis の Native XRT Examples の Hello World XRT をやってみる1”の続き。

前回は、Vitis に Native XRT Examples があることが分かったので、その内の Hello World XRT をやってみることにしたということで、Vitis 2021.1 で helloworld_xrt プロジェクトを作成し、Hello World XRT (XRT Native API's) を選択してプロジェクトを作成した。そして、ビルドを行って成功した。今回は、bin ファイルを作成し、dtbo ファイルを作成して、ファイルを KV260 に転送し、動作させみたところ成功した。

system.bit から helloworld_xrt.bit.bin を作成する
system.bit は kv260_custom_platform/kv260_custom_pkg/helloworld_xrt_system/Hardware/package.build/package にある。
cd /media/masaaki/Ubuntu_Disk/KRIA_KV260/2021.1/kv260_custom_platform/kv260_custom_pkg/helloworld_xrt_system/Hardware/package.build/package
echo 'all:{system.bit}'>bootgen.bif
bootgen -w -arch zynqmp -process_bitstream bin -image bootgen.bif
mv system.bit.bin helloworld_xrt.bit.bin

xrt_apli_74_220503.png
xrt_apli_75_220503.png

helloworld_xrt.dtbo ファイルを用意する
pl.dtsi ファイルを編集して、pl.dtbo ファイルを再度作成する。
pl.dtsi ファイルは kv260_custom_platform/device-tree-xlnx ディレクトリにある。
pl.dtsi を開いて 16 行目の kv260_custom_platform.bit.bin を helloworld_xrt.bit.bin に変更する。
xrt_apli_76_220503.png

pl.dtsi を再度コンパイルして、pl.dtbo を作成し、名前を helloworld_xrt.dtbo に変更した
cd /media/masaaki/Ubuntu_Disk/KRIA_KV260/2021.1/kv260_custom_platform/device-tree-xlnx
dtc -@ -O dtb -o pl.dtbo pl.dtsi
mv pl.dtbo helloworld_xrt.dtbo

xrt_apli_77_220503.png

KV260 を起動して、helloworld_xrt ディレクトリを作成する
KV260 の Petalinux を起動して、helloworld_xrt ディレクトリを作成した。
ssh 192.168.24 -X -l petalinux
mkdir helloworld_xrt
cd helloworld_xrt

xrt_apli_78_220504.png

KV260 にファイルを転送する
以下のファイルをPYNQ を実行していた KV260 の ubuntu の /helloworld_xrt ディレクトリに FileZilla で転送した。

kv260_custom_platform/device-tree-xlnx/helloworld_xrt.dtbo
kv260_custom_platform/kv260_custom_pkg/helloworld_xrt_system/Hardware/package.build/package/helloworld_xrt.bit.bin
kv260_custom_platform/kv260_custom_pkg/pfm/shell.json
kv260_custom_platform/kv260_custom_pkg/helloworld_xrt/Hardware/helloworld_xrt
kv260_custom_platform/kv260_custom_pkg/helloworld_xrt_system/Hardware/vadd.xclbin


xrt_apli_79_220504.png

ハードウェアのロード
/lib/firmware/xilinx/helloworld_xrt を作成し、helloworld_xrt.dtbo helloworld_xrt.bit.bin shell.json を /lib/firmware/xilinx/helloworld_xrt に転送する。
sudo mkdir /lib/firmware/xilinx/helloworld_xrt
sudo mv helloworld_xrt.dtbo helloworld_xrt.bit.bin shell.json /lib/firmware/xilinx/helloworld_xrt
ls -l /lib/firmware/xilinx/helloworld_xrt

xrt_apli_80_220504.png

すでにロードされているハードウェアをアンロードして、helloworld_xrt をロードする。
sudo xmutil listapps
sudo xmutil unloadapp
sudo xmutil loadapp helloworld_xrt

xrt_apli_81_220504.png

helloworld_xrt を走らせる
./helloworld_xrt -x vadd.xclbin
xrt_apli_82_220504.png

TEST PASSED が表示されて成功した。
  1. 2022年05月05日 03:46 |
  2. Vitis
  3. | トラックバック:0
  4. | コメント:0

Vitis の Native XRT Examples の Hello World XRT をやってみる1

前回まで、”FPGAカーネル超入門 (2)”を参照して、OpenCL コードの代わりに低レベルの XRT コードを使用して、ホスト・アプリケーションを作成していたが、うまく行かなかった。そこで、Vitis に Native XRT Examples があることが分かったので、その内の Hello World XRT をやってみることにした。

Vitis 2021.1 の File メニューから New -> Application Project... を選択する。

New Application Project ダイアログが開く。
Create a New Application Project 画面
Next > ボタンをクリックする。
xrt_apli_66_220503.png

Platform 画面
kv260_custom プラットフォームを選択する。
xrt_apli_67_220503.png

Application Project Details 画面
Application project name: に helloworld_xrt と入力した。
xrt_apli_68_220503.png

Domain 画面
sysroot path: に kv260_custom_platform/kv260_custom_pkg/sysroots/cortexa72-cortexa53-xilinx-linux を指定した。
Root FS: に kv260_custom_platform/kv260_custom_plnx/images/linux/rootfs.ext4 を指定した。
Kernel Image: に kv260_custom_platform/kv260_custom_plnx/images/linux/Image を指定した。
xrt_apli_69_220503.png

Templates 画面
下の Vitis IDE Examples... ボタンと Vitis IDE Libraries... ボタンをクリックして、Examples をゲットすることができた。
Native XRT Examples を展開して、Hello World XRT (XRT Native API's) を選択する。
Finish ボタンをクリックする。
xrt_apli_70_220503.png

helloworld_xrt プロジェクトが生成された。
xrt_apli_71_220503.png

helloworld_xrt.prj を表示して、Active build configuration: を Hardware に変更した。
Explorer から helloworld_xrt_system をクリックし、トンカチ・ボタンをクリックして、ビルドを行った。
xrt_apli_72_220503.png

helloworld_xrt プロジェクトのビルドが成功した。
xrt_apli_73_220503.png
  1. 2022年05月03日 05:00 |
  2. Vitis
  3. | トラックバック:0
  4. | コメント:0

XRT でアクセラレーション・カーネルのホスト・アプリケーションを書いてみよう7

XRT でアクセラレーション・カーネルのホスト・アプリケーションを書いてみよう6”の続き。

FPGAカーネル超入門 (2)”を参照して、OpenCL コードの代わりに低レベルの XRT コードを使用して、ホスト・アプリケーションを作成してみようということで、前回は、ikwzm さんのの助けがあり、vadd_xrt.c のソースコードの xclbin ファイルの名前を修正してもう一度やってみたところ、今度は、xclOpenContext で Invalid argument になってしまった。今回は、xclOpenContext の CU の数は 1 の様なので、CU の数を 3 から 1 に変更してやってみたところ data different !! (0) だった。

まずは、 vadd_xrt.c の 109 行目の i を 1 回しか回らないように、1 に変更した。
xrt_apli_61_220501.png

211 行目の cu_mask を 0x1 に変更した。
xrt_apli_63_220501.png

system.bit から vadd_xrt.bit.bin を作成する
system.bit は kv260_custom_platform/kv260_custom_pkg/square_system/Hardware/package.build/package にある。
cd /media/masaaki/Ubuntu_Disk/KRIA_KV260/2021.1/kv260_custom_platform/kv260_custom_pkg/vadd_xrt_system/Hardware/package.build/package
echo 'all:{system.bit}'>bootgen.bif
bootgen -w -arch zynqmp -process_bitstream bin -image bootgen.bif
mv system.bit.bin vadd_xrt.bit.bin

xrt_apli_50_220430.png
xrt_apli_51_220430.png

vadd_xrt.dtbo ファイルを用意する
pl.dtsi ファイルを編集して、pl.dtbo ファイルを再度作成する。
pl.dtsi ファイルは kv260_custom_platform/device-tree-xlnx ディレクトリにある。
pl.dtsi を開いて 16 行目の kv260_custom_platform.bit.bin を vadd_xrt.bit.bin に変更する。
xrt_apli_52_220430.png

pl.dtsi を再度コンパイルして、pl.dtbo を作成し、名前を vadd_xrt.dtbo に変更した
cd /media/masaaki/Ubuntu_Disk/KRIA_KV260/2021.1/kv260_custom_platform/device-tree-xlnx
dtc -@ -O dtb -o pl.dtbo pl.dtsi
mv pl.dtbo vadd_xrt.dtbo

xrt_apli_53_220430.png

KV260 を起動して、vadd_xrt ディレクトリを作成する
KV260 の Petalinux を起動して、vadd_xrt ディレクトリを作成した。
ssh 192.168.24 -X -l petalinux
mkdir vadd_xrt
cd vadd_xrt

xrt_apli_54_220430.png

KV260 にファイルを転送する
以下のファイルをPYNQ を実行していた KV260 の ubuntu のホーム・ディレクトリに FileZilla で転送した。

kv260_custom_platform/device-tree-xlnx/vadd_xrt.dtbo
kv260_custom_platform/kv260_custom_pkg/vadd_xrt_system/Hardware/package.build/package/vadd_xrt.bit.bin
kv260_custom_platform/kv260_custom_pkg/pfm/shell.json
kv260_custom_platform/kv260_custom_pkg/vadd_xrt/Hardware/vadd_xrt
kv260_custom_platform/kv260_custom_pkg/vadd_xrt_system/Hardware/binary_container_1.xclbin


xrt_apli_55_220430.png

ハードウェアのロード
/lib/firmware/xilinx/vadd_xrt を作成し、vadd_xrt.dtbo vadd_xrt.bit.bin shell.json を /lib/firmware/xilinx/vadd_xrt に転送する。
sudo mkdir /lib/firmware/xilinx/vadd_xrt
sudo mv vadd_xrt.dtbo vadd_xrt.bit.bin shell.json /lib/firmware/xilinx/vadd_xrt
ls -l /lib/firmware/xilinx/vadd_xrt

xrt_apli_56_220430.png

すでにロードされているハードウェアをアンロードして、vadd_xrt をロードする。
sudo xmutil listapps
sudo xmutil unloadapp
sudo xmutil loadapp vadd_xrt

xrt_apli_57_220430.png

vadd_xrt を走らせる
./vadd_xrt binary_container_1.xclbin
xrt_apli_64_220501.png
xrt_apli_65_220501.png

data different !! (0) だった。動作していないのだろうか?

どうもうまく行かない。
次からは、Vitis のアクセラレーション・プラットフォーム・プロジェクトを作成する際の Templates に XRT ベースの example を見つけたので、それをやってみたい。
  1. 2022年05月02日 04:51 |
  2. Vitis
  3. | トラックバック:0
  4. | コメント:0

XRT でアクセラレーション・カーネルのホスト・アプリケーションを書いてみよう6

XRT でアクセラレーション・カーネルのホスト・アプリケーションを書いてみよう5”の続き。

FPGAカーネル超入門 (2)”を参照して、OpenCL コードの代わりに低レベルの XRT コードを使用して、ホスト・アプリケーションを作成してみようということで、前回は、、vadd_xrt.bit.bin と vadd_xrt.dtbo を作成し、ファイルを KV260 に SFTP でアップデートし、動作を確認したところ、xclOpen でエラーが発生した。今回は、ikwzm さんのの助けがあり、vadd_xrt.c のソースコードの xclbin ファイルの名前を修正してもう一度やってみたところ、今度は、xclOpenContext で Invalid argument になってしまった。

Vitis 2021.1 で vadd_xrt.c の XCLBIN 定義を修正した。ikzwm さん、ありがとうございました。

#define XCLBIN "./binary_container_1.xclbin"


xrt_apli_59_220501.png

system.bit から vadd_xrt.bit.bin を作成する
system.bit は kv260_custom_platform/kv260_custom_pkg/square_system/Hardware/package.build/package にある。
cd /media/masaaki/Ubuntu_Disk/KRIA_KV260/2021.1/kv260_custom_platform/kv260_custom_pkg/vadd_xrt_system/Hardware/package.build/package
echo 'all:{system.bit}'>bootgen.bif
bootgen -w -arch zynqmp -process_bitstream bin -image bootgen.bif
mv system.bit.bin vadd_xrt.bit.bin

xrt_apli_50_220430.png
xrt_apli_51_220430.png

vadd_xrt.dtbo ファイルを用意する
pl.dtsi ファイルを編集して、pl.dtbo ファイルを再度作成する。
pl.dtsi ファイルは kv260_custom_platform/device-tree-xlnx ディレクトリにある。
pl.dtsi を開いて 16 行目の kv260_custom_platform.bit.bin を vadd_xrt.bit.bin に変更する。
xrt_apli_52_220430.png

pl.dtsi を再度コンパイルして、pl.dtbo を作成し、名前を vadd_xrt.dtbo に変更した
cd /media/masaaki/Ubuntu_Disk/KRIA_KV260/2021.1/kv260_custom_platform/device-tree-xlnx
dtc -@ -O dtb -o pl.dtbo pl.dtsi
mv pl.dtbo vadd_xrt.dtbo

xrt_apli_53_220430.png

KV260 を起動して、vadd_xrt ディレクトリを作成する
KV260 の Petalinux を起動して、vadd_xrt ディレクトリを作成した。
ssh 192.168.24 -X -l petalinux
mkdir vadd_xrt
cd vadd_xrt

xrt_apli_54_220430.png

KV260 にファイルを転送する
以下のファイルをPYNQ を実行していた KV260 の ubuntu のホーム・ディレクトリに FileZilla で転送した。

kv260_custom_platform/device-tree-xlnx/vadd_xrt.dtbo
kv260_custom_platform/kv260_custom_pkg/vadd_xrt_system/Hardware/package.build/package/vadd_xrt.bit.bin
kv260_custom_platform/kv260_custom_pkg/pfm/shell.json
kv260_custom_platform/kv260_custom_pkg/vadd_xrt/Hardware/vadd_xrt
kv260_custom_platform/kv260_custom_pkg/vadd_xrt_system/Hardware/binary_container_1.xclbin


xrt_apli_55_220430.png

ハードウェアのロード
/lib/firmware/xilinx/vadd_xrt を作成し、vadd_xrt.dtbo vadd_xrt.bit.bin shell.json を /lib/firmware/xilinx/vadd_xrt に転送する。
sudo mkdir /lib/firmware/xilinx/vadd_xrt
sudo mv vadd_xrt.dtbo vadd_xrt.bit.bin shell.json /lib/firmware/xilinx/vadd_xrt
ls -l /lib/firmware/xilinx/vadd_xrt

xrt_apli_56_220430.png

すでにロードされているハードウェアをアンロードして、vadd_xrt をロードする。
sudo xmutil listapps
sudo xmutil unloadapp
sudo xmutil loadapp vadd_xrt

xrt_apli_57_220430.png

vadd_xrt を走らせる
./vadd_xrt binary_container_1.xclbin
xrt_apli_60_220501.png

たぶん xclOpenContext 1 で

xclOpenContext: Invalid argument

になってしまった。
  1. 2022年05月01日 07:20 |
  2. Vitis
  3. | トラックバック:0
  4. | コメント:0