Warning
WIP: This is a work in progress.
DSPLang is a programming language designed for building efficient vector operations targeting architectures with very wide registers. In particular, it is designed to be used with the Hexagon Vector eXtensions (HVX) of the Qualcomm Hexagon platform.
Details about the current implementation can be found here.
- HLHVX dialect: A high-level dialect with the correct type information, suitable as a lowering target from other dialects in the MLIR ecosystem.
- LLHVX dialect: A one-to-one mapping to the HVX LLVM intrinsics, which directly translate to LLVM IR.
Clone the repository.
- Using conda is recommended.
conda env create -f setup/hexagon-env.yaml
,conda activate hexagon
git clone https://github.com/quic/toolchain_for_hexagon
cd toolchain_for_hexagon
git apply ../setup/hexagon-toolchain.patch
./build.sh
- Create a python environment:
python3 -m venv venv
- Activate the environment:
source venv/bin/activate
- Install the required packages:
pip install -r requirements.txt
mkdir build
cd build
cmake -G Ninja -DMLIR_DIR=$PWD/toolchain_for_hexagon/clang+llvm-fork-cross-hexagon-unknown-linux-musl/x86_64-linux-gnu/lib/cmake/mlir -DCMAKE_PREFIX_PATH=$PWD/venv/bin -DLLVM_EXTERNAL_LIT=$PWD/venv/bin/lit ..
ninja
Note: You need to have the Hexagon SDK installed as the examples use functionalities from the SDK for instrumentation. Make sure that the environment variables are set up correctly.
cd examples
make sim EXP=basic IMPL=dsp
to run the DSPLang version of thebasic
example.
Note: Only the QCS8550 SoC (Snapdragon 8 Gen 2) is supported at the moment. Connect the device to your computer and make sure that adb devices -l
shows the device.
cd examples
make device EXP=basic IMPL=dsp
to run the DSPLang version of thebasic
example.