I have been getting a PicoSoc Execute-in-Place (XIP) working as an example to put in my ebook.
Here is a simple XIP PicoSoc repository. I plan to leave this repository as a simple example and develop another repository into a more useful SoC with more peripherals.
This was taken from Luke Valenty's TinyFPGA BX example, updated to use nextpnr.
I left it using arachne-pnr for a while, but that is too frustrating as it takes ages, randomly fails to meet the timing and randomly fails to do the routing at all. Advice to everyone: use nextpnr.
The main problem I had getting this going is that it needs a much longer power-on reset on the Blackice Mx, before the flash chip is usable.
This is a fairly minimal version of the flash memory version of PicoSoc. It has a gpio which consists of one led, and a uart.
It does support interrupts and timers and uses custom Risc-V ops to do that. They are only used from assembly code as the gcc compiler does not support them.
The example program flashes the red user led and puts out a banner message on the uart.
Here is the firmware.c C code, which is executing in-place from address 0x50000 from flash memory:
You will need the latest USB-CDC-issue3 firmware to use the uart.
As the firmware does not support writing the software binary (firmware.bin) to flash memory, you will need ,my writeFlash utility to do that.
Here is the uart output:
____ _ ____ ____
| _ \(_) ___ ___/ ___| ___ / ___|
| |_) | |/ __/ _ \___ \ / _ \| |
| __/| | (_| (_) |__) | (_) | |___
|_| |_|\___\___/____/ \___/ \____|