1 |
59 |
zero_gravi |
[![GitHub Pages](https://img.shields.io/website.svg?label=stnolting.github.io%2Fneorv32&longCache=true&style=flat-square&url=http%3A%2F%2Fstnolting.github.io%2Fneorv32%2Findex.html&logo=GitHub)](https://stnolting.github.io/neorv32)
|
2 |
61 |
zero_gravi |
[![Documentation](https://img.shields.io/github/workflow/status/stnolting/neorv32/Documentation/master?longCache=true&style=flat-square&label=Documentation&logo=Github%20Actions&logoColor=fff)](https://github.com/stnolting/neorv32/actions?query=workflow%3ADocumentation)
|
3 |
62 |
zero_gravi |
\
|
4 |
61 |
zero_gravi |
[![riscv-arch-test](https://img.shields.io/github/workflow/status/stnolting/neorv32/riscv-arch-test/master?longCache=true&style=flat-square&label=riscv-arch-test&logo=Github%20Actions&logoColor=fff)](https://github.com/stnolting/neorv32/actions?query=workflow%3Ariscv-arch-test)
|
5 |
59 |
zero_gravi |
[![Processor](https://img.shields.io/github/workflow/status/stnolting/neorv32/Processor/master?longCache=true&style=flat-square&label=Processor&logo=Github%20Actions&logoColor=fff)](https://github.com/stnolting/neorv32/actions?query=workflow%3AProcessor)
|
6 |
|
|
[![Implementation](https://img.shields.io/github/workflow/status/stnolting/neorv32/Implementation/master?longCache=true&style=flat-square&label=Implementation&logo=Github%20Actions&logoColor=fff)](https://github.com/stnolting/neorv32/actions?query=workflow%3AImplementation)
|
7 |
61 |
zero_gravi |
[![Windows](https://img.shields.io/github/workflow/status/stnolting/neorv32/Windows/master?longCache=true&style=flat-square&label=Windows&logo=Github%20Actions&logoColor=fff)](https://github.com/stnolting/neorv32/actions?query=workflow%3AWindows)
|
8 |
59 |
zero_gravi |
|
9 |
50 |
zero_gravi |
[![NEORV32](https://raw.githubusercontent.com/stnolting/neorv32/master/docs/figures/neorv32_logo_dark.png)](https://github.com/stnolting/neorv32)
|
10 |
2 |
zero_gravi |
|
11 |
37 |
zero_gravi |
# The NEORV32 RISC-V Processor
|
12 |
|
|
|
13 |
59 |
zero_gravi |
[![license](https://img.shields.io/github/license/stnolting/neorv32?longCache=true&style=flat-square)](https://github.com/stnolting/neorv32/blob/master/LICENSE)
|
14 |
|
|
[![release](https://img.shields.io/github/v/release/stnolting/neorv32?longCache=true&style=flat-square&logo=GitHub)](https://github.com/stnolting/neorv32/releases)
|
15 |
65 |
zero_gravi |
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.5018888.svg)](https://doi.org/10.5281/zenodo.5018888)
|
16 |
68 |
zero_gravi |
\
|
17 |
59 |
zero_gravi |
[![datasheet (pdf)](https://img.shields.io/badge/data%20sheet-PDF-ffbd00?longCache=true&style=flat-square&logo=asciidoctor)](https://github.com/stnolting/neorv32/releases/tag/nightly)
|
18 |
60 |
zero_gravi |
[![datasheet (html)](https://img.shields.io/badge/-HTML-ffbd00?longCache=true&style=flat-square)](https://stnolting.github.io/neorv32)
|
19 |
|
|
[![userguide (pdf)](https://img.shields.io/badge/user%20guide-PDF-ffbd00?longCache=true&style=flat-square&logo=asciidoctor)](https://github.com/stnolting/neorv32/releases/tag/nightly)
|
20 |
|
|
[![userguide (html)](https://img.shields.io/badge/-HTML-ffbd00?longCache=true&style=flat-square)](https://stnolting.github.io/neorv32/ug)
|
21 |
59 |
zero_gravi |
[![doxygen](https://img.shields.io/badge/doxygen-HTML-ffbd00?longCache=true&style=flat-square&logo=Doxygen)](https://stnolting.github.io/neorv32/sw/files.html)
|
22 |
67 |
zero_gravi |
[![Gitter](https://img.shields.io/badge/Chat-on%20gitter-4db797.svg?longCache=true&style=flat-square&logo=gitter&logoColor=e8ecef)](https://gitter.im/neorv32/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
23 |
2 |
zero_gravi |
|
24 |
64 |
zero_gravi |
1. [Overview](#1-Overview)
|
25 |
|
|
1. [Key Features](#Project-Key-Features)
|
26 |
|
|
2. [Processor/SoC Features](#2-NEORV32-Processor-Features)
|
27 |
|
|
1. [FPGA Implementation Results](#FPGA-Implementation-Results---Processor)
|
28 |
|
|
3. [CPU Features](#3-NEORV32-CPU-Features)
|
29 |
|
|
1. [Available ISA Extensions](#Available-ISA-Extensions)
|
30 |
|
|
2. [FPGA Implementation Results](#FPGA-Implementation-Results---CPU)
|
31 |
|
|
3. [Performance](#Performance)
|
32 |
|
|
4. [Software Framework & Tooling](#4-Software-Framework-and-Tooling)
|
33 |
|
|
5. [**Getting Started**](#5-Getting-Started) :rocket:
|
34 |
2 |
zero_gravi |
|
35 |
|
|
|
36 |
60 |
zero_gravi |
|
37 |
64 |
zero_gravi |
## 1. Overview
|
38 |
2 |
zero_gravi |
|
39 |
54 |
zero_gravi |
![neorv32 Overview](https://raw.githubusercontent.com/stnolting/neorv32/master/docs/figures/neorv32_processor.png)
|
40 |
|
|
|
41 |
59 |
zero_gravi |
The NEORV32 Processor is a customizable microcontroller-like system on chip (SoC) that is based on the RISC-V NEORV32 CPU.
|
42 |
|
|
The project is intended as auxiliary processor in larger SoC designs or as *ready-to-go* stand-alone
|
43 |
|
|
custom / customizable microcontroller.
|
44 |
2 |
zero_gravi |
|
45 |
66 |
zero_gravi |
Special focus is paid on **execution safety** to provide defined and predictable behavior at any time.
|
46 |
|
|
Therefore, the CPU ensures that all memory access are acknowledged and no invalid/malformed instructions
|
47 |
|
|
are executed. Whenever an unexpected situation occurs, the application code is informed via hardware exceptions.
|
48 |
|
|
|
49 |
68 |
zero_gravi |
:thinking: Want to know more? Check out the [project's rationale](https://stnolting.github.io/neorv32/#_rationale).
|
50 |
61 |
zero_gravi |
|
51 |
60 |
zero_gravi |
:books: For detailed information take a look at the [NEORV32 documentation (online at GitHub-pages)](https://stnolting.github.io/neorv32/).
|
52 |
59 |
zero_gravi |
The *doxygen*-based documentation of the *software framework* is also available online
|
53 |
|
|
at [GitHub-pages](https://stnolting.github.io/neorv32/sw/files.html).
|
54 |
45 |
zero_gravi |
|
55 |
59 |
zero_gravi |
:label: The project's change log is available in [`CHANGELOG.md`](https://github.com/stnolting/neorv32/blob/master/CHANGELOG.md).
|
56 |
|
|
To see the changes between *official* releases visit the project's [release page](https://github.com/stnolting/neorv32/releases).
|
57 |
11 |
zero_gravi |
|
58 |
61 |
zero_gravi |
:package: The [`setups`](https://github.com/stnolting/neorv32/tree/master/setups) folder provides exemplary setups targeting
|
59 |
65 |
zero_gravi |
various FPGA boards and toolchains to get you started. Several example programs (including a FreeRTOS port) to be run on your setup
|
60 |
|
|
can be found in [`sw/example`](https://github.com/stnolting/neorv32/tree/master/sw/example).
|
61 |
56 |
zero_gravi |
|
62 |
68 |
zero_gravi |
:kite: Supported by upstream [Zephyr OS](https://docs.zephyrproject.org/latest/boards/riscv/neorv32/doc/index.html).
|
63 |
65 |
zero_gravi |
|
64 |
59 |
zero_gravi |
:bulb: Feel free to open a [new issue](https://github.com/stnolting/neorv32/issues) or start a
|
65 |
62 |
zero_gravi |
[new discussion](https://github.com/stnolting/neorv32/discussions) if you have questions, comments, ideas or if something is
|
66 |
67 |
zero_gravi |
not working as expected. Or have a chat on our [gitter channel](https://gitter.im/neorv32/community).
|
67 |
47 |
zero_gravi |
|
68 |
68 |
zero_gravi |
:rocket: Check out the [quick links below](#5-Getting-Started) or directly jump to the
|
69 |
60 |
zero_gravi |
[*User Guide*](https://stnolting.github.io/neorv32/ug/) to get started
|
70 |
59 |
zero_gravi |
setting up your NEORV32 setup!
|
71 |
51 |
zero_gravi |
|
72 |
2 |
zero_gravi |
|
73 |
59 |
zero_gravi |
### Project Key Features
|
74 |
15 |
zero_gravi |
|
75 |
68 |
zero_gravi |
- [x] all-in-one: [CPU](#3-NEORV32-CPU-Features) plus [SoC](#2-NEORV32-Processor-Features) plus [Software Framework & Tooling](#4-Software-Framework-and-Tooling)
|
76 |
64 |
zero_gravi |
- [x] completely described in behavioral, platform-independent VHDL - no primitives, macros, etc.
|
77 |
|
|
- [x] fully synchronous design, no latches, no gated clocks
|
78 |
65 |
zero_gravi |
- [x] be as small as possible while being as RISC-V-compliant as possible – but with a reasonable size-performance trade-off:
|
79 |
|
|
the processor (CPU _including_ privileged architecture) fits into a Lattice iCE40 UltraPlus 5k low-power FPGA running at 24 MHz
|
80 |
64 |
zero_gravi |
- [x] from zero to `printf("hello world!");` - completely open source and documented
|
81 |
|
|
- [x] easy to use even for FPGA/RISC-V starters – intended to work *out of the box*
|
82 |
22 |
zero_gravi |
|
83 |
59 |
zero_gravi |
[[back to top](#The-NEORV32-RISC-V-Processor)]
|
84 |
2 |
zero_gravi |
|
85 |
|
|
|
86 |
|
|
|
87 |
64 |
zero_gravi |
## 2. NEORV32 Processor Features
|
88 |
3 |
zero_gravi |
|
89 |
60 |
zero_gravi |
The NEORV32 Processor (top entity: [`rtl/core/neorv32_top.vhd`](https://github.com/stnolting/neorv32/blob/master/rtl/core/neorv32_top.vhd))
|
90 |
|
|
provides a full-featured SoC build around the NEORV32 CPU. It is highly configurable via generics
|
91 |
|
|
to allow a flexible customization according to your needs. Note that all modules listed below are _optional_.
|
92 |
2 |
zero_gravi |
|
93 |
60 |
zero_gravi |
**Memory**
|
94 |
2 |
zero_gravi |
|
95 |
60 |
zero_gravi |
* processor-internal data and instruction memories ([DMEM](https://stnolting.github.io/neorv32/#_data_memory_dmem) /
|
96 |
|
|
[IMEM](https://stnolting.github.io/neorv32/#_instruction_memory_imem)) &
|
97 |
|
|
cache ([iCACHE](https://stnolting.github.io/neorv32/#_processor_internal_instruction_cache_icache))
|
98 |
|
|
* bootloader ([BOOTLDROM](https://stnolting.github.io/neorv32/#_bootloader_rom_bootrom)) with serial user interface
|
99 |
68 |
zero_gravi |
* allows booting application code via UART or from external SPI flash
|
100 |
11 |
zero_gravi |
|
101 |
60 |
zero_gravi |
**Timers**
|
102 |
11 |
zero_gravi |
|
103 |
67 |
zero_gravi |
* machine system timer, 64-bit ([MTIME](https://stnolting.github.io/neorv32/#_machine_system_timer_mtime)), RISC-V spec. compatible
|
104 |
|
|
* general purpose 32-bit timer ([GPTMR](https://stnolting.github.io/neorv32/#_general_purpose_timer_gptmr))
|
105 |
60 |
zero_gravi |
* watchdog timer ([WDT](https://stnolting.github.io/neorv32/#_watchdog_timer_wdt))
|
106 |
11 |
zero_gravi |
|
107 |
60 |
zero_gravi |
**IO**
|
108 |
56 |
zero_gravi |
|
109 |
60 |
zero_gravi |
* standard serial interfaces
|
110 |
|
|
([UART](https://stnolting.github.io/neorv32/#_primary_universal_asynchronous_receiver_and_transmitter_uart0),
|
111 |
|
|
[SPI](https://stnolting.github.io/neorv32/#_serial_peripheral_interface_controller_spi),
|
112 |
|
|
[TWI / I²C](https://stnolting.github.io/neorv32/#_two_wire_serial_interface_controller_twi))
|
113 |
|
|
* general purpose [GPIO](https://stnolting.github.io/neorv32/#_general_purpose_input_and_output_port_gpio) and
|
114 |
|
|
[PWM](https://stnolting.github.io/neorv32/#_pulse_width_modulation_controller_pwm)
|
115 |
|
|
* smart LED interface ([NEOLED](https://stnolting.github.io/neorv32/#_smart_led_interface_neoled)) to directly drive _NeoPixel(TM)_ LEDs
|
116 |
2 |
zero_gravi |
|
117 |
60 |
zero_gravi |
**SoC Connectivity and Integration**
|
118 |
47 |
zero_gravi |
|
119 |
59 |
zero_gravi |
* 32-bit external bus interface, Wishbone b4 compatible
|
120 |
|
|
([WISHBONE](https://stnolting.github.io/neorv32/#_processor_external_memory_interface_wishbone_axi4_lite))
|
121 |
63 |
zero_gravi |
* [wrapper](https://github.com/stnolting/neorv32/blob/master/rtl/system_integration/neorv32_SystemTop_axi4lite.vhd) for AXI4-Lite master interface
|
122 |
65 |
zero_gravi |
* [wrapper](https://github.com/stnolting/neorv32/blob/master/rtl/system_integration/neorv32_SystemTop_AvalonMM.vhd) for Avalon-MM master interface
|
123 |
64 |
zero_gravi |
* 32-bit stream link interface with up to 8 independent RX and TX links
|
124 |
61 |
zero_gravi |
([SLINK](https://stnolting.github.io/neorv32/#_stream_link_interface_slink))
|
125 |
|
|
* AXI4-Stream compatible
|
126 |
|
|
* external interrupt controller with up to 32 channels
|
127 |
|
|
([XIRQ](https://stnolting.github.io/neorv32/#_external_interrupt_controller_xirq))
|
128 |
59 |
zero_gravi |
* custom functions subsystem ([CFS](https://stnolting.github.io/neorv32/#_custom_functions_subsystem_cfs))
|
129 |
|
|
for tightly-coupled custom co-processor extensions
|
130 |
60 |
zero_gravi |
|
131 |
|
|
**Advanced**
|
132 |
|
|
|
133 |
|
|
* _true random_ number generator ([TRNG](https://stnolting.github.io/neorv32/#_true_random_number_generator_trng))
|
134 |
68 |
zero_gravi |
* on-chip debugger ([OCD](https://stnolting.github.io/neorv32/#_on_chip_debugger_ocd)) accessible via JTAG interface - implementing
|
135 |
59 |
zero_gravi |
the [*Minimal RISC-V Debug Specification Version 0.13.2*](https://github.com/riscv/riscv-debug-spec)
|
136 |
61 |
zero_gravi |
and compatible with *OpenOCD* and *gdb*
|
137 |
68 |
zero_gravi |
* bus keeper to monitor the CPU's bus transactions ([BUSKEEPER](https://stnolting.github.io/neorv32/#_internal_bus_monitor_buskeeper))
|
138 |
47 |
zero_gravi |
|
139 |
56 |
zero_gravi |
[[back to top](#The-NEORV32-RISC-V-Processor)]
|
140 |
47 |
zero_gravi |
|
141 |
56 |
zero_gravi |
|
142 |
60 |
zero_gravi |
### FPGA Implementation Results - Processor
|
143 |
47 |
zero_gravi |
|
144 |
68 |
zero_gravi |
The hardware resources used by a specific processor setup is defined by the implemented CPU extensions,
|
145 |
|
|
the configuration of the peripheral modules and some "glue logic".
|
146 |
|
|
Section [_FPGA Implementation Results - Processor Modules_](https://stnolting.github.io/neorv32/#_processor_modules)
|
147 |
64 |
zero_gravi |
of the online datasheet shows the resource utilization of each optional processor module to allow an
|
148 |
62 |
zero_gravi |
estimation of the actual setup's hardware requirements.
|
149 |
2 |
zero_gravi |
|
150 |
61 |
zero_gravi |
:information_source: The [`setups`](https://github.com/stnolting/neorv32/tree/master/setups) folder provides exemplary FPGA
|
151 |
64 |
zero_gravi |
setups targeting various FPGA boards and toolchains. These setups also provide resource utilization reports for different
|
152 |
61 |
zero_gravi |
SoC configurations
|
153 |
56 |
zero_gravi |
|
154 |
|
|
[[back to top](#The-NEORV32-RISC-V-Processor)]
|
155 |
47 |
zero_gravi |
|
156 |
56 |
zero_gravi |
|
157 |
47 |
zero_gravi |
|
158 |
64 |
zero_gravi |
## 3. NEORV32 CPU Features
|
159 |
47 |
zero_gravi |
|
160 |
60 |
zero_gravi |
The CPU (top entity: [`rtl/core/neorv32_cpu.vhd`](https://github.com/stnolting/neorv32/blob/master/rtl/core/neorv32_cpu.vhd))
|
161 |
64 |
zero_gravi |
implements the RISC-V 32-bit `rv32` ISA with optional extensions (see below). It is compatible to subsets of the
|
162 |
60 |
zero_gravi |
*Unprivileged ISA Specification* [(Version 2.2)](https://github.com/stnolting/neorv32/blob/master/docs/references/riscv-spec.pdf)
|
163 |
64 |
zero_gravi |
and the *Privileged Architecture Specification* [(Version 1.12-draft)](https://github.com/stnolting/neorv32/blob/master/docs/references/riscv-privileged.pdf).
|
164 |
|
|
Compatibility is checked by passing the [official RISC-V architecture tests](https://github.com/riscv/riscv-arch-test)
|
165 |
62 |
zero_gravi |
(see [`sim/README`](sim/README.md)).
|
166 |
56 |
zero_gravi |
|
167 |
66 |
zero_gravi |
The core is a little-endian Von-Neumann machine implemented as multi-cycle architecture.
|
168 |
|
|
However, the CPU's _front end_ (instruction fetch) and _back end_ (instruction execution) can work independently to increase performance.
|
169 |
|
|
Currently, three privilege levels (`machine` and optional `user` and `debug_mode`) are supported. The CPU implements all three standard RISC-V machine
|
170 |
64 |
zero_gravi |
interrupts (`MTI`, `MEI`, `MSI`) plus 16 _fast interrupt requests_ as custom extensions.
|
171 |
61 |
zero_gravi |
It also supports **all** standard RISC-V exceptions (instruction/load/store misaligned address & bus access fault, illegal
|
172 |
66 |
zero_gravi |
instruction, breakpoint, environment calls).
|
173 |
23 |
zero_gravi |
|
174 |
68 |
zero_gravi |
:books: In-depth detailed information regarding the CPU can be found in the
|
175 |
|
|
[_Data Sheet: NEORV32 Central Processing Unit_](https://stnolting.github.io/neorv32/#_neorv32_central_processing_unit_cpu).
|
176 |
2 |
zero_gravi |
|
177 |
68 |
zero_gravi |
|
178 |
60 |
zero_gravi |
### Available ISA Extensions
|
179 |
2 |
zero_gravi |
|
180 |
60 |
zero_gravi |
Currently, the following _optional_ RISC-V-compatible ISA extensions are implemented (linked to the according
|
181 |
|
|
documentation section). Note that the `X` extension is always enabled.
|
182 |
2 |
zero_gravi |
|
183 |
60 |
zero_gravi |
**RV32
|
184 |
|
|
[[`I`](https://stnolting.github.io/neorv32/#_i_base_integer_isa)/
|
185 |
|
|
[`E`](https://stnolting.github.io/neorv32/#_e_embedded_cpu)]
|
186 |
|
|
[[`A`](https://stnolting.github.io/neorv32/#_a_atomic_memory_access)]
|
187 |
66 |
zero_gravi |
[[`B`](https://stnolting.github.io/neorv32/#_b_bit_manipulation_operations)]
|
188 |
60 |
zero_gravi |
[[`C`](https://stnolting.github.io/neorv32/#_c_compressed_instructions)]
|
189 |
|
|
[[`M`](https://stnolting.github.io/neorv32/#_m_integer_multiplication_and_division)]
|
190 |
|
|
[[`U`](https://stnolting.github.io/neorv32/#_u_less_privileged_user_mode)]
|
191 |
|
|
[[`X`](https://stnolting.github.io/neorv32/#_x_neorv32_specific_custom_extensions)]
|
192 |
|
|
[[`Zfinx`](https://stnolting.github.io/neorv32/#_zfinx_single_precision_floating_point_operations)]
|
193 |
|
|
[[`Zicsr`](https://stnolting.github.io/neorv32/#_zicsr_control_and_status_register_access_privileged_architecture)]
|
194 |
66 |
zero_gravi |
[[`Zicntr`](https://stnolting.github.io/neorv32/#_zicntr_cpu_base_counters)]
|
195 |
|
|
[[`Zihpm`](https://stnolting.github.io/neorv32/#_zihpm_hardware_performance_monitors)]
|
196 |
60 |
zero_gravi |
[[`Zifencei`](https://stnolting.github.io/neorv32/#_zifencei_instruction_stream_synchronization)]
|
197 |
61 |
zero_gravi |
[[`Zmmul`](https://stnolting.github.io/neorv32/#_zmmul_integer_multiplication)]
|
198 |
60 |
zero_gravi |
[[`PMP`](https://stnolting.github.io/neorv32/#_pmp_physical_memory_protection)]
|
199 |
63 |
zero_gravi |
[[`DEBUG`](https://stnolting.github.io/neorv32/#_cpu_debug_mode)]**
|
200 |
60 |
zero_gravi |
|
201 |
66 |
zero_gravi |
:warning: The `B`, `Zfinx` and `Zmmul` RISC-V extensions are frozen but not officially ratified yet. Hence, there is no
|
202 |
64 |
zero_gravi |
upstream gcc support. To circumvent this, the NEORV32 software framework provides _intrinsic_ libraries for these extensions.
|
203 |
60 |
zero_gravi |
|
204 |
56 |
zero_gravi |
[[back to top](#The-NEORV32-RISC-V-Processor)]
|
205 |
39 |
zero_gravi |
|
206 |
56 |
zero_gravi |
|
207 |
60 |
zero_gravi |
### FPGA Implementation Results - CPU
|
208 |
23 |
zero_gravi |
|
209 |
62 |
zero_gravi |
Implementation results for _exemplary_ CPU configuration generated for an **Intel Cyclone IV EP4CE22F17C6N FPGA**
|
210 |
60 |
zero_gravi |
using **Intel Quartus Prime Lite 20.1** ("balanced implementation"). The timing information is derived
|
211 |
|
|
from the Timing Analyzer / Slow 1200mV 0C Model. No constraints were used at all.
|
212 |
2 |
zero_gravi |
|
213 |
62 |
zero_gravi |
Results generated for hardware version [`1.5.7.10`](https://github.com/stnolting/neorv32/blob/master/CHANGELOG.md).
|
214 |
2 |
zero_gravi |
|
215 |
60 |
zero_gravi |
| CPU Configuration | LEs | FFs | Memory bits | DSPs (9-bit) | f_max |
|
216 |
|
|
|:--------------------------------------------------|:----:|:----:|:-----------:|:------------:|:-------:|
|
217 |
62 |
zero_gravi |
| `rv32i` | 806 | 359 | 1024 | 0 | 125 MHz |
|
218 |
66 |
zero_gravi |
| `rv32i_Zicsr_Zicntr` | 1729 | 813 | 1024 | 0 | 124 MHz |
|
219 |
|
|
| `rv32imac_Zicsr_Zicntr` | 2511 | 1074 | 1024 | 0 | 124 MHz |
|
220 |
6 |
zero_gravi |
|
221 |
68 |
zero_gravi |
:information_source: An incremental list of CPU extension's hardware utilization can found in the
|
222 |
|
|
[_Data Sheet: FPGA Implementation Results - CPU_](https://stnolting.github.io/neorv32/#_cpu).
|
223 |
62 |
zero_gravi |
|
224 |
68 |
zero_gravi |
:information_source: The CPU (and also the SoC) provides advanced options to optimize for performance, area or energy.
|
225 |
|
|
See [_User Guide: Application-Specific Processor Configuration_](https://stnolting.github.io/neorv32/ug/#_application_specific_processor_configuration)
|
226 |
|
|
for more information.
|
227 |
62 |
zero_gravi |
|
228 |
56 |
zero_gravi |
[[back to top](#The-NEORV32-RISC-V-Processor)]
|
229 |
22 |
zero_gravi |
|
230 |
|
|
|
231 |
60 |
zero_gravi |
### Performance
|
232 |
56 |
zero_gravi |
|
233 |
64 |
zero_gravi |
The NEORV32 CPU is based on a two-stages pipelined architecture. Since both stage use a multi-cycle processing scheme,
|
234 |
61 |
zero_gravi |
each instruction requires several clock cycles to execute (2 cycles for ALU operations, up to 40 cycles for divisions).
|
235 |
|
|
The average CPI (cycles per instruction) depends on the instruction mix of a specific applications and also on the
|
236 |
|
|
available CPU extensions.
|
237 |
2 |
zero_gravi |
|
238 |
62 |
zero_gravi |
The following table shows the performance results (relative CoreMark score and average cycles per instruction) for
|
239 |
68 |
zero_gravi |
_exemplary_ CPU configuration running 2000 iterations of the CoreMark CPU benchmark.
|
240 |
62 |
zero_gravi |
The source files are available in [`sw/example/coremark`](https://github.com/stnolting/neorv32/blob/master/sw/example/coremark).
|
241 |
68 |
zero_gravi |
A simple(!) port of the **Dhrystone** benchmark is also available in
|
242 |
|
|
[`sw/example/dhrystone`](https://github.com/stnolting/neorv32/blob/master/sw/example/dhrystone).
|
243 |
2 |
zero_gravi |
|
244 |
62 |
zero_gravi |
Results generated for hardware version [`1.5.7.10`](https://github.com/stnolting/neorv32/blob/master/CHANGELOG.md).
|
245 |
42 |
zero_gravi |
|
246 |
66 |
zero_gravi |
| CPU Configuration | CoreMark Score | CoreMarks/MHz | Average CPI |
|
247 |
|
|
|:------------------------------------------------|:--------------:|:-------------:|:-----------:|
|
248 |
|
|
| _small_ (`rv32i_Zicsr`) | 33.89 | **0.3389** | **4.04** |
|
249 |
|
|
| _medium_ (`rv32imc_Zicsr`) | 62.50 | **0.6250** | **5.34** |
|
250 |
|
|
| _performance_ (`rv32imc_Zicsr` + perf. options) | 95.23 | **0.9523** | **3.54** |
|
251 |
2 |
zero_gravi |
|
252 |
62 |
zero_gravi |
:information_source: More information regarding the CPU performance can be found in the
|
253 |
68 |
zero_gravi |
[_Data Sheet: CPU Performance_](https://stnolting.github.io/neorv32/#_cpu_performance).
|
254 |
2 |
zero_gravi |
|
255 |
56 |
zero_gravi |
[[back to top](#The-NEORV32-RISC-V-Processor)]
|
256 |
34 |
zero_gravi |
|
257 |
56 |
zero_gravi |
|
258 |
2 |
zero_gravi |
|
259 |
64 |
zero_gravi |
## 4. Software Framework and Tooling
|
260 |
60 |
zero_gravi |
|
261 |
|
|
:books: In-depth detailed information regarding the software framework can be found in the
|
262 |
68 |
zero_gravi |
[_Data Sheet: Software Framework_](https://stnolting.github.io/neorv32/#_software_framework).
|
263 |
60 |
zero_gravi |
|
264 |
|
|
* [core libraries](https://github.com/stnolting/neorv32/tree/master/sw/lib) for high-level usage of the provided functions and peripherals
|
265 |
|
|
* application compilation based on GNU makefiles
|
266 |
|
|
* gcc-based toolchain ([pre-compiled toolchains available](https://github.com/stnolting/riscv-gcc-prebuilt))
|
267 |
|
|
* bootloader with UART interface console
|
268 |
|
|
* runtime environment for handling traps
|
269 |
68 |
zero_gravi |
* several [example programs](https://github.com/stnolting/neorv32/tree/master/sw/example) to get started including CoreMark, FreeRTOS and Conway's Game of Life
|
270 |
65 |
zero_gravi |
* `doxygen`-based documentation, available on :books: [GitHub pages](https://stnolting.github.io/neorv32/sw/files.html)
|
271 |
60 |
zero_gravi |
* supports implementation using open source tooling (GHDL, Yosys and nextpnr; in the future Verilog-to-Routing); both, software and hardware can be
|
272 |
|
|
developed and debugged with open source tooling
|
273 |
65 |
zero_gravi |
* [continuous integration](https://github.com/stnolting/neorv32/actions) :octocat: is available for:
|
274 |
60 |
zero_gravi |
* allowing users to see the expected execution/output of the tools
|
275 |
|
|
* ensuring specification compliance
|
276 |
|
|
* catching regressions
|
277 |
|
|
* providing ready-to-use and up-to-date bitstreams and documentation
|
278 |
|
|
|
279 |
|
|
[[back to top](#The-NEORV32-RISC-V-Processor)]
|
280 |
|
|
|
281 |
|
|
|
282 |
|
|
|
283 |
64 |
zero_gravi |
## 5. Getting Started
|
284 |
2 |
zero_gravi |
|
285 |
60 |
zero_gravi |
This overview provides some *quick links* to the most important sections of the
|
286 |
61 |
zero_gravi |
[online Data Sheet](https://stnolting.github.io/neorv32) and the
|
287 |
60 |
zero_gravi |
[online User Guide](https://stnolting.github.io/neorv32/ug).
|
288 |
2 |
zero_gravi |
|
289 |
59 |
zero_gravi |
### :electric_plug: Hardware Overview
|
290 |
2 |
zero_gravi |
|
291 |
61 |
zero_gravi |
* [Rationale](https://stnolting.github.io/neorv32/#_rationale) - NEORV32: why, how come, what for
|
292 |
|
|
|
293 |
59 |
zero_gravi |
* [NEORV32 Processor](https://stnolting.github.io/neorv32/#_neorv32_processor_soc) - the SoC
|
294 |
|
|
* [Top Entity - Signals](https://stnolting.github.io/neorv32/#_processor_top_entity_signals) - how to connect to the processor
|
295 |
|
|
* [Top Entity - Generics](https://stnolting.github.io/neorv32/#_processor_top_entity_generics) - configuration options
|
296 |
61 |
zero_gravi |
* [Address Space](https://stnolting.github.io/neorv32/#_address_space) - memory layout and boot configuration
|
297 |
59 |
zero_gravi |
* [SoC Modules](https://stnolting.github.io/neorv32/#_processor_internal_modules) - available IO/peripheral modules and memories
|
298 |
61 |
zero_gravi |
* [On-Chip Debugger](https://stnolting.github.io/neorv32/#_on_chip_debugger_ocd) - online & in-system debugging of the processor via JTAG
|
299 |
2 |
zero_gravi |
|
300 |
63 |
zero_gravi |
* [NEORV32 CPU](https://stnolting.github.io/neorv32/#_neorv32_central_processing_unit_cpu) - the CPU
|
301 |
59 |
zero_gravi |
* [RISC-V compatibility](https://stnolting.github.io/neorv32/#_risc_v_compatibility) - what is compatible to the specs. and what is not
|
302 |
66 |
zero_gravi |
* [Full Virtualization](https://stnolting.github.io/neorv32/#_full_virtualization) - hardware execution safety
|
303 |
59 |
zero_gravi |
* [ISA and Extensions](https://stnolting.github.io/neorv32/#_instruction_sets_and_extensions) - available RISC-V ISA extensions
|
304 |
|
|
* [CSRs](https://stnolting.github.io/neorv32/#_control_and_status_registers_csrs) - control and status registers
|
305 |
|
|
* [Traps](https://stnolting.github.io/neorv32/#_traps_exceptions_and_interrupts) - interrupts and exceptions
|
306 |
34 |
zero_gravi |
|
307 |
59 |
zero_gravi |
### :floppy_disk: Software Overview
|
308 |
12 |
zero_gravi |
|
309 |
59 |
zero_gravi |
* [Core Libraries](https://stnolting.github.io/neorv32/#_core_libraries) - high-level functions for accessing the processor's peripherals
|
310 |
|
|
* [Software Framework Documentation](https://stnolting.github.io/neorv32/sw/files.html) - `doxygen`-based documentation
|
311 |
|
|
* [Application Makefiles](https://stnolting.github.io/neorv32/#_application_makefile) - turning your application into an executable
|
312 |
|
|
* [Bootloader](https://stnolting.github.io/neorv32/#_bootloader) - the build-in NEORV32 bootloader
|
313 |
22 |
zero_gravi |
|
314 |
68 |
zero_gravi |
### :rocket: User Guide
|
315 |
31 |
zero_gravi |
|
316 |
60 |
zero_gravi |
* [Toolchain Setup](https://stnolting.github.io/neorv32/ug/#_toolchain_setup) - install and setup RISC-V gcc
|
317 |
|
|
* [General Hardware Setup](https://stnolting.github.io/neorv32/ug/#_general_hardware_setup) - setup a new NEORV32 EDA project
|
318 |
|
|
* [General Software Setup](https://stnolting.github.io/neorv32/ug/#_general_software_framework_setup) - configure the software framework
|
319 |
|
|
* [Application Compilation](https://stnolting.github.io/neorv32/ug/#_application_program_compilation) - compile an application using `make`
|
320 |
|
|
* [Upload via Bootloader](https://stnolting.github.io/neorv32/ug/#_uploading_and_starting_of_a_binary_executable_image_via_uart) - upload and execute executables
|
321 |
63 |
zero_gravi |
* [Application-Specific Processor Configuration](https://stnolting.github.io/neorv32/ug/#_application_specific_processor_configuration) - tailor the processor to your needs
|
322 |
64 |
zero_gravi |
* [Adding Custom Hardware Modules](https://stnolting.github.io/neorv32/ug/#_adding_custom_hardware_modules) - add _your_ custom hardware
|
323 |
60 |
zero_gravi |
* [Debugging via the On-Chip Debugger](https://stnolting.github.io/neorv32/ug/#_debugging_using_the_on_chip_debugger) - step through code *online* and *in-system*
|
324 |
63 |
zero_gravi |
* [Simulation](https://stnolting.github.io/neorv32/ug/#_simulating_the_processor) - simulate the whole SoC
|
325 |
|
|
* [Hello World!](https://stnolting.github.io/neorv32/ug/index.html#_hello_world) - run a quick _"hello world"_ simulation
|
326 |
56 |
zero_gravi |
|
327 |
60 |
zero_gravi |
### :copyright: Legal
|
328 |
|
|
|
329 |
|
|
* [Overview](https://stnolting.github.io/neorv32/#_legal) - license, disclaimer, proprietary notice, ...
|
330 |
61 |
zero_gravi |
* [Citing](https://stnolting.github.io/neorv32/#_citing) - citing information (DOI)
|
331 |
|
|
* [Impressum](https://github.com/stnolting/neorv32/blob/master/docs/impressum.md) - imprint (:de:)
|
332 |
60 |
zero_gravi |
|
333 |
56 |
zero_gravi |
[[back to top](#The-NEORV32-RISC-V-Processor)]
|
334 |
36 |
zero_gravi |
|
335 |
56 |
zero_gravi |
|
336 |
22 |
zero_gravi |
|
337 |
59 |
zero_gravi |
## Acknowledgements
|
338 |
2 |
zero_gravi |
|
339 |
68 |
zero_gravi |
**A big shout-out to the community and all [contributors](https://github.com/stnolting/neorv32/graphs/contributors), who helped improving this project! :heart:**
|
340 |
35 |
zero_gravi |
|
341 |
59 |
zero_gravi |
[RISC-V](https://riscv.org/) - Instruction Sets Want To Be Free!
|
342 |
35 |
zero_gravi |
|
343 |
68 |
zero_gravi |
Continuous integration provided by [:octocat: GitHub Actions](https://github.com/features/actions) and powered by [GHDL](https://github.com/ghdl/ghdl).
|