FPGA based system on chip with audio and video.
- RISC-V CPU (RV32IM)
- UART (230400-N-8-1)
- SD Card
- SDRAM (32MB, ULX3S and MMM only)
- Set associative cache (4-way with random replacement policy)
- XGA (ULX3S and MMM only):
- Xosera (audio and video, 128kB VRAM)
- PS/2 Keyboard and Mouse (ULX3S and MMM only)
- Flash Memory (ULX3S and MMM only)
- USB Gamepad (ULX3S and MMM only)
- OSS CAD Suite (https://github.com/YosysHQ/oss-cad-suite-build)
- RISC-V GNU compiler toolchain for RV32IM (https://github.com/riscv-collab/riscv-gnu-toolchain)
- Python3 with the following PIP3 packages installed:
pyserial
- SDL2 (for simulation only)
git clone --recurse-submodules https://github.com/danodus/xgsoc.git
cd xgsoc
If the repository has been cloned without the --recurse-submodules
option, do the following:
git submodule update --init
git pull
git submodule update --recursive
Copy the example site.template
file to site.mk
and edit the paths.
cd firmware
make
Notes:
- Only PS/2 keyboard and XGA (video only) devices are currently simulated
- Press F12 to restart the simulation
cd examples/<example name>
make
cd ../../rtl/sim
make run PROGRAM=../../examples/<example name>/program.hex
Suggested example for simulation: lua
Note: PS/2 PMOD on pins 0-3
cd rtl/ulx3s
make prog
cd rtl/mmm
make prog
Note: Pmod SD on PMOD2
cd rtl/icebreaker
make prog
To upload the program to the FPGA platform:
cd examples/<example name>
make run SERIAL=<serial device>
The following examples are available:
Name | Description | Compatibility |
---|---|---|
write_flash | Write bitstream to flash (output on UART) | ULX3S, MMM |
write_sd_image | Write bootable SD card image (see section below) | ULX3S, MMM, IB |
hello | Hello message (output on UART) | ULX3S, MMM, IB |
sinus | Sinus waveform on (output on UART) | ULX3S, MMM, IB |
test_mem | Test 16MB of SDRAM (output on UART) | ULX3S, MMM |
ps2_kbd_test | Test PS/2 keyboard (output on UART) | ULX3S, MMM |
ps2_mouse_test | Test PS/2 mouse (output on UART) | ULX3S, MMM |
sd_card_test | Test SD card (output on UART, card content erased!) | ULX3S, MMM |
bench | Dhrystone benchmark | ULX3S, MMM |
gamepad_test | Test USB gamepad | ULX3S, MMM |
forth | Forth language | SIM, ULX3S, MMM |
lua | Lua language | SIM, ULX3S, MMM |
xosera_test | Video and sound test | SIM, ULX3S, MMM |
cpp_test | C++ test with standard library | SIM, ULX3S, MMM |
- Insert the SD card
- Open a serial terminal
- Start the image writer utility:
cd examples/write_sd_image
make run SERIAL=<serial device>
- Send the data to write:
cd ../examples/<example name>
make write SERIAL=<serial device>
Press a key when completed. The SD card image will automatically be read and executed unless a key is sent via UART during the first seconds of the boot process.