RISC-V-emulator-AVR

RISC-V emulator (RV32I + M/A/C/B/Zicsr) that runs on vintage 8-bit AVR microcontrollers like the AT90S8535, with SPI RAM, flash and SD-card support.

RISC-V-emulator-AVR

🎉 Recently addedC

RISC-V emulator (RV32I + M/A/C/B/Zicsr) that runs on vintage 8-bit AVR microcontrollers like the AT90S8535, with SPI RAM, flash and SD-card support.

RISC-V-emulator-AVR

I wanted the emulator to run where it has no business running: a vintage AT90S8535 demo board, emulating a 32-bit RISC-V core at about 10 kHz, with more RAM and ROM than the host AVR could ever dream of.

What you wire up

  • One AVR demo board (AT90S8535 or pin-compatible ATmega1284P) with a JTAG header for debugging
  • Four PMOD boards: an APS6404L 8 MiB SPI RAM on J5, a W25Q64 8 MiB SPI flash on J9, a 5 V USB UART on J4, and an ST7735S 128x160 TFT with SD-card on J10
  • PlatformIO firmware with per-MCU environments, including an ACT build with the full extension set

The memory map

The emulated core sees 8 MiB of ROM at 0x20000000 and 8 MiB of RAM at 0x80000000, with direct host-register access at 0x02000000. At power-on the AVR copies `firmware.bin` from the FAT32 SD-card into SPI flash and starts fetching at ROM address 0. A store to the halt region signals pass or fail in ACT mode. The SPI bus, not the core, is the speed limit.