MMALIB User Guide
MMALIB Build Instructions



Build instructions for MMALIB

Setup
  • Requires loki executable for running the binaries on an individual setup or use VLAB.
  • Run the executables on EVM using CCS (Code composer studio)
  • Setup needed the compiler for CGT7x
    • export CGT7X_ROOT=${MMALIB_CGT7X_COMPILER_DIR}
  • Setup needed the compiler for Loki simulator
    • export LOKI_ROOT=${MMALIB_LOKI_EXE_DIR}
  • Setup for HOST EMULATION
    • export C7X_HOST_EMULATION_PATH=${CGT7X_ROOT}/host_emulation
  • Path setup
    • export PATH=${LOKI_ROOT}:${PATH}
    • export PATH=${CGT7X_ROOT}/bin:${PATH}
    • export LD_LIBRARY_PATH=$LOKI_ROOT/lib:${LD_LIBRARY_PATH}
Build
  • Compile the code from the MMALIB_xx_xx_xx_xx folder
  • Compile the libraries for target
    • make -j16 mmalib mmalib_cn common TARGET_BUILD=release
    • the libraries generated will be /out/C71/release
    • make -j16 mmalib mmalib_cn common TARGET_BUILD=debug
    • the libraries generated will be /out/C71/debug
    • libraries build common_C71.lib, mmalib_cn_C71.lib, mmalib_C71.lib
  • Compile the libraries for host
    • make -j16 mmalib mmalib_cn common TARGET_CPU=x86_64 TARGET_SCPU=C71 TARGET_PLATFORM=PC TARGET_BUILD=release
    • libraries build libmmalib_x86_64.a, libmmalib_cn_x86_64.a, libcommon_x86_64.a
  • Compile the individual test for target(loki simulator) for a given component example MMALIB_CNN_convolve_row_ixX_ixX_oxX
    • make -j8 {module folder, example cnn_c7xmma}/{component name, example MMALIB_CNN_convolve_row_ixX_ixX_oxX} TEST_ENV=LOKI TEST_CASE=238 FLAT_MEM=1 PERFORMANCE_TEST=1
  • Compiling files to run on EVM with release or debug build
    • make -j8 {module folder, example cnn_c7xmma}/{module name, example MMALIB_CNN_convolve_row_ixX_ixX_oxX} TEST_ENV=EVM TEST_CASE={13} TARGET_BUILD=release
    • make -j8 {module folder, example cnn_c7xmma}/{module name, example MMALIB_CNN_convolve_row_ixX_ixX_oxX} TEST_ENV=EVM TEST_CASE={13} TARGET_BUILD=debug
  • Compile the individual test for host for a given component example MMALIB_CNN_convolve_row_ixX_ixX_oxX
    • make -j8 cnn_c7xmma/MMALIB_CNN_convolve_row_ixX_ixX_oxX TEST_CASE=248 TARGET_CPU=x86_64 TARGET_SCPU=C71 TARGET_PLATFORM=PC TARGET_BUILD=release
Run
  • Execute a test case on target
    • loki7x out/C71/release/cnn_c7xmma/MMALIB_CNN_convolve_row_ixX_ixX_oxX_C71.out –use_c7x_internal_memory
  • Execute a test case on host
    • ./out/x86_64/release/cnn_c7xmma/MMALIB_CNN_convolve_row_ixX_ixX_oxX_x86_64
  • Executing the test case on EVM is done by loading via JTAG using CCS (Code Composer Studio)