Running

We have to make sure we properly source the build settings for our desired core, from the Pulpissimo directory. For example, if we were targeting the RI5CY core:

cd pulpissimo/sw
cd pulp-runtime
source configs/pulpissimo_cv32.sh

If we don’t do this, the build will fail (invalid custom instruction in the assembly).

If running on an FPGA, we should source from the fpga folder. This has some specific removals of start-up code.

Files

Per program

The build outputs a few useful files for us to analyse, within the build directory. One notable inclusion is the trace_core log file, which gives us the assembly output for our program.

The beginning of the program is the boot ROM. The end of this is at the wfi (wait for interrupt) instruction. Where the program counter begins with 0x1c00 denotes a program stored in the L2 cache.

pulptrace

Within the pulp-runtime folder, we can also run included analytics tools inside the scripts folder. The pulptrace program takes a trace file and ELF file (the compiled binary for the program). Best to run it from the build directory for the program we did. This outputs a long list of assembly instructions. Search for the <_start> keyword.

The simulation relies on a specific <exit> function. What it does is it polls a specific register continuously for a specific bit sequence to exit out. This should be a similar process on the FPGA as well.

Custom software

Beyond the standard example files, we can also write drivers for our own hardware. There are two main folders we look at within the pulp-runtime folder: the include and the drivers folders.

The header goes into the include folder and the source code goes into the drivers folder. Within pulpissimo.mk, we also need to specify extra parameters:

PULP_SRCS += drivers/my_ip.c

See also