Line 1... |
Line 1... |
[](https://stnolting.github.io/neorv32)
|
[](https://stnolting.github.io/neorv32)
|
[](https://github.com/stnolting/neorv32/actions?query=workflow%3ADocumentation)
|
[](https://github.com/stnolting/neorv32/actions?query=workflow%3ADocumentation)
|
|
\
|
[](https://github.com/stnolting/neorv32/actions?query=workflow%3Ariscv-arch-test)
|
[](https://github.com/stnolting/neorv32/actions?query=workflow%3Ariscv-arch-test)
|
[](https://github.com/stnolting/neorv32/actions?query=workflow%3AProcessor)
|
[](https://github.com/stnolting/neorv32/actions?query=workflow%3AProcessor)
|
[](https://github.com/stnolting/neorv32/actions?query=workflow%3AImplementation)
|
[](https://github.com/stnolting/neorv32/actions?query=workflow%3AImplementation)
|
[](https://github.com/stnolting/neorv32/actions?query=workflow%3AWindows)
|
[](https://github.com/stnolting/neorv32/actions?query=workflow%3AWindows)
|
|
|
Line 10... |
Line 10... |
|
|
# The NEORV32 RISC-V Processor
|
# The NEORV32 RISC-V Processor
|
|
|
[](https://github.com/stnolting/neorv32/blob/master/LICENSE)
|
[](https://github.com/stnolting/neorv32/blob/master/LICENSE)
|
[](https://github.com/stnolting/neorv32/releases)
|
[](https://github.com/stnolting/neorv32/releases)
|
|
[](https://doi.org/10.5281/zenodo.5121427)
|
|
|
[](https://github.com/stnolting/neorv32/releases/tag/nightly)
|
[](https://github.com/stnolting/neorv32/releases/tag/nightly)
|
[](https://stnolting.github.io/neorv32)
|
[](https://stnolting.github.io/neorv32)
|
[](https://github.com/stnolting/neorv32/releases/tag/nightly)
|
[](https://github.com/stnolting/neorv32/releases/tag/nightly)
|
[](https://stnolting.github.io/neorv32/ug)
|
[](https://stnolting.github.io/neorv32/ug)
|
[](https://stnolting.github.io/neorv32/sw/files.html)
|
[](https://stnolting.github.io/neorv32/sw/files.html)
|
Line 52... |
Line 54... |
|
|
:spiral_notepad: Check out the [project boards](https://github.com/stnolting/neorv32/projects) for a list of current **ideas**,
|
:spiral_notepad: Check out the [project boards](https://github.com/stnolting/neorv32/projects) for a list of current **ideas**,
|
**TODOs**, features being **planned** and **work-in-progress**.
|
**TODOs**, features being **planned** and **work-in-progress**.
|
|
|
:bulb: Feel free to open a [new issue](https://github.com/stnolting/neorv32/issues) or start a
|
:bulb: Feel free to open a [new issue](https://github.com/stnolting/neorv32/issues) or start a
|
[new discussion](https://github.com/stnolting/neorv32/discussions) if you have questions, comments, ideas or bug-fixes.
|
[new discussion](https://github.com/stnolting/neorv32/discussions) if you have questions, comments, ideas or if something is
|
|
not working as expected.
|
Check out how to contribute in [`CONTRIBUTE.md`](https://github.com/stnolting/neorv32/blob/master/CONTRIBUTING.md).
|
Check out how to contribute in [`CONTRIBUTE.md`](https://github.com/stnolting/neorv32/blob/master/CONTRIBUTING.md).
|
|
|
:rocket: Check out the [quick links below](#Getting-Started) or directly jump to the
|
:rocket: Check out the [quick links below](#Getting-Started) or directly jump to the
|
[*User Guide*](https://stnolting.github.io/neorv32/ug/) to get started
|
[*User Guide*](https://stnolting.github.io/neorv32/ug/) to get started
|
setting up your NEORV32 setup!
|
setting up your NEORV32 setup!
|
Line 139... |
Line 142... |
|
|
### FPGA Implementation Results - Processor
|
### FPGA Implementation Results - Processor
|
|
|
The hardware resources used by a specifc processor setup is defined by the implemented CPU extensions
|
The hardware resources used by a specifc processor setup is defined by the implemented CPU extensions
|
([see below](#FPGA-Implementation-Results---CPU)), the configuration of the peripheral modules and some "glue logic".
|
([see below](#FPGA-Implementation-Results---CPU)), the configuration of the peripheral modules and some "glue logic".
|
Section [_"Processor Modules"_](https://stnolting.github.io/neorv32/#_processor_modules) of the online datasheet shows
|
Section [_"FPGA Implementation Results - Processor Modules"_](https://stnolting.github.io/neorv32/#_processor_modules)
|
the ressource utilization of each optional processor module to estimate the actual setup's hardware requirements.
|
of the online datasheet shows the ressource utilization of each optional processor module to allow an
|
|
estimation of the actual setup's hardware requirements.
|
|
|
:information_source: The [`setups`](https://github.com/stnolting/neorv32/tree/master/setups) folder provides exemplary FPGA
|
:information_source: The [`setups`](https://github.com/stnolting/neorv32/tree/master/setups) folder provides exemplary FPGA
|
setups targeting various FPGA boards and toolchains. These setups also provide ressource utilization reports for different
|
setups targeting various FPGA boards and toolchains. These setups also provide ressource utilization reports for different
|
SoC configurations
|
SoC configurations
|
|
|
Line 160... |
Line 164... |
The CPU (top entity: [`rtl/core/neorv32_cpu.vhd`](https://github.com/stnolting/neorv32/blob/master/rtl/core/neorv32_cpu.vhd))
|
The CPU (top entity: [`rtl/core/neorv32_cpu.vhd`](https://github.com/stnolting/neorv32/blob/master/rtl/core/neorv32_cpu.vhd))
|
implements the RISC-V 32-bit `rv32` ISA with optional extensions (see below). It is compatible to a subset of the
|
implements the RISC-V 32-bit `rv32` ISA with optional extensions (see below). It is compatible to a subset of the
|
*Unprivileged ISA Specification* [(Version 2.2)](https://github.com/stnolting/neorv32/blob/master/docs/references/riscv-spec.pdf)
|
*Unprivileged ISA Specification* [(Version 2.2)](https://github.com/stnolting/neorv32/blob/master/docs/references/riscv-spec.pdf)
|
and a subset of the *Privileged Architecture Specification* [(Version 1.12-draft)](https://github.com/stnolting/neorv32/blob/master/docs/references/riscv-privileged.pdf).
|
and a subset of the *Privileged Architecture Specification* [(Version 1.12-draft)](https://github.com/stnolting/neorv32/blob/master/docs/references/riscv-privileged.pdf).
|
Compatiility is checked by passing the [official RISC-V architecture tests](https://github.com/riscv/riscv-arch-test)
|
Compatiility is checked by passing the [official RISC-V architecture tests](https://github.com/riscv/riscv-arch-test)
|
(see [`riscv-arch-test/README`](https://github.com/stnolting/neorv32/blob/master/riscv-arch-test/README.md)).
|
(see [`sim/README`](sim/README.md)).
|
|
|
The core implements a little-endian von-Neumann architecture using two pipeline stages. Each stage uses a multi-cycle processing
|
The core implements a little-endian von-Neumann architecture using two pipeline stages. Each stage uses a multi-cycle processing
|
scheme. The CPU supports three privilege levels (`machine` and optional `user` and `debug_mode`), three standard RISC-V machine
|
scheme. The CPU supports three privilege levels (`machine` and optional `user` and `debug_mode`), three standard RISC-V machine
|
interrupts (`MTI`, `MEI`, `MSI`), a single non-maskable interrupt plus 16 _fast interrupt requests_ as custom extensions.
|
interrupts (`MTI`, `MEI`, `MSI`), a single non-maskable interrupt plus 16 _fast interrupt requests_ as custom extensions.
|
It also supports **all** standard RISC-V exceptions (instruction/load/store misaligned address & bus access fault, illegal
|
It also supports **all** standard RISC-V exceptions (instruction/load/store misaligned address & bus access fault, illegal
|
instruction, breakpoint, environment call). As a special "execution safety" extension, _all_ invalid, reserved or
|
instruction, breakpoint, environment call)
|
malformed instructions will raise an exception.
|
(see :books: [_"Full Virtualization"_](https://stnolting.github.io/neorv32/#_full_virtualization)).
|
|
|
|
|
### Available ISA Extensions
|
### Available ISA Extensions
|
|
|
Currently, the following _optional_ RISC-V-compatible ISA extensions are implemented (linked to the according
|
Currently, the following _optional_ RISC-V-compatible ISA extensions are implemented (linked to the according
|
Line 198... |
Line 202... |
[[back to top](#The-NEORV32-RISC-V-Processor)]
|
[[back to top](#The-NEORV32-RISC-V-Processor)]
|
|
|
|
|
### FPGA Implementation Results - CPU
|
### FPGA Implementation Results - CPU
|
|
|
:books: More details regarding exemplary FPGA setups including a list of resource utilization by each SoC module can be found in the
|
Implementation results for _exemplary_ CPU configuration generated for an **Intel Cyclone IV EP4CE22F17C6N FPGA**
|
[online documentation - _"FPGA Implementation Results"_](https://stnolting.github.io/neorv32/#_fpga_implementation_results).
|
|
|
|
Implementation results for exemplary CPU configuration generated for an **Intel Cyclone IV EP4CE22F17C6N FPGA**
|
|
using **Intel Quartus Prime Lite 20.1** ("balanced implementation"). The timing information is derived
|
using **Intel Quartus Prime Lite 20.1** ("balanced implementation"). The timing information is derived
|
from the Timing Analyzer / Slow 1200mV 0C Model. No constraints were used at all.
|
from the Timing Analyzer / Slow 1200mV 0C Model. No constraints were used at all.
|
|
|
Results generated for hardware version [`1.5.3.2`](https://github.com/stnolting/neorv32/blob/master/CHANGELOG.md).
|
Results generated for hardware version [`1.5.7.10`](https://github.com/stnolting/neorv32/blob/master/CHANGELOG.md).
|
|
|
| CPU Configuration | LEs | FFs | Memory bits | DSPs (9-bit) | f_max |
|
| CPU Configuration | LEs | FFs | Memory bits | DSPs (9-bit) | f_max |
|
|:--------------------------------------------------|:----:|:----:|:-----------:|:------------:|:-------:|
|
|:--------------------------------------------------|:----:|:----:|:-----------:|:------------:|:-------:|
|
| `rv32i` | 980 | 409 | 1024 | 0 | 125 MHz |
|
| `rv32i` | 806 | 359 | 1024 | 0 | 125 MHz |
|
| `rv32i` + `Zicsr` | 1835 | 856 | 1024 | 0 | 125 MHz |
|
| `rv32i_Zicsr` | 1729 | 813 | 1024 | 0 | 124 MHz |
|
| `rv32imac` + `Zicsr` | 2685 | 1156 | 1024 | 0 | 125 MHz |
|
| `rv32imac_Zicsr` | 2511 | 1074 | 1024 | 0 | 124 MHz |
|
| `rv32imac` + `Zicsr` + `u` + `Zifencei` + `Zfinx` | 4004 | 1812 | 1024 | 7 | 118 MHz |
|
|
|
:information_source: An incrmental list of CPU exntension's hardware utilization can found in
|
|
[online documentation - _"FPGA Implementation Results - CPU"_](https://stnolting.github.io/neorv32/#_cpu).
|
|
|
|
:information_source: The CPU provides options to further reduce the footprint (for example by constraining
|
|
the CPU-internal counters). See the [online data](https://stnolting.github.io/neorv32) sheet for more information.
|
|
|
[[back to top](#The-NEORV32-RISC-V-Processor)]
|
[[back to top](#The-NEORV32-RISC-V-Processor)]
|
|
|
|
|
### Performance
|
### Performance
|
Line 224... |
Line 230... |
The NEORV32 CPU is based on a two-stages pipelined architecutre. Since both stage use a multi-cycle processing scheme,
|
The NEORV32 CPU is based on a two-stages pipelined architecutre. Since both stage use a multi-cycle processing scheme,
|
each instruction requires several clock cycles to execute (2 cycles for ALU operations, up to 40 cycles for divisions).
|
each instruction requires several clock cycles to execute (2 cycles for ALU operations, up to 40 cycles for divisions).
|
The average CPI (cycles per instruction) depends on the instruction mix of a specific applications and also on the
|
The average CPI (cycles per instruction) depends on the instruction mix of a specific applications and also on the
|
available CPU extensions.
|
available CPU extensions.
|
|
|
The following table shows the performance results(relative CoreMark score and average cycles per instruction) for successfully
|
The following table shows the performance results (relative CoreMark score and average cycles per instruction) for
|
running 2000 iterations of the [CoreMark CPU benchmark](https://www.eembc.org/coremark).
|
_exemplary_ CPU configuration running 2000 iterations of the [CoreMark CPU benchmark](https://www.eembc.org/coremark).
|
The source files are available in [sw/example/coremark](https://github.com/stnolting/neorv32/blob/master/sw/example/coremark).
|
The source files are available in [`sw/example/coremark`](https://github.com/stnolting/neorv32/blob/master/sw/example/coremark).
|
|
|
~~~
|
~~~
|
**CoreMark Setup**
|
**CoreMark Setup**
|
Hardware: 32kB IMEM, 8kB DMEM, no caches, 100MHz clock
|
Hardware: 32kB IMEM, 8kB DMEM, no caches, 100MHz clock
|
CoreMark: 2000 iterations, MEM_METHOD is MEM_STACK
|
CoreMark: 2000 iterations, MEM_METHOD is MEM_STACK
|
Compiler: RISCV32-GCC 10.1.0 (rv32i toolchain)
|
Compiler: RISCV32-GCC 10.1.0 (rv32i toolchain)
|
Compiler flags: default, see makefile; optimization -O3
|
Compiler flags: default, see makefile; optimization -O3
|
~~~
|
~~~
|
|
|
Results generated for hardware version [`1.4.9.8`](https://github.com/stnolting/neorv32/blob/master/CHANGELOG.md).
|
Results generated for hardware version [`1.5.7.10`](https://github.com/stnolting/neorv32/blob/master/CHANGELOG.md).
|
|
|
| CPU (including `Zicsr` extension) | Executable Size | CoreMark Score | CoreMarks/MHz | Total Clock Cycles | Executed Instructions | Average CPI |
|
| CPU Configuration | CoreMark Score | CoreMarks/MHz | Average CPI |
|
|:--------------------------------------------|:---------------:|:--------------:|:-------------:|-------------------:|----------------------:|:-----------:|
|
|:-----------------------------------------------|:--------------:|:-------------:|:-----------:|
|
| `rv32i` | 28 756 bytes | 36.36 | **0.3636** | 5595750503 | 1466028607 | **3.82** |
|
| _small_ (`rv32i_Zicsr`) | 33.89 | **0.3389** | **4.04** |
|
| `rv32imc` | 22 008 bytes | 68.97 | **0.6897** | 2981786734 | 611814918 | **4.87** |
|
| _medium_ (`rv32imc_Zicsr`) | 62.50 | **0.6250** | **5.34** |
|
| `rv32imc` + `FAST_MUL_EN` + `FAST_SHIFT_EN` | 22 008 bytes | 90.91 | **0.9091** | 2265135174 | 611814948 | **3.70** |
|
| _performance_(`rv32imc_Zicsr` + perf. options) | 95.23 | **0.9523** | **3.54** |
|
|
|
:information_source: The `FAST_MUL_EN` configuration uses DSPs for the multiplier of the `M` extension.
|
:information_source: More information regarding the CPU performance can be found in the
|
The `FAST_SHIFT_EN` configuration uses a barrel shifter for CPU shift operations.
|
[online documentation - _"CPU Performance"_](https://stnolting.github.io/neorv32/#_cpu_performance).
|
|
|
[[back to top](#The-NEORV32-RISC-V-Processor)]
|
[[back to top](#The-NEORV32-RISC-V-Processor)]
|
|
|
|
|
|
|