DSP Development Environment Setup
Developing Ameba DSP applications requires setting up two development environments:
MCU development environment: For building MCU firmware (FreeRTOS), the MCU is responsible for loading and booting the DSP
DSP development environment: For building and debugging DSP algorithm firmware
Note
For the architectural relationship and collaboration mechanism between the two SDKs, please refer to: DSP SDK System Architecture Overview
MCU Development Environment Setup
Even if you only develop DSP applications, you need to set up the MCU development environment. The MCU firmware is responsible for loading the DSP firmware into memory, initializing hardware resources, and ultimately generating the complete flashable firmware. Please choose one of the following methods based on your development preferences:
CLI development environment (recommended): Set up CLI development environment
VS Code development environment: VS Code Plugin User Guide
DSP Development Environment Setup
The DSP development environment is used for building and debugging DSP algorithm firmware, based on Cadence Xtensa Xplorer IDE.
Material Preparation
Xtensa Xplorer IDE Installer
Xplorer is the DSP-specific integrated development environment provided by Cadence, including compiler, debugger, and other tools.
Download the corresponding software package based on your operating system:
Windows: https://cdn.cadence.com/ip/tensilica/Xplorer-9.0.18-windows-installer.exe
Linux: https://cdn.cadence.com/ip/tensilica/Xplorer-9.0.18-linux-x64-installer.bin
Note
Patch files are used to resolve compiler crash issues in very rare cases. They can be obtained through Xplorer GUI updates, or by contacting Realtek.
HiFi5 DSP Configuration Package
Build Configuration is a configuration file that describes all parameters and necessary build components required for Tensilica processor implementation.
The configuration files are located in the configurations directory of the DSP SDK:
HIFI5_PROD_1123_asic_UPG_win32_redist.tgz(Call0 ABI)HIFI5_PROD_1123_asic_wUPG_win32_redist.tgz(Window ABI)
HIFI5_PROD_1123_asic_UPG_linux_redist.tgz(Call0 ABI)HIFI5_PROD_1123_asic_wUPG_linux_redist.tgz(Window ABI)
Note
The two ABIs have different function calling conventions. It is recommended to understand the differences between them before installing the configuration package. For more information, please refer to: ABI Selection Guide
Xtensa Xplorer License
Xplorer IDE requires a valid license to function properly. Contact benz_yu@realsil.com.cn to apply for a temporary license. When applying for a license, the email must include the following information:
MAC address: Used to bind the license to a specific machine
Work unit: Used to confirm application eligibility
School/College (students only): Need to provide proof of student status
Note
One person can only apply for one license
The temporary license is valid for 3 months
Please keep the license file safe and avoid leakage
Installation Method
Please select the corresponding installation guide based on your operating system:
Step 1: Install Xtensa Xplorer IDE
Double-click the installer and follow the prompts to complete the installation. Installation notes:
Record the installation path as it will be needed in subsequent steps. This document uses the default installation path
C:\usrfor Windows environments.When launching the GUI for the first time after installation, you will usually be prompted for software updates. Please make sure to perform the update, as new patches fix issues that may cause compiler crashes.
Step 2: Install HiFi5 DSP Configuration Package
The Build Configuration describes all parameters and compilation components required for the Tensilica processor implementation. Before starting DSP development, you must install the corresponding build configuration.
2.1 Launch Xplorer and Set Workspace
2.2 Open System Overview Panel
By default, the System Overview panel is located in the lower-left corner of the interface and is used to manage build configurations. If the panel is not displayed, you can open it via:
2.3 Install Build Configuration
2.3.1 In the System Overview panel, right-click on Configuration and select New Configuration
2.3.2 In the pop-up window, select the fourth item and click Next
2.3.3 Click Browse to locate the configuration file (located in the
<dsp_sdk>\configurationsdirectory)2.3.4 Click Add Build, then click Finish
Configuration file descriptions:
HIFI5_PROD_1123_asic_UPG_win32_redist.tgz→ Call0 ABI configuration
HIFI5_PROD_1123_asic_wUPG_win32_redist.tgz→ Window ABI configurationThe following diagram uses installing the Call0 ABI configuration as an example. If the entry marked by the red box in the following diagram appears in the System Overview panel, the configuration has been successfully installed:
2.3.5 Repeat the above steps to install the other ABI configuration (installing both is recommended)
2.4 Configure Environment Variables
Add the Xtensa tools bin directory to the system PATH environment variable, otherwise some auxiliary scripts may not be able to locate executable files. The default path for Windows systems is:
C:\usr\xtensa\XtDevTools\install\tools\RI-2021.8-win32\XtensaTools\bin
Step 3: Install License
Xplorer IDE requires a valid license to function properly. There are two types of licenses:
Floating License: Purchased from Cadence, requires configuring the license server address and port
Node-locked License: Applied from Realtek, bound to a specific machine
Steps to install the license:
3.1 In Xplorer, click the menu
3.2 Click Install Software Keys
3.3 Select based on license type:
Click Finish to complete the installation
Note
For how to apply for a Node-locked License, please refer to Xtensa Xplorer License Section.
When installing the DSP development environment on Linux systems, it is recommended to use the sudo command rather than using the root account directly.
Step 1: Install System Dependency Packages
1.1 Install Xplorer Basic Dependencies
sudo apt-get install libxi6 libxtst6 libxrender11.2 Install X11 Forwarding Support (Optional)
If you are installing Xplorer on a Linux server (such as Ubuntu Server 20.04 LTS) but need to display the graphical interface through a local PC (X11 forwarding), it is recommended to install GTK support packages. Although Xplorer supports pure command-line compilation, using the GUI to modify project configurations is more intuitive and convenient.
sudo apt-get install libgtk-3-dev
Step 2: Install Xtensa Xplorer IDE
2.1 Run the Installer
chmod +x Xplorer-9.0.18-linux-x64-installer.bin sudo ./Xplorer-9.0.18-linux-x64-installer.binThe default installation path is
/opt/xtensa. During the installation process, you can choose to install all other components (selectyes).
- 2.2 Install Toolchain Patch: After installation, when you launch Xplorer for the first time, you will usually be prompted for software updates. Please make sure to perform the update, as new patches fix issues that may cause compiler crashes.
If you cannot update through the graphical interface, you can manually install the patch:
Copy the patch package to the xtensa tools path:
sudo cp XtensaTools_RI_2021_8_patch734507_linux.tgz /opt/xtensa/XtDevTools/install/tools/Extract the patch and overwrite the original files:
cd /opt/xtensa/XtDevTools/install/tools/ sudo tar -zxvf XtensaTools_RI_2021_8_patch734507_linux.tgzThe patch package provided by Realtek may not be the latest version. For the latest patches, it is recommended to consult Cadence or download through XPG.
Step 3: Install HiFi5 DSP Configuration Package
3.1 Extract Configuration Files
3.2 Install Window ABI Configuration
cd /opt/xtensa/XtDevTools/install/builds/RI-2021.8-linux/HIFI5_PROD_1123_asic_wUPG sudo ./installDuring installation, you need to enter the Xtensa tools path:
Xtensa Tools path: /opt/xtensa/XtDevTools/install/tools/RI-2021.8-linux/XtensaTools What registry would you like to use? [keep default, press Enter] Do you want to make "HIFI5_PROD_1123_asic_wUPG" the default Xtensa core? [y, press Enter]3.3 Install Call0 ABI Configuration: Use the same process to install the other configuration package:
cd /opt/xtensa/XtDevTools/install/builds/RI-2021.8-linux/HIFI5_PROD_1123_asic_UPG sudo ./install3.4 Register Configuration Files: Copy the configuration parameter files to the registry directory:
cd /opt/xtensa/XtDevTools/install/tools/RI-2021.8-linux/XtensaTools/config sudo cp HIFI5_PROD_1123_asic_UPG-params /opt/xtensa/XtDevTools/XtensaRegistry/RI-2021.8-linux/ sudo cp HIFI5_PROD_1123_asic_wUPG-params /opt/xtensa/XtDevTools/XtensaRegistry/RI-2021.8-linux/3.5 Configure Environment Variables: Add the Xtensa tools bin directory to the system PATH:
echo 'export PATH=$PATH:/opt/xtensa/XtDevTools/install/tools/RI-2021.8-linux/XtensaTools/bin' >> ~/.bashrc source ~/.bashrc
Step 4: Install License
4.1 Configure License Environment Variables
Set the
LM_LICENSE_FILEorXTENSAD_LICENSE_FILEenvironment variable to point to the license file or license server. For Node-locked License: Point to the full path of the license file:export LM_LICENSE_FILE=/path/to/your/license.licFor Floating License: Format is
<port>@<address>:export LM_LICENSE_FILE=port@server_address4.2 Configure Environment Variables: Add the above environment variables to
~/.bashrcor/etc/profile:# Add to ~/.bashrc echo 'export LM_LICENSE_FILE=/path/to/your/license.lic' >> ~/.bashrc # Make environment variables take effect source ~/.bashrcNote
For how to apply for a Node-locked License, please refer to Xtensa Xplorer License Section.
Install Debugging Tools
If you need to use debuggers such as J-Link for DSP online debugging, you need to install the xt-ocd debugging plugin.
The Xtensa On-Chip Debugger Daemon (xt-ocd) is a powerful GDB-based debugging tool. This tool is not installed by default with Xplorer IDE. Xplorer includes a self-extracting executable installer.
Below is a brief installation method for xt-ocd. For more xt-ocd usage guidelines, please refer to Xtensa Documentation.
The recommended installation path for Xplorer is C:\usr\xtensa\XtDevTools\downloads\RI-2021.8\tools\xt-ocd-14.08-windows64-installer,
Due to differences in installation paths and software versions, the actual path and installer name may vary.
The recommended installation path for Xplorer is /opt/xtensa:
cd /opt/xtensa/XtDevTools/downloads/RI-2021.8/tools/
sudo ./xt-ocd-14.08-linux64-installer
xt-ocd will be installed at this path by default:
/opt/Tensilica/xocd-14.08
The Linux J-Link driver is installed by default in the /opt/SEGGER/ path. In the example, the J-Link version is V6.44.
Users need to modify the following command according to the actual J-Link version and path:
ln -s /opt/SEGGER/JLink_V644i/libjlinkarm.so.6 /opt/Tensilica/xocd-14.08/modules/libjlinkarm.so.6
If the libncursesw.so.5 file cannot be found in the system, you can solve it with the following command:
sudo ln -s /lib/x86_64-linux-gnu/libncursesw.so.6 /lib/x86_64-linux-gnu/libncursesw.so.5
Environment Verification
After completing both environment setups, it is recommended to perform the following verification steps to ensure the environment configuration is correct.
1. Verify MCU Development Environment
cd <SDK>/amebalite_gcc_project
python build.py -h
If the help information is displayed, the MCU development environment has been configured correctly.
2. Verify DSP Development Environment
Launch Xplorer IDE, import <dsp_sdk>/project as a workspace, and try to build the project_dsp project.
For detailed build steps, please refer to: DSP Building and Flashing
Common Issues
Xplorer Dependencies and Environment Issues
Problem Description:
The DSP SDK requires Python3 environment support, but users may not want to change the system’s default Python version.
If another version of Xplorer is installed on the system and the bin directory of the other version has been added to the system PATH, when using xt-clang and xt-ar directly (e.g., through Cmake, Makefile, or Python) for compilation and linking instead of through Xplorer, the linking process may encounter registry value errors: the current Xtensa configuration is not properly installed, or the Xtensa tools used are inconsistent with the path specified during configuration installation.
Xplorer can compile the SDK normally, but custom compilation methods (such as using Cmake with third-party libs) encounter the above path inconsistency errors.
Root Cause Analysis:
The DSP SDK’s post-processing depends on Python3, but the user’s system may already have a different default Python version set, causing a runtime environment mismatch.
Multiple Xplorer version bin paths exist in the system PATH, causing different versions of toolchains to be used, leading to path errors during system compilation.
Custom compilation methods may use different PATH settings. If other toolchain version directories are added to the system PATH, the compilation tools cannot correctly identify the required version.
Solutions:
Python issue: Refer to Building DSP Projects , modify the post-build command (right-click ), then specify Python3 in the post-build command.
Users need to carefully manage and adjust the system PATH variable, only adding the required Xtensa tool version path, and clear redundant toolchain paths to prevent path confusion.
Check the PATH setting, for example, confirm in the profile file to ensure there is no interference from other versions. Reopen the Terminal after modification to update the PATH.
auto_build.sh Build Script Issues
Problem Description:
The current
dsp_batch.xmlimports and builds the project_dsp project by default. Users need to modify the build configuration.The default Xplorer IDE path is
/opt/xtensa/Xplorer-9.0.18/xplorer. Users need to modify the IDE path according to the actual installation location.
Solutions:
Modify the
dsp_batch.xmlfile, or use Xplorer batch build to generate the target xml file (refer to Xplorer help documentation ).Update the Xplorer IDE path in
auto_build.shaccording to the actual environment and version to match the actual installation location, ensuring the path configuration is correct.
Linux Project Configuration
Problem Description: Modifying project configuration (such as modifying compilation options, adding/deleting files, etc.) requires using the Xplorer GUI integrated development environment, but Linux Server does not have a GUI.
Root Cause Analysis: For Cadence Xplorer projects, manually modifying project configuration source files is not recommended; using the GUI for modification is more stable and reliable.
Solution: On a Linux server, the Xplorer GUI window can be remotely displayed to the local terminal through the X11 protocol. The method is as follows:
Set the
X11Forwardingflag to yes in the/etc/ssh/sshd_configfile.Execute the following commands:
sudo apt-get install dbus-x11 /opt/xtensa/Xplorer-9.0.18/xplorer
The Xplorer GUI window will pop up on the local computer. If the user’s SSH terminal does not support remote display, MobaXterm can be used. If the server does not support x11 remote display, you can use the manually modifying project files method to add compilation projects.