Run

That was easy wasn’t it? Let us run an example application with the environment you have prepared so far. Well, I see that you are excited. Get on with it!

Check our sample applications

If you have already built the hardware, then a sample application can be loaded and run on the FPGA. You can use one of the sample applications, found in rocket-soc/rocket_soc/lib/templates/ directory. You could also use them as a template for your own code. Inside the templates directory you will find a basic-application, that is rather simple and can be used to make sure your environment works properly. It runs an echo service on the UART, repeating whatever was written to the console, up to 32 characters.

UART flash tool:

This section explains a tool we use in downloading programs to the Rocket SoC to work on PACO. If you are not interested in the details, jump to the next section to use the tool directly. The script riscv-uart-flash handles all communication with the Rocket SoC via its UART port. Its primary use is to reset the CPU, causing the builtin bootloader to execute. After resetting has completed, a command-line-specified program is loaded into the SoC’s memory and then executed. For convenience, the tool enters an interactive shell communicating with the UART after the program was started. Henceforth all communication coming in from the SoC are displayed in blue while inputs made via the terminal (and sent to the UART after each newline) are displayed in white. You can get the tool to load the program using this command:

$ riscv-uart-flash -i prog.elf -w

The command line option ”-w” will tell the riscv-uart-flash tool to run until it receives a terminate signal from your program running on the FPGA. Option -i indicates an interactive shell is to be run after the program is loaded. Without it, the tool would simply exit and no UART communication would be displayed.

Load and run the basic application

Now go to rocket-soc/rocket_soc/lib/templates/basic-application and run:

$ riscv-uart-flash -i main -w

If you have done everything successfully so far, the UART flash tool should start and wait for your input. Print any message and hit enter. If the message echoes back, congrats! you are running an application on PACO.

There is no guide for uninstallation. Sorry, you are stuck in the world of PACO forever! Now that you are anyways here to stay, learn to create your own simple application. Maybe you would be inspired to contribute to PACO someday!