A demonstration of how to send an interrupt from the Cyclone V FPGA to the HPS and handle the IRQ in Linux.
Includes Verilog description which triggers interrupt when a switch or push button changes state, as well as Linux kernel sysfs driver and userspace command-line program.
- Go into the fpga directory.
- Open interrupt_example.qpf in quartus.
- Open the soc_system.qsys file in Qsys and generate the system.
- Compile the SOF file and program it onto the FPGA.
- Go into the software/kernel directory and run
make
. - Copy the fpga_uinput.ko file to the SDCard.
- On the HPS, run
echo 1 > /sys/class/fpga-bridge/lwhps2fpga/enable
. - Run
insmod fpga\_uinput.ko
. - Make sure that the file "/sys/bus/platform/drivers/fpga_uinput/fpga_uinput"
- Go into the software/userspace directory and run
make
. - Copy the
readstate
binary to the SD card. - Run the executable on the HPS.
- Start flipping switches and pushing buttons. The program should print out information when an input changes state.