DSP Development Documentation

DSP Introduction

The Horizon J6 computing platform contains two DSP cores clocked at 1GHz and uses the Cadence's Tensilica Vision Q8 DSP IP.

The Vision Q8 DSP is dedicated to supporting algorithms such as computer vision or image processing, the Very Long Instruction Word (VLIW) and Single Instruction Multiple Data Stream (SIMD) can greatly increase the speed of computation. Vision Q8 DSP adopts 5-way VLIW architecture. Each instruction can contain two 64-byte loads or one 64-byte load and one 64-byte store at most. SIMD supports 1024bit operations, such as 128-way 8-bit integer, 64-way 16-bit integer, etc. For more information about the Vision Q8 DSP, see Cadence's Vision Q8 User Guide.

DSP boasts powerful computing power, and when used properly, deploying some computations that cannot be accelerated with BPU and are inefficient with ARM to DSP can greatly improve the inference performance of the model.

Linux Development Environment Installation

Development Tool Introduction

Xtensa Xplorer is an integrated development environment provided by Cadence for customers to develop software for their DSPs, which provides such functions as software development, compilation, debugging, simulation, profiling, hardware trace, etc. This section introduces only the installation of the Linux development environment. The installation and use of the Windows development environment can be found in the official documentation provided by Cadence.

Install DSP Toolchain and Configure Core [dsp_install_config]

You can get the DSP development package from Horizon Robotics, which contains the Xplorer-9.0.17-linux-x64-installer.bin and the Vision_Q8_linux.tgz installer.

  1. Install Xtensa Develop Tools

By default, install Xtensa Develop Tools in the /opt/xtensa directory, but you can specify another directory as required. If you install it in the /opt/xtensa directory, a root permission is required. Execute the following command:

chmod 777 Xplorer-9.0.17-linux-x64-installer.bin ./Xplorer-9.0.17-linux-x64-installer.bin \ --mode unattended \ --prefix /opt/xtensa
  1. Install Vision Q8 Core Configuration

Unzip and extract the Vision_Q8_linux.tgz installation package, put it in the specified location under the Xtensa Develop Tools installation directory (e.g., /opt/xtensa/XtDevTools/install/builds/RI-2021.7-linux/ ), and then install it. You need to execute the following command:

tar -zxvf vdsp_builds/Vision_Q8_linux.tgz \ && mv RI-2021.7-linux/Vision_Q8/ /opt/xtensa/XtDevTools/install/builds/RI-2021.7-linux/ \ && rm -rf RI-2021.7-linux /opt/xtensa/XtDevTools/install/builds/RI-2021.7-linux/Vision_Q8/install \ --xtensa-tools /opt/xtensa/XtDevTools/install/tools/RI-2021.7-linux/XtensaTools/
  1. Configure environment variables

In order to ensure that Xtensa Develop Tools can be used properly, you need to set the following environment variables:

# set license server export LM_LICENSE_FILE=port@serverip # set default core export XTENSA_CORE=Vision_Q8 export XTENSA_ROOT=/opt/xtensa/XtDevTools/install/tools/RI-2021.7-linux/XtensaTools/ export PATH=$PATH:$XTENSA_ROOT/bin
Note

The license should be set correctly before you use Xtensa Develop Tools, please contact your Horizon project contact person for application and configuration.

  1. Xtensa Develop Tools testing

Execute the following two commands. If these two commands can be executed normally, the linux development environment is successfully installed.

xt-clang --help # cross compiler xt-run --help # simluator

DSP Development Reference Materials

For better DSP development, we recommend that you refer to the following documents. After the compiler has been installed successfully, the following documents can be found in the paths XtDevTools/downloads/RI-2021.7/docs and XtDevTools/install/builds/RI- Found under 2021.7-linux/Vision_Q8/html/ISA:

NO.Document Name and DescriptionDocument Catalog
1Vision Q8 DSP introduction documentvisionq8_ug.pdf
2Dev Toolkit introduction documentsw_dev_toolkit_ug.pdf
3Compiler introduction documentxtensa_xt_clang_compiler_ug.pdf
4Xi Library document, located in the XI_Library_7.14.2.xws project Doc directoryXI_Library_UserGuide.pdf
5Profiler documentgun_profiler_ug.pdf
6Vision Q8 DSP instructionNewISAhtml/index.html