If you downloaded the tutorials as a release archive, you can directly start. If you have cloned the git repository, you instead need to follow the instructions for building the hardware and software as described below. Please also follow the common tutorial setup.
To run the demo you need:
-
quartus_pgm
in yourPATH
, check withwhich quartus_pgm
-
openocd
in yourPATH
andOPENOCD
set, check withopenocd --version echo $OPENOCD
-
or1k-elf-gdb
in yourPATH
, check withor1k-elf-gdb --version
First you need to setup the board, by connecting the USB cable to your computer. If you want to use UART, an extra dongle is needed. Any USB-UART adapter can be used. You need to connect it to the header on the bottom of the board as depicted below.
Once the board is setup, you can download the FPGA bitstream by running
make program
In one terminal execute the following command:
openocd -s ${OPENOCD}/share/openocd/scripts/ -f interface/altera-usb-blaster.cfg -f ../or1k-dev.tcl
From a second terminal you can now run gdb, for example to run the timer example:
or1k-elf-gdb timer.elf
In gdb execute the following steps:
target remote :50001
load
set $npc=0x100
continue
You should see the LEDs counting and UART output once a second.
You can rebuilt the hardware by running:
make build-hw
Some example software is available, that you can (re-)build for the DE0 nano board by running
make build-sw