The UPMEM DPU toolchain
Notes before starting
This document expects the reader to know the DPU architecture.
The toolchain purpose
- The UPMEM DPU toolchain is designed to answer the following requirements:
Creating the programs embedded on DPUs
Creating the host application that will drive the DPU programs
Debugging both the host application and the DPU programs
- To this intent, it provides the following tools:
A C compiler to build DPU programs: dpu-upmem-dpurte-clang
A Runtime Library for the DPU programs
A Host Library to create DPU-enabled host applications
A debugger for both host application & DPU programs: dpu-lldb
dpu-upmem-dpurte-clang
dpu-upmem-dpurte-clang is the compiler for the DPU target. It is based on clang 12.0.0 with the added support for the DPU target (which is the default target of dpu-upmem-dpurte-clang).
See the official Clang 10 documentation for any help with the tool.
As the DPU compiler is based on the LLVM compilation toolchain, UPMEM SDK also provides some utility tools from the LLVM compilation toolchain like llvm-objdump, llvm-objcopy, llvm-readelf and some others.
The DPU binaries generated by dpu-upmem-dpurte-clang are standard ELF files, for the DPU architecture.
Limitations
Dynamic libraries are not supported as the DPU does not support IO file operation.
Dynamic allocation on the stack is not supported.
The DPU Runtime Library
The DPU Runtime Library is a set of functions for a DPU program that provides:
MRAM access
Synchronization primitives
Memory allocation
Performance counter
A subset of functions from the standard C library
See sections Programming and DPU Runtime Library for more information.
The Host Library
The Host Library is a set of functions that allows a host application to:
Functions to read and write into the DPU memories
Functions to boot the DPU or to get its status
See sections Programming and Host Library for more information. A C++ API, a Python API and a Java API are also available.
dpu-lldb
UPMEM DPU programs can be debugged through dpu-lldb (based on lldb 12.0.0).
LLDB is a next-generation, high-performance debugger. It is built as a set of reusable components which highly leverage existing libraries in the larger LLVM Project, such as the Clang expression parser and LLVM disassembler.
For GDB users, here is a document to easily find the corresponding LLDB command from a GDB one: GDB to LLDB command map
For more information about dpu-lldb see section Debugging.