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_hexagoncd toolchain_for_hexagongit 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 buildcd buildcmake -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 examplesmake sim EXP=basic IMPL=dspto run the DSPLang version of thebasicexample.
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 examplesmake device EXP=basic IMPL=dspto run the DSPLang version of thebasicexample.
