VXLIB User Guide
Ubuntu 22.04 Build Instructions for VXLIB
Python3 Setup
  • We auto generate test cases via python scripts packaged in the library
  • Please ensure that you have the following python3 packages installed
    • numpy, scipy, and scikit-learn
Environment Setup
  • Run the executables on EVM using CCS (Code composer studio)
  • Setup needed for the compiler for CGT7x
  • Path setup
    • export PATH=${CGT7X_ROOT}/bin:${PATH}
Build
  • VXLIB utilizes CMake to build, ensure that system has CMake v3.16.0 or higher
  • Build options:
    • SOC=AM62A/j721e/j721s2/j784s4
    • DEVICE=C7504/C7100/C7120
    • TARGET_PLATFORM=PC/""
    • KERNEL_NAME
    • BUILD_TEST=1 OR BUILD_EXAMPLE=1 OR AUTO_TEST=1
    • VXLIB_DEBUGPRINT=1/0
    • VXLIB_TESTPRINT
    • ALL_TEST_CASES=1 OR TEST_CASE=TestCaseID
    • CMAKE_EXPORT_COMPILE_COMMANDS=TRUE
    • CMAKE_BUILD_TYPE=Release/Debug
    • AUTO_TEST=1/0 (builds all test cases and libraries)
  • Example CMake commands
    • To build VXLIB_add for target on J721E and run performance test cases:
      • cmake -B build -DTARGET_PLATFORM="" -DBUILD_TEST="1" -DKERNEL_NAME="VXLIB_add" -DSOC="j721e" \
        -DDEVICE="C7100" -DVXLIB_DEBUGPRINT="0" -DALL_TEST_CASES="1" -DCMAKE_EXPORT_COMPILE_COMMANDS="TRUE" \
        -DCMAKE_BUILD_TYPE="Release"
    • To build VXLIB_absDiff for host emulation on J721E and run example code
      • cmake -B build -DTARGET_PLATFORM="PC" -DBUILD_EXAMPLE="1" -DKERNEL_NAME="VXLIB_absDiff" \
        -DSOC="j721e" -DDEVICE="C7100" -DVXLIB_DEBUGPRINT="0" -DCMAKE_EXPORT_COMPILE_COMMANDS="TRUE" \
        -DCMAKE_BUILD_TYPE="Release"
    • To build VXLIB_addWeight for host emulation on J721E and run test case 2 with debug print statements
      • cmake -B build -DTARGET_PLATFORM="PC" -DBUILD_TEST="1" -DKERNEL_NAME="VXLIB_addWeight" -DSOC="j721e" \
        -DDEVICE="C7100" -DVXLIB_DEBUGPRINT="1" -DTEST_CASE="2" -DCMAKE_EXPORT_COMPILE_COMMANDS="TRUE" \
        -DCMAKE_BUILD_TYPE="Release"
    • To build all tests cases and libraries for release for J721E for target
      • cmake -B build -DTARGET_PLATFORM="" -DAUTO_TEST="1" -DSOC="j721e" -DDEVICE="C7100" \
        -DALL_TEST_CASES="1" -DCMAKE_BUILD_TYPE="Release" -DVXLIB_DEBUGPRINT="0"
    • Then run:
      • cmake --build build -j<num_cores>
  • VXLIB can also be built using the Visual Studio Code's build configuration feature
    • Rename vscode/ to .vscode/
    • In the settings.json, change build parameters as needed
    • "Build" and "Run" buttons can be used to build for target/PC and run for PC
  • Note: If changing build configuration options significantly (e.g. changing between target and host emulation builds), delete build folder before rebuilding
Run
  • To run VXLIB kernels on a PC:
    • bin/Release/test_VXLIB_<kernel_name>_<device>_x86_64
      OR
      bin/Debug/test_VXLIB_<kernel_name>_<device>_x86_64
      • Ex:
        bin/Release/test_VXLIB_and_C7100_x86_64
  • To run VXLIB kernels for target
    • To reproduce numbers given in the datasheet, run the .out program on the EVM in No Boot Mode