LLVM Support for PRU

Hello,
Khushi Balia here, a second year undergrad from India.
I’ve worked on a project to create a transpiler and I have a keen interest in compilers. This GSOC, I’m hoping to start working on a project for the BeagleBoard organisation which is based on LLVM. I need some guidance regarding it.

About the project:
There is a source to source transpiler GitHub - VedantParanjape/simpPRU: Intuitive language for PRU which compiles down to PRU C. It uses pru-gcc GitHub - dinuxbg/gnupru: GCC and Binutils port for the TI PRU I/O processor to compile to Texas Instrument’s PRU-SS core. The project is to add support in LLVM for this PRU target (am335x) so that we can use clang instead of pru-gcc. The linker scripts, etc can be found at GitHub - dinuxbg/gnuprumcu: Linker scripts and device specs for PRU MCU variants.

Wanted to know would adding a completely new target for PRU will be the right thing to do as PRUs are not a new architecture but some subset of risc.
Link for ISA: https://www.ti.com/lit/ug/spruij2/spruij2.pdf?ts=1680368576682&ref_url=https%253A%252F%252Fwww.google.com%252F

2 Likes

Here are some links for new targets:

Hi Khushi – I manage the proprietary PRU compiler for TI; I find the desire to implement support for PRU based on LLVM intriguing and would like to understand more about the motivation. We weren’t aware many were actually using PRU directly.

Thanks!

-Alan

Hi @evodius96 ,
Currently the simppru language transpiles to C and uses pru-gcc. The major doubt I had was whether a new target is necessary or we can use existing RISC targets in JIT and compile and use ORC for remote procedure calls etc. ?

The project proposal by @Khushi can be found here.

P.S. I am looking to co-mentor this under Beagleboard.org
Also thanks to @tschuett for pointing out the recipe for adding new target codegen.

Thanks!

-Shreyas