OpenCores
URL https://opencores.org/ocsvn/neorv32/neorv32/trunk

Subversion Repositories neorv32

[/] [neorv32/] [trunk/] [docs/] [datasheet/] [overview.adoc] - Blame information for rev 71

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 60 zero_gravi
:sectnums:
2
== Overview
3
 
4
The NEORV32footnote:[Pronounced "neo-R-V-thirty-two" or "neo-risc-five-thirty-two" in its long form.] is an open-source
5
RISC-V compatible processor system that is intended as *ready-to-go* auxiliary processor within a larger SoC
6
designs or as stand-alone custom / customizable microcontroller.
7
 
8
The system is highly configurable and provides optional common peripherals like embedded memories,
9
timers, serial interfaces, general purpose IO ports and an external bus interface to connect custom IP like
10
memories, NoCs and other peripherals. On-line and in-system debugging is supported by an OpenOCD/gdb
11
compatible on-chip debugger accessible via JTAG.
12
 
13 66 zero_gravi
Special focus is paid on **execution safety** to provide defined and predictable behavior at any time.
14
Therefore, the CPU ensures that all memory access are acknowledged and no invalid/malformed instructions
15
are executed. Whenever an unexpected situation occurs, the application code is informed via hardware exceptions.
16
 
17 60 zero_gravi
The software framework of the processor comes with application makefiles, software libraries for all CPU
18 65 zero_gravi
and processor features, a bootloader, a runtime environment and several example programs - including a port
19 60 zero_gravi
of the CoreMark MCU benchmark and the official RISC-V architecture test suite. RISC-V GCC is used as
20
default toolchain (https://github.com/stnolting/riscv-gcc-prebuilt[prebuilt toolchains are also provided]).
21
 
22
[TIP]
23 61 zero_gravi
Check out the processor's **https://stnolting.github.io/neorv32/ug[online User Guide]**
24 70 zero_gravi
that provides hands-on tutorials to get you started.
25 60 zero_gravi
The project's change log is available in https://github.com/stnolting/neorv32/blob/master/CHANGELOG.md[CHANGELOG.md]
26
in the root directory of the NEORV32 repository. Please also check out the <<_legal>> section.
27
 
28
 
29 61 zero_gravi
**Structure**
30 60 zero_gravi
 
31 65 zero_gravi
[start=2]
32 64 zero_gravi
. <<_neorv32_processor_soc>>
33
. <<_neorv32_central_processing_unit_cpu>>
34 65 zero_gravi
. <<_software_framework>>
35 64 zero_gravi
. <<_on_chip_debugger_ocd>>
36 60 zero_gravi
 
37
 
38
 
39 61 zero_gravi
<<<
40
// ####################################################################################################################
41 60 zero_gravi
 
42 71 zero_gravi
include::rationale.adoc[]
43 60 zero_gravi
 
44
 
45
 
46
// ####################################################################################################################
47
:sectnums:
48
=== Project Key Features
49
 
50 61 zero_gravi
* open-source and documented; including user guides to get started
51
* completely described in behavioral, platform-independent VHDL (yet platform-optimized modules are provided)
52
* fully synchronous design, no latches, no gated clocks
53
* small hardware footprint and high operating frequency for easy integration
54
* **NEORV32 CPU**: 32-bit `rv32i` RISC-V CPU
55
** RISC-V compatibility: passes the official architecture tests
56
** base architecture + privileged architecture (optional) + ISA extensions (optional)
57
** rich set of customization options (ISA extensions, design goal: performance / area (/ energy), ...)
58 62 zero_gravi
** aims to support <<_full_virtualization>> capabilities (CPU _and_ SoC) to increase execution safety
59 61 zero_gravi
** official https://github.com/riscv/riscv-isa-manual/blob/master/marchid.md[RISC-V open source architecture ID]
60
* **NEORV32 Processor (SoC)**: highly-configurable full-scale microcontroller-like processor system
61
** based on the NEORV32 CPU
62
** optional serial interfaces (UARTs, TWI, SPI)
63
** optional timers and counters (WDT, MTIME)
64
** optional general purpose IO and PWM and native NeoPixel (c) compatible smart LED interface
65
** optional embedded memories / caches for data, instructions and bootloader
66
** optional external memory interface (Wishbone / AXI4-Lite) and stream link interface (AXI4-Stream) for custom connectivity
67 70 zero_gravi
** optional execute in place (XIP) module
68 61 zero_gravi
** on-chip debugger compatible with OpenOCD and gdb
69 60 zero_gravi
* **Software framework**
70
** GCC-based toolchain - prebuilt toolchains available; application compilation based on GNU makefiles
71
** internal bootloader with serial user interface
72
** core libraries for high-level usage of the provided functions and peripherals
73
** runtime environment and several example programs
74
** doxygen-based documentation of the software framework; a deployed version is available at https://stnolting.github.io/neorv32/sw/files.html
75
** FreeRTOS port + demos available
76
 
77 61 zero_gravi
[TIP]
78
For more in-depth details regarding the feature provided by he hardware see the according sections:
79
<<_neorv32_central_processing_unit_cpu>> and <<_neorv32_processor_soc>>.
80 60 zero_gravi
 
81 61 zero_gravi
 
82 60 zero_gravi
<<<
83
// ####################################################################################################################
84
:sectnums:
85
=== Project Folder Structure
86
 
87
...................................
88 63 zero_gravi
neorv32                - Project home folder
89 62 zero_gravi
90 63 zero_gravi
├docs                  - Project documentation
91 66 zero_gravi
│├datasheet            - AsciiDoc sources for the NEORV32 data sheet
92 63 zero_gravi
│├figures              - Figures and logos
93
│├icons                - Misc. symbols
94
│├references           - Data sheets and RISC-V specs.
95 66 zero_gravi
│└userguide            - AsciiDoc sources for the NEORV32 user guide
96 62 zero_gravi
97 63 zero_gravi
├rtl                   - VHDL sources
98
│├core                 - Core sources of the CPU & SoC
99 64 zero_gravi
││└mem                 - SoC-internal memories (default architectures)
100 63 zero_gravi
│├processor_templates  - Pre-configured SoC wrappers
101
│├system_integration   - System wrappers for advanced connectivity
102
│└test_setups          - Minimal test setup "SoCs" used in the User Guide
103 62 zero_gravi
104 63 zero_gravi
├sim                   - Simulation files (see User Guide)
105 62 zero_gravi
106 63 zero_gravi
└sw                    - Software framework
107 66 zero_gravi
 ├bootloader           - Sources of the processor-internal bootloader
108
 ├common               - Linker script, crt0.S start-up code and central makefile
109 63 zero_gravi
 ├example              - Various example programs
110 60 zero_gravi
 │└...
111 69 zero_gravi
 ├lib                  - Processor core library
112
 │├include             - Header files (*.h)
113
 │└source              - Source files (*.c)
114
 ├image_gen            - Helper program to generate NEORV32 executables
115 62 zero_gravi
 ├isa-test
116 63 zero_gravi
 │├riscv-arch-test     - RISC-V spec. compatibility test framework (submodule)
117
 │└port-neorv32        - Port files for the official RISC-V architecture tests
118 66 zero_gravi
 ├ocd_firmware         - Source code for on-chip debugger's "park loop"
119 63 zero_gravi
 ├openocd              - OpenOCD on-chip debugger configuration files
120 69 zero_gravi
 └svd                  - Processor system view description file (CMSIS-SVD)
121 60 zero_gravi
...................................
122
 
123
 
124
 
125
<<<
126
// ####################################################################################################################
127
:sectnums:
128
=== VHDL File Hierarchy
129
 
130 68 zero_gravi
All necessary VHDL hardware description files are located in the project's `rtl/core` folder. The top entity
131 60 zero_gravi
of the entire processor including all the required configuration generics is **`neorv32_top.vhd`**.
132
 
133
[IMPORTANT]
134
All core VHDL files from the list below have to be assigned to a new design library named **`neorv32`**. Additional
135
files, like alternative top entities, can be assigned to any library.
136
 
137
...................................
138 61 zero_gravi
neorv32_top.vhd                  - NEORV32 Processor top entity
139
140
├neorv32_fifo.vhd                - General purpose FIFO component
141
├neorv32_package.vhd             - Processor/CPU main VHDL package file
142
143
├neorv32_cpu.vhd                 - NEORV32 CPU top entity
144
│├neorv32_cpu_alu.vhd            - Arithmetic/logic unit
145 63 zero_gravi
││├neorv32_cpu_cp_bitmanip.vhd   - Bit-manipulation co-processor (B ext.)
146 61 zero_gravi
││├neorv32_cpu_cp_fpu.vhd        - Floating-point co-processor (Zfinx ext.)
147
││├neorv32_cpu_cp_muldiv.vhd     - Mul/Div co-processor (M extension)
148
││└neorv32_cpu_cp_shifter.vhd    - Bit-shift co-processor
149
│├neorv32_cpu_bus.vhd            - Bus interface + physical memory protection
150
│├neorv32_cpu_control.vhd        - CPU control, exception/IRQ system and CSRs
151
││└neorv32_cpu_decompressor.vhd  - Compressed instructions decoder
152
│└neorv32_cpu_regfile.vhd        - Data register file
153
154
├neorv32_boot_rom.vhd            - Bootloader ROM
155
│└neorv32_bootloader_image.vhd   - Bootloader boot ROM memory image
156
├neorv32_busswitch.vhd           - Processor bus switch for CPU buses (I&D)
157
├neorv32_bus_keeper.vhd          - Processor-internal bus monitor
158
├neorv32_cfs.vhd                 - Custom functions subsystem
159
├neorv32_debug_dm.vhd            - on-chip debugger: debug module
160
├neorv32_debug_dtm.vhd           - on-chip debugger: debug transfer module
161 64 zero_gravi
├neorv32_dmem.entity.vhd         - Processor-internal data memory (entity-only!)
162 61 zero_gravi
├neorv32_gpio.vhd                - General purpose input/output port unit
163 67 zero_gravi
├neorv32_gptmr.vhd               - General purpose 32-bit timer
164 62 zero_gravi
├neorv32_icache.vhd              - Processor-internal instruction cache
165 64 zero_gravi
├neorv32_imem.entity.vhd         - Processor-internal instruction memory (entity-only!)
166 61 zero_gravi
│└neor32_application_image.vhd   - IMEM application initialization image
167
├neorv32_mtime.vhd               - Machine system timer
168
├neorv32_neoled.vhd              - NeoPixel (TM) compatible smart LED interface
169
├neorv32_pwm.vhd                 - Pulse-width modulation controller
170 67 zero_gravi
├neorv32_slink.vhd               - Stream link controller
171 61 zero_gravi
├neorv32_spi.vhd                 - Serial peripheral interface controller
172
├neorv32_sysinfo.vhd             - System configuration information memory
173
├neorv32_trng.vhd                - True random number generator
174
├neorv32_twi.vhd                 - Two wire serial interface controller
175
├neorv32_uart.vhd                - Universal async. receiver/transmitter
176
├neorv32_wdt.vhd                 - Watchdog timer
177
├neorv32_wishbone.vhd            - External (Wishbone) bus interface
178 70 zero_gravi
├neorv32_xip.vhd                 - Execute in place module
179 67 zero_gravi
├neorv32_xirq.vhd                - External interrupt controller
180 64 zero_gravi
181 68 zero_gravi
├mem/neorv32_dmem.default.vhd    - _Default_ data memory (architecture-only)
182
└mem/neorv32_imem.default.vhd    - _Default_ instruction memory (architecture-only)
183 60 zero_gravi
...................................
184
 
185 64 zero_gravi
[NOTE]
186
The processor-internal instruction and data memories (IMEM and DMEM) are split into two design files each:
187
a plain entity definition (`neorv32_*mem.entity.vhd`) and the actual architecture definition
188 68 zero_gravi
(`mem/neorv32_*mem.default.vhd`). The `*.default.vhd` architecture definitions from `rtl/core/mem` provide a _generic_ and
189 64 zero_gravi
_platform independent_ memory design that (should) infers embedded memory blocks. You can replace/modify the architecture
190
source file in order to use platform-specific features (like advanced memory resources) or to improve technology mapping
191
and/or timing.
192 60 zero_gravi
 
193 64 zero_gravi
 
194 60 zero_gravi
<<<
195
// ####################################################################################################################
196
:sectnums:
197
=== FPGA Implementation Results
198
 
199 62 zero_gravi
This chapter shows _exemplary_ implementation results of the NEORV32 CPU and NEORV32 Processor.
200 60 zero_gravi
 
201
:sectnums:
202
==== CPU
203
 
204
[cols="<2,<8"]
205
[grid="topbot"]
206
|=======================
207 70 zero_gravi
| Top entity: | `rtl/core/neorv32_cpu.vhd`
208
| FPGA:       | Intel Cyclone IV E `EP4CE22F17C6`
209
| Toolchain:  | Quartus Prime 20.1.0
210 60 zero_gravi
|=======================
211
 
212
[cols="<5,>1,>1,>1,>1,>1"]
213
[options="header",grid="rows"]
214
|=======================
215 66 zero_gravi
| CPU                                               | LEs  | FFs  | MEM bits | DSPs | _f~max~_
216
| `rv32i`                                           |  806 |  359 |     1024 |    0 | 125 MHz
217
| `rv32i_Zicsr_Zicntr`                              | 1729 |  813 |     1024 |    0 | 124 MHz
218
| `rv32im_Zicsr_Zicntr`                             | 2269 | 1055 |     1024 |    0 | 124 MHz
219
| `rv32imc_Zicsr_Zicntr`                            | 2501 | 1070 |     1024 |    0 | 124 MHz
220
| `rv32imac_Zicsr_Zicntr`                           | 2511 | 1074 |     1024 |    0 | 124 MHz
221
| `rv32imacu_Zicsr_Zicntr`                          | 2521 | 1079 |     1024 |    0 | 124 MHz
222
| `rv32imacu_Zicsr_Zicntr_Zifencei`                 | 2522 | 1079 |     1024 |    0 | 122 MHz
223
| `rv32imacu_Zicsr_Zicntr_Zifencei_Zfinx`           | 3807 | 1731 |     1024 |    7 | 116 MHz
224
| `rv32imacu_Zicsr_Zicntr_Zifencei_Zfinx_DebugMode` | 3974 | 1815 |     1024 |    7 | 116 MHz
225 60 zero_gravi
|=======================
226
 
227 62 zero_gravi
[TIP]
228
The CPU provides further options to reduce the area footprint (for example by constraining the CPU-internal
229
counter sizes) or to increase performance (for example by using a barrel-shifter; at cost of extra hardware).
230 63 zero_gravi
See section <<_processor_top_entity_generics>> for more information. Also, take a look at the User Guide section
231
https://stnolting.github.io/neorv32/ug/#_application_specific_processor_configuration[Application-Specific Processor Configuration].
232 62 zero_gravi
 
233
 
234 60 zero_gravi
:sectnums:
235
==== Processor Modules
236
 
237
[cols="<2,<8"]
238
[grid="topbot"]
239
|=======================
240 70 zero_gravi
| Top entity: | `rtl/core/neorv32_top.vhd`
241
| FPGA:       | Intel Cyclone IV E `EP4CE22F17C6`
242
| Toolchain:  | Quartus Prime 20.1.0
243 60 zero_gravi
|=======================
244
 
245
.Hardware utilization by the processor modules (mandatory core modules in **bold**)
246
[cols="<2,<8,>1,>1,>2,>1"]
247
[options="header",grid="rows"]
248
|=======================
249 62 zero_gravi
| Module        | Description                                           | LEs | FFs | MEM bits | DSPs
250
| Boot ROM      | Bootloader ROM (4kB)                                  |   2 |   1 |    32768 |    0
251
| **BUSKEEPER** | Processor-internal bus monitor                        |   9 |   6 |        0 |    0
252 70 zero_gravi
| **BUSSWITCH** | Bus multiplexer for CPU instr. and data interface     |  63 |   8 |        0 |    0
253 61 zero_gravi
| CFS           | Custom functions subsystemfootnote:[Resource utilization depends on actually implemented custom functionality.] | - | - | - | -
254 62 zero_gravi
| DMEM          | Processor-internal data memory (8kB)                  |  19 |   2 |    65536 |    0
255
| DM            | On-chip debugger - debug module                       | 493 | 240 |        0 |    0
256
| DTM           | On-chip debugger - debug transfer module (JTAG)       | 254 | 218 |        0 |    0
257
| GPIO          | General purpose input/output ports                    | 134 | 161 |        0 |    0
258
| iCACHE        | Instruction cache (1x4 blocks, 256 bytes per block)   | 2 21| 156 |     8192 |    0
259
| IMEM          | Processor-internal instruction memory (16kB)          |  13 |   2 |   131072 |    0
260
| MTIME         | Machine system timer                                  | 319 | 167 |        0 |    0
261
| NEOLED        | Smart LED Interface (NeoPixel/WS28128) [FIFO_depth=1] | 226 | 182 |        0 |    0
262
| SLINK         | Stream link interface (2xRX, 2xTX, FIFO_depth=1)      | 208 | 181 |        0 |    0
263
| PWM           | Pulse_width modulation controller (4 channels)        |  71 |  69 |        0 |    0
264
| SPI           | Serial peripheral interface                           | 148 | 127 |        0 |    0
265
| **SYSINFO**   | System configuration information memory               |  14 |  11 |        0 |    0
266
| TRNG          | True random number generator                          |  89 |  76 |        0 |    0
267
| TWI           | Two-wire interface                                    |  77 |  43 |        0 |    0
268
| UART0/1       | Universal asynchronous receiver/transmitter 0/1       | 183 | 132 |        0 |    0
269
| WDT           | Watchdog timer                                        |  53 |  43 |        0 |    0
270
| WISHBONE      | External memory interface                             | 114 | 110 |        0 |    0
271
| XIRQ          | External interrupt controller (32 channels)           | 241 | 201 |        0 |    0
272 67 zero_gravi
| GPTMR         | General Purpose Timer                                 | 153 | 107 |        0 |    0
273 70 zero_gravi
| XIP           | Execute in place module                               | 305 | 243 |        0 |    0
274 60 zero_gravi
|=======================
275
 
276
 
277
<<<
278
:sectnums:
279
==== Exemplary Setups
280
 
281 71 zero_gravi
Check out the `neorv32-setups` repository (@GitHub: https://github.com/stnolting/neorv32-setups),
282 61 zero_gravi
which provides several demo setups for various FPGA boards and toolchains.
283 60 zero_gravi
 
284
 
285
<<<
286
// ####################################################################################################################
287
:sectnums:
288
=== CPU Performance
289
 
290 62 zero_gravi
The performance of the NEORV32 was tested and evaluated using the https://www.eembc.org/coremark/[Core Mark CPU benchmark].
291
This benchmark focuses on testing the capabilities of the CPU core itself rather than the performance of the whole
292
system. The according sources can be found in the `sw/example/coremark` folder.
293 60 zero_gravi
 
294 63 zero_gravi
.Dhrystone
295
[TIP]
296
A _simple_ port of the Dhrystone benchmark is also available in `sw/example/dhrystone`.
297
 
298 60 zero_gravi
The resulting CoreMark score is defined as CoreMark iterations per second.
299
The execution time is determined via the RISC-V `[m]cycle[h]` CSRs. The relative CoreMark score is
300
defined as CoreMark score divided by the CPU's clock frequency in MHz.
301
 
302 62 zero_gravi
.Configuration
303 60 zero_gravi
[cols="<2,<8"]
304
[grid="topbot"]
305
|=======================
306 62 zero_gravi
| HW version:     | `1.5.7.10`
307
| Hardware:       | 32kB int. IMEM, 16kB int. DMEM, no caches, 100MHz clock
308
| CoreMark:       | 2000 iterations, MEM_METHOD is MEM_STACK
309
| Compiler:       | RISCV32-GCC 10.2.0
310
| Compiler flags: | default, see makefile
311 60 zero_gravi
|=======================
312
 
313
.CoreMark results
314 62 zero_gravi
[cols="<4,^1,^1,^1"]
315 60 zero_gravi
[options="header",grid="rows"]
316
|=======================
317 66 zero_gravi
| CPU                                             | CoreMark Score | CoreMarks/MHz | Average CPI
318
| _small_ (`rv32i_Zicsr`)                         |          33.89 | **0.3389**    | **4.04**
319
| _medium_ (`rv32imc_Zicsr`)                      |          62.50 | **0.6250**    | **5.34**
320
| _performance_ (`rv32imc_Zicsr` + perf. options) |          95.23 | **0.9523**    | **3.54**
321 60 zero_gravi
|=======================
322
 
323 71 zero_gravi
[IMPORTANT]
324
The CoreMark results were generated using a `rv32i` toolchain. This toolchain supports standard extensions
325
like `M` and `C` but the built-in libraries only use the base `I` ISA.
326
 
327 60 zero_gravi
[NOTE]
328 62 zero_gravi
The "_performance_" CPU configuration uses the <<_fast_mul_en>> and <<_fast_shift_en>> options.
329 60 zero_gravi
 
330 62 zero_gravi
[NOTE]
331 60 zero_gravi
The NEORV32 CPU is based on a multi-cycle architecture. Each instruction is executed in a sequence of
332 62 zero_gravi
several consecutive micro operations.
333 60 zero_gravi
 
334 62 zero_gravi
[NOTE]
335 60 zero_gravi
The average CPI (cycles per instruction) depends on the instruction mix of a specific applications and also on
336 62 zero_gravi
the available CPU extensions. The average CPI is computed by dividing the total number of required clock cycles
337
(only the timed core to avoid distortion due to IO wait cycles) by the number of executed instructions
338
(`[m]instret[h]` CSRs).
339 60 zero_gravi
 
340
[TIP]
341
More information regarding the execution time of each implemented instruction can be found in
342
chapter <<_instruction_timing>>.

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.