• Stars
    star
    1,585
  • Rank 29,515 (Top 0.6 %)
  • Language VHDL
  • License
    BSD 3-Clause "New...
  • Created over 4 years ago
  • Updated 25 days ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

๐Ÿ–ฅ๏ธ A small, customizable and extensible MCU-class 32-bit RISC-V soft-core CPU and microcontroller-like SoC written in platform-independent VHDL.

NEORV32

The NEORV32 RISC-V Processor

datasheet (pdf) datasheet (html) userguide (pdf) userguide (html) doxygen

  1. Overview
  2. Features
  3. FPGA Implementation Results
  4. Performance
  5. Software Framework & Tooling
  6. Getting Started ๐Ÿš€

1. Overview

neorv32 Overview

The NEORV32 Processor is a customizable microcontroller-like system on chip (SoC) built around the NEORV32 RISC-V CPU and written in platform-independent VHDL. The processor is intended as auxiliary controller in larger SoC designs or as ready-to-go stand-alone custom microcontroller that even fits into a Lattice iCE40 UltraPlus low-power & low-density FPGA. The project is intended to work out of the box and targets FPGA / RISC-V beginners as well as advanced users.

Special focus is paid on execution safety to provide defined and predictable behavior at any time. Therefore, the CPU ensures that all memory accesses are properly acknowledged and that all invalid/malformed instructions are always detected as such. Whenever an unexpected situation occurs the application software is informed via precise and resumable hardware exceptions.

Want to know more? Check out the project's rationale.

๐Ÿ’ก Feel free to open a new issue or start a new discussion if you have questions, comments, ideas or if something is not working as expected. Or have a chat on our gitter channel. See how to contribute.

Key Features

  • all-in-one package: CPU + SoC + Software Framework & Tooling
  • completely described in behavioral, platform-independent VHDL - no platform-specific primitives, macros, attributes, etc.; an all-Verilog "version" is also available
  • extensive configuration options for adapting the processor to the requirements of the application
  • highly extensible hardware - on CPU, processor and system level
  • aims to be as small as possible while being as RISC-V-compliant as possible - with a reasonable area-vs-performance trade-off
  • FPGA friendly (e.g. all internal memories can be mapped to block RAM - including the CPU's register file)
  • optimized for high clock frequencies to ease integration / timing closure
  • from zero to "hello world!" - completely open source and documented
  • easy to use even for FPGA / RISC-V starters โ€“ intended to work out of the box

Project Status

release commits-since-latest-release

Task Repository CI Status
GitHub Pages (docs) neorv32 GitHub Pages
Build documentation neorv32 Documentation
Processor (SoC) verification neorv32 Processor
RISCOF core verification neorv32-riscof neorv32-riscof
FPGA implementations neorv32-setups Implementation
All-Verilog "version" neorv32-verilog neorv32-verilog
Prebuilt GCC toolchains riscv-gcc-prebuilt Prebuilt_Toolchains

The processor passes the official RISC-V architecture tests to ensure compatibility with the RISC-V ISA specs., which is checked by the neorv32-riscof repository. It can successfully run any C program (for example from the sw/example folder) including CoreMark and FreeRTOS and can be synthesized for any target technology - tested on Intel, Xilinx and Lattice FPGAs. The conversion into a plain-Verilog netlist module is automatically checked by the neorv32-verilog repository.

[back to top]

2. Features

The NEORV32 Processor provides a full-featured microcontroller-like SoC build around the NEORV32 CPU. By using generics the design is highly configurable and allows a flexible customization to tailor the setup according to your needs. Note that all of the following SoC modules are entirely optional.

CPU Core

  • NEORV32_MARCHID - see the open-source architecture ID list in the official RISC-V ISA manual repository
  • 32-bit little-endian RISC-V single-core, pipelined/multi-cycle modified Harvard architecture
  • configurable ISA extensions:
    RV32 [I/ E] [B] [C] [M] [U] [X] [Zicntr] [Zicsr] [Zicond] [Zihpm] [Zifencei] [Zfinx] [Zmmul] [Zxcfu] [PMP] [Sdext] [Sdtrig]
  • compatible to subsets of the RISC-V Unprivileged ISA Specification (pdf) and Privileged Architecture Specification (pdf).
  • machine and user privilege modes
  • implements all standard RISC-V exceptions and interrupts (including MTI, MEI & MSI)
  • 16 fast interrupt request channels as NEORV32-specific extension
  • custom functions unit (CFU as Zxcfu ISA extension) for custom RISC-V instructions (R3-type, R4-type and R5-type);
  • intrinsic libraries for the Zicond, Zfinx and Zxcfu ISA extensions

Memories

  • processor-internal data and instruction memories (DMEM / IMEM) & caches (iCACHE and dCACHE)
  • pre-installed bootloader (BOOTLDROM) with serial user interface; allows booting application code via UART or from external SPI flash

Timers and Counters

  • 64-bit machine system timer (MTIME), RISC-V spec. compatible
  • 32-bit general purpose timer (GPTMR)
  • watchdog timer (WDT)

Input / Output

SoC Connectivity

  • 32-bit external bus interface - Wishbone b4 compatible (WISHBONE); wrappers for AXI4-Lite and Avalon-MM host interfaces
  • stream link interface with independent RX and TX channels - AXI4-Stream compatible (SLINK)
  • external interrupts controller with up to 32 channels (XIRQ)

Advanced

  • true random number generator (TRNG) based on the neoTRNG
  • execute-in-place module (XIP) to execute code directly from SPI flash
  • custom functions subsystem (CFS) for custom tightly-coupled co-processors, accelerators or interfaces
  • direct memory access controller (DMA) for CPU-independent data transfers and conversions
  • cyclic redundancy check unit (DMA) to test data integrity (CRC8/CRC16/CRC32)

Debugging

  • on-chip debugger (OCD) accessible via standard JTAG interface
  • compliant to the "Minimal RISC-V Debug Specification Version 1.0"
  • compatible with OpenOCD + gdb and Segger Embedded Studio

[back to top]

3. FPGA Implementation Results

Implementation results for exemplary CPU configurations generated for an Intel Cyclone IV EP4CE22F17C6 FPGA using Intel Quartus Prime Lite 21.1 (no timing constrains, balanced optimization, f_max from Slow 1200mV 0C Model).

CPU Configuration (version 1.7.8.5) LEs FFs Memory bits DSPs f_max
rv32i_Zicsr 1223 607 1024 0 130 MHz
rv32i_Zicsr_Zicntr 1578 773 1024 0 130 MHz
rv32imc_Zicsr_Zicntr 2338 992 1024 0 130 MHz

Implementation results for an exemplary SoC/Processor configurations generated for a Xilinx Artix-7 xc7a35ticsg324-1L FPGA using Xilinx Vivado 2019.2 (no constraints except for clock speed).

SoC Configuration (version 1.7.7.3) LUTs FFs BRAMs DSPs Clock
CPU: rv32imcu_Zicsr_Zicnt_DEBUG + FST_MUL + FAST_SHIFT; Peripherals: UART0 + MTIME + GPIO 2488 1807 7 4 150 MHz

๐Ÿ’ก An incremental list of the CPU extensions and the Processor modules can be found in the Data Sheet: FPGA Implementation Results.

[back to top]

4. Performance

The NEORV32 CPU is based on a two-stages pipeline architecture (fetch and execute). The average CPI (cycles per instruction) depends on the instruction mix of a specific applications and also on the available CPU extensions.

The following table shows the performance results (scores and average CPI) for exemplary CPU configurations (no caches) executing 2000 iterations of the CoreMark CPU benchmark (using plain GCC10 rv32i built-in libraries only!).

CPU Configuration (version 1.5.7.10) CoreMark Score CoreMarks/MHz Average CPI
small (rv32i_Zicsr) 33.89 0.3389 4.04
medium (rv32imc_Zicsr) 62.50 0.6250 5.34
performance (rv32imc_Zicsr + perf. options) 95.23 0.9523 3.54

๐Ÿ’ก More information regarding the CPU performance can be found in the Data Sheet: CPU Performance. The CPU & SoC provide further "tuning" options to optimize the design for maximum performance, maximum clock speed, minimal area or minimal power consumption: UG: Application-Specific Processor Configuration

[back to top]

5. Software Framework and Tooling

  • core libraries for high-level usage of the provided functions and peripherals
  • application compilation based on GNU makefiles
  • gcc-based toolchain (pre-compiled toolchains available)
  • SVD file for advanced debugging and IDE integration
  • bootloader with UART interface console
  • runtime environment for handling traps
  • several example programs to get started including CoreMark, FreeRTOS and Conway's Game of Life
  • doxygen-based documentation, available on GitHub pages
  • supports implementation using open source toolchains - both, software and hardware can be developed and debugged with open source tools (GHDL, Yosys, nextpnr, openOCD, gtkwave, ...)
  • continuous integration is available for:
    • allowing users to see the expected execution/output of the tools
    • ensuring RISC-V specification compatibility using RISCOF
    • catching regressions
    • providing ready-to-use and up-to-date bitstreams and documentation

๐Ÿ’ก Want to know more? Check out the Data Sheet: Software Framework.

[back to top]

6. Getting Started

This overview provides some quick links to the most important sections of the online Data Sheet and the online User Guide.

๐Ÿ” Project Overview

๐Ÿ”Œ Hardware Overview

๐Ÿ’พ Software Overview

๐Ÿš€ User Guide

ยฉ๏ธ Legal

license DOI

  • Overview - license, disclaimer, limitation of liability for external links, proprietary notice, etc.
  • Citing - citing information

This is an open-source project that is free of charge. Use this project in any way you like (as long as it complies to the permissive license). Please cite it appropriately. ๐Ÿ‘

[back to top]


โค๏ธ A big shout-out to the community and all the contributors, who helped improving this project!

More Repositories

1

neo430

๐Ÿ’ป A damn small msp430-compatible customizable soft-core microcontroller-like processor system written in platform-independent VHDL.
VHDL
203
star
2

neoTRNG

๐ŸŽฒ A Tiny and Platform-Independent True Random Number Generator for any FPGA (and ASIC).
VHDL
169
star
3

fpga_puf

๐Ÿ”‘ Technology-agnostic Physical Unclonable Function (PUF) hardware module for any FPGA.
VHDL
124
star
4

captouch

๐Ÿ‘‡ Add capacitive touch buttons to any FPGA!
VHDL
99
star
5

riscv-gcc-prebuilt

๐Ÿ“ฆ Prebuilt RISC-V GCC toolchains for x64 Linux.
Shell
86
star
6

neorv32-verilog

โ™ป๏ธ Convert the NEORV32 processor into a synthesizable plain-Verilog netlist module using GHDL.
Verilog
56
star
7

fpga_torture

๐Ÿ”ฅ Technology-agnostic FPGA stress-test: maximum logic utilization and high dynamic power consumption.
VHDL
28
star
8

neorv32-riscof

โœ”๏ธPort of RISCOF to check the NEORV32 for RISC-V ISA compatibility.
Python
25
star
9

cjtag_bridge

๐Ÿ”Œ Compact JTAG ("cJTAG") to 4-wire JTAG (IEEE 1149.1) bridge.
VHDL
22
star
10

riscv-debug-dtm

๐Ÿ› JTAG debug transport module (DTM) - compatible to the RISC-V debug specification.
VHDL
21
star
11

wb_spi_bridge

๐ŸŒ‰ A transparent Wishbone-to-SPI bridge supporting Execute-In-Place (XIP).
VHDL
21
star
12

neorv32-formal

Formal verification (experiments) targeting the NEORV32 RISC-V processor.
VHDL
6
star
13

msp430-gcc

Pre-compiled msp430-gcc compiler toolchains for 32/64-bit Windows and Linux machines.
5
star
14

74xx_discrete_clock

A retro-style digital clock based on 74xx discrete logic chips
5
star
15

neorv32-freertos

๐Ÿ’พ FreeRTOS port for the NEORV32 RISC-V Processor.
4
star
16

neorv32-verif

โœ”๏ธ Check the NEORV32 Processor for RISC-V compatibility.
C
3
star
17

neorv32-setups

Example setups for the NEORV32 RISC-V Processor
VHDL
2
star
18

icarus-verilog-prebuilt

๐Ÿ“ฆ Prebuilt Icarus Verilog simulator package for x64 Linux.
1
star