

Risc-V pipelined CPU and SoC written in SystemVerilog
- Size
- 68.6 × 99.1 mm
- Copper layers
- 2
- Thickness
- 1.6 mm
- Parts
- 3
- Nets
- 168
- Pads
- 168
- Tracks, vias
- 0, 0
- Routed
- Not yet
- KiCad
- KiCad 6 (file 20211014)
- Created
- 12 Mar 2023
- Updated
- 5 May 2025
Overview
Lcd is an open-source printed circuit board by apistol78, from the apistol78/rv32 repository on GitHub. It is a 2-layer board of 68.6 × 99.1 mm with 3 parts on 168 nets.
It belongs with the fPGA and programmable logic and lEDs and displays boards and the RP2040 and FPGA and CPLD boards of this library.
README
readme.mdMOJO Risc-V CPU and System-on-a-Chip
The MOJO SOC is an educational and fun system for FPGA and "Bare metal" programming experimentations.
It's a RISC-V CPU running at 100 MHz, 32 MiB RAM, audio and 320*200 video resolution.
To make user input easy I've moved USB host functionality to an external PCB using Raspberry Pico as a FPGA <-> HID bridge.
Prerequisites
This project require an install of Traktor to generate required resources. You will also need a RISC-V GCC toolchain compiled and installed at /opt/riscv32/bin on your machine.
How to build
Run build.sh to build host (i.e. Linux) and target products:
./build.shAfter everything has been built you should be able to run the emulators:
./build/linux/ReleaseStatic/Rv32T -elf=./build/rv32/ReleaseStatic/Bootor
./build/linux/ReleaseStatic/Rv32 -elf=./build/rv32/ReleaseStatic/BootCPU
MOJO CPU is a conventional 5-stage (F,D,X,M,W) pipelined RISC-V CPU. It also contain configurable data- and instruction caches.
Written using SystemVerilog and are split up into logical pieces where each stage of the pipeline is in a separate module:
| Module | Description |
|---|---|
| CPU_ALU | ALU unit, fully combinatorial |
| CPU_CSR | CSR control unit |
| CPU_DCache_Comb | Data cache, combinatorial |
| CPU_DCache_Reg | Data cache, registered |
| CPU_DCache_None | Data cache, disabled |
| CPU_Decode | Decode stage |
| CPU_Defines | CPU defines |
| CPU_Divide | Divison wrapper, usually implemented with a vendor IP |
| CPU_Execute | Execute stage |
| CPU_Fetch | Fetch stage |
| CPU_Forward | Register forwarding logic |
| CPU_ICache_Comb | Instruction cache, combinatorial |
| CPU_ICache_Reg | Instruction cache, registered |
| CPU_ICache_None | Instruction cache, disabled |
| CPU_Memory | Memory stage |
| CPU_Multiply | Multiplication wrapper, usually implemented with a vendor IP |
| CPU_Registers | Register file |
| CPU_SkidBuffer | Generalized skid-buffer |
| CPU_Types | CPU types |
| CPU_Writeback | Writeback stage |
Perifherials
A lot of perifherial modules has been implemented as port of the SoC:
| Module | Description |
|---|---|
| AUDIO_controller, AUDIO_i2s_output, AUDIO_pwm_output | PCM based audio modules |
| BRAM | Various block-ram modules |
| BRIDGE | BUS bridge, to separate BUS devices for improved timing. |
| BROM | Block-rom module |
| BusAccess | BUS multiplexed access |
| ClockDivider | Generic clock divider |
| DMA | Direct memory access controller |
| FIFO_BRAM | Block ram backed FIFO |
| FIFO | Register backed FIFO |
| GPIO | General purpose IO controller |
| I2C | I2C controller |
| LED | LED controller |
| PLIC | PLIC interrupt controller |
| RESET | Reset controller |
| SD | SD controller |
| SDRAM_controller | Generic SDRAM controller |
| SRAM_interface | Generic SRAM controller |
| SystemRegisters | System wide register map |
| Timer | Hardware timer with compare |
| UART | UART controller |
| VIDEO_controller | Video output controller |
| VIDEO_VGA | Video VGA signal generator |
| WriteBuffer | Write buffer (queue) with readback or read-through |
System-on-a-Chip
A couple of custom PCBs designed to connect to QM-Tech FPGA boards is the physical basis for MOJO SoC. The SoC support following perifherials:
- HDMI output
- Stereo audio output through PWM and through I2S HDMI.
- SD card interface using 4-bit SD protocol.
- 2 UARTs, one for host and one for HID input.
- Raspberry Pico based USB host to FPGA bridge supporting three external HID devices (keyboard, mouse and gamepad).
Emulators
Two different emulators, one C++ highlevel emulator and one based on Verilator. The highlevel is useful for application development and the other is used for verification of gate level logic.
Runtime
C/C++ runtime library, including a preemptive multithreaded kernel, expose all hardware features to user programs. Support CRT for easy portability.
Schematics
KiCad schematics for all perifherial boards are available and been built using JLCPCB.
Parts
3| Qty | Value | Footprint | References |
|---|---|---|---|
| 1 | Conn_02x20_Odd_Even | Connector_PinSocket_2.54mm:PinSocket_2x20_P2.54mm_Vertical | J3 |
| 1 | Conn_02x32_Odd_Even | Connector_PinSocket_2.54mm:PinSocket_2x32_P2.54mm_Vertical | J1 |
| 1 | ~ | Connector_PinSocket_2.54mm:PinSocket_2x32_P2.54mm_Vertical | J2 |
More from apistol78/rv32
9- 4 layers183.4 × 143.1 mm

- 2 layers129 × 41.9 mm

- 2 layers42.7 × 83.8 mm

- 2 layers47 × 83.8 mm

- 4 layers45.7 × 83.8 mm

- 2 layers38.1 × 83.8 mm

- 2 layers

- 2 layers30.5 × 83.8 mm

- 2 layers27.4 × 63.2 mm

Similar boards
- 2 layers40 × 30 mm

- 2 layers51.9 × 16 mm

Passive2-rpi non standard adapter
hzeller/rpi-rgb-led-matrix
Controlling up to three chains of 64x64, 32x32, 16x32 or similar RGB LED displays using Raspberry Pi GPIO
3 parts4.4kGPL-2.0 - 2 layers16.3 × 16.3 mm

- 2 layers

Sub
atopile/atopile
Design circuit boards with code! ✨ Get software-like design reuse 🚀, validation, version control and collaboration in hardware; starting with electronics ⚡️
3 parts4kMIT - 2 layers85 × 30 mm

- 2 layers124.5 × 33.7 mm

- 2 layers10.5 × 83 mm

- 2 layers21.2 × 51.3 mm

Pico reset
hackclub/sprig
🍃 Learn to code by making games in a JavaScript web-based game editor.
3 parts1.1kMIT
Questions
How big is the Lcd PCB?
It measures 68.6 × 99.1 mm and has 2 copper layers, 1.6 mm thick.
What parts does the Lcd use?
3 parts. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.
Where can I download the Lcd KiCad files?
From the apistol78/rv32 repository on GitHub, at the commit this page was made from: the board is schematics/lcd/lcd.kicad_pcb and its schematic schematics/hdmi brd/hdmi brd.kicad_sch. PCBKit opens the board in the browser, with nothing to install.
Can I use the Lcd design in my own project?
Its repository states no licence, so its author keeps all rights: ask apistol78 before reusing the design.