This is a guide for compiling a program for TinyQV, and testing it in cocotb or on FPGA.
- Get the TinyQV toolchain (a slightly modified version of the standard Risc-V GNU toolchain).
- Extract to
/opt/tinyQV, or set theRISCV_TOOLCHAINenvironment variable to where you have extracted it. - Clone the tinyQV-sdk, and checkout the
ttsky25abranch.
- Create a new directory for the project
- Copy the files from
tinyQV-sdk/example-project-siminto your project directory - Set your project name in the Makefile
Write your program. The main.c contains a simple example, using the WS2812b peripheral, which shows how to access your registers.
make your program and copy the .hex file to the test directory in this repo.
Create a cocotb test script named after the program, e.g. test_example.py for a program called example.hex. The included test_example.py works with the SDK example.
Run with
PROG=<program name> make -B -f test_prog.mk
You will first need to setup the project in fpga/generic to work correctly with your FPGA. See the README for details.
make your program and copy the .hex file to the fpga/generic directory.
Make the bitstream with
PROG=<program name> make