danodus / xgsoc

FPGA based system on chip with audio and video

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

XGSoC

FPGA based system on chip with audio and video.

Features

  • 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)

Requirements

Getting Started

Clone and Update

Clone

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

Update

git pull
git submodule update --recursive

Build Firmware

Copy the example site.template file to site.mk and edit the paths.

cd firmware
make

Simulation

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

ULX3S

Note: PS/2 PMOD on pins 0-3

cd rtl/ulx3s
make prog

MMM

cd rtl/mmm
make prog

iCEBreaker

Note: Pmod SD on PMOD2

cd rtl/icebreaker
make prog

Examples

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

Write Bootable Image

  • 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.

About

FPGA based system on chip with audio and video

License:MIT License


Languages

Language:Verilog 49.8%Language:SystemVerilog 29.7%Language:C++ 9.0%Language:C 5.6%Language:Makefile 3.7%Language:Python 1.7%Language:Shell 0.3%Language:Assembly 0.3%