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:

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:

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)

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

../_images/apply_for_license_email.png

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:\usr for 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.1.1 Double-click the desktop shortcut Xplorer 9.0.18 to launch Xplorer

2.1.2 Click Browse on the launcher screen to set the Workspace to <dsp_sdk>\project

2.1.3 Click Launch to enter the Xplorer main interface

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: Window > Show View > System Overview

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>\configurations directory)

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 configuration

The 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 Help > Xplorer License Keys

3.2 Click Install Software Keys

3.3 Select based on license type:

  • Floating License: Fill in the server port and IP address in the dialog box

  • Node-locked License: Click the browse button on the right and select the xxx.lic license file

../_images/dsp01_install_license.png
  1. Click Finish to complete the installation

Note

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.

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:

  1. The DSP SDK requires Python3 environment support, but users may not want to change the system’s default Python version.

  2. 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.

  3. 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:

  1. 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.

  2. 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.

  3. 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:

  1. Python issue: Refer to Building DSP Projects , modify the post-build command (right-click Xtensa Xplorer > Tasks > Building your Project > Building multiple projects), then specify Python3 in the post-build command.

  2. 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.

  3. 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:

  1. The current dsp_batch.xml imports and builds the project_dsp project by default. Users need to modify the build configuration.

  2. 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:

  1. Modify the dsp_batch.xml file, or use Xplorer batch build to generate the target xml file (refer to Xplorer help documentation Xtensa Xplorer > Tasks > Building your Project > Building multiple projects).

  2. Update the Xplorer IDE path in auto_build.sh according 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:

  1. Set the X11Forwarding flag to yes in the /etc/ssh/sshd_config file.

  2. 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.