I am trying to implement a simple mips1 clone in Verilog at the moment, works all fine in simulators but I also want to run it on an actual FPGA.
Basically I would like to send/receive characters to the running CPU via UART, also I would like to read values from buttons/switches on the FPGA. Now I'm wondering what is the best way to interface GPIO pins and UART.
The only idea I could come up with is to just have separate chips running on the FPGA, directly connected to the GPIO pins and to the UART interface. These chips would just read from/write to specific memory locations and do their job based on that data.
I could also imagine that I will need some kind of interrupt controller for this so the CPU could run some snippet of code when a button is pressed. But I can only imagine this to be useful for input from something, not when I want to make an LED light up.
How does a microcontroller or a Raspberry get an LED to light up?