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

Subversion Repositories neorv32

[/] [neorv32/] [trunk/] [README.md] - Blame information for rev 53

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

Line No. Rev Author Line
1 50 zero_gravi
[![NEORV32](https://raw.githubusercontent.com/stnolting/neorv32/master/docs/figures/neorv32_logo_dark.png)](https://github.com/stnolting/neorv32)
2 2 zero_gravi
 
3 37 zero_gravi
# The NEORV32 RISC-V Processor
4
 
5 43 zero_gravi
[![Processor Check](https://github.com/stnolting/neorv32/workflows/Processor%20Check/badge.svg)](https://github.com/stnolting/neorv32/actions?query=workflow%3A%22Processor+Check%22)
6 52 zero_gravi
[![riscv-arch-test](https://github.com/stnolting/neorv32/actions/workflows/riscv-arch-test.yml/badge.svg)](https://github.com/stnolting/neorv32/actions/workflows/riscv-arch-test.yml)
7 2 zero_gravi
[![license](https://img.shields.io/github/license/stnolting/neorv32)](https://github.com/stnolting/neorv32/blob/master/LICENSE)
8
[![release](https://img.shields.io/github/v/release/stnolting/neorv32)](https://github.com/stnolting/neorv32/releases)
9
 
10 32 zero_gravi
* [Overview](#Overview)
11 47 zero_gravi
* [Status](#Status)
12 2 zero_gravi
* [Features](#Features)
13
* [FPGA Implementation Results](#FPGA-Implementation-Results)
14
* [Performance](#Performance)
15 30 zero_gravi
* [Top Entities](#Top-Entities)
16 2 zero_gravi
* [**Getting Started**](#Getting-Started)
17 40 zero_gravi
* [Contribute/Feedback/Questions](#ContributeFeedbackQuestions)
18 2 zero_gravi
* [Legal](#Legal)
19
 
20
 
21
 
22 32 zero_gravi
## Overview
23 2 zero_gravi
 
24 23 zero_gravi
The NEORV32 Processor is a customizable microcontroller-like system on chip (SoC) that is based
25 52 zero_gravi
on the RISC-V NEORV32 CPU. The processor is intended as *ready-to-go* auxiliary processor within a larger SoC
26 37 zero_gravi
designs or as stand-alone custom microcontroller.
27 2 zero_gravi
 
28 51 zero_gravi
:books: For detailed information take a look at the [NEORV32 data sheet (pdf)](https://raw.githubusercontent.com/stnolting/neorv32/master/docs/NEORV32.pdf).
29
The doxygen-based documentation of the *software framework* is available online at [GitHub-pages](https://stnolting.github.io/neorv32/files.html).
30 45 zero_gravi
 
31 51 zero_gravi
:label: The project’s change log is available as [CHANGELOG.md](https://github.com/stnolting/neorv32/blob/master/CHANGELOG.md) in the root directory of this repository.
32
To see the changes between *stable* releases visit the project's [release page](https://github.com/stnolting/neorv32/releases).
33 11 zero_gravi
 
34 52 zero_gravi
:spiral_notepad: Check out the [project boards](https://github.com/stnolting/neorv32/projects) for a list of current **ideas**,
35
**TODOs**, features being **planned** and **work-in-progress**.
36 40 zero_gravi
 
37 51 zero_gravi
: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)
38
if you have questions, comments, ideas or bug-fixes. Check out how to [contribute](#ContributeFeedbackQuestions).
39 47 zero_gravi
 
40 51 zero_gravi
 
41 32 zero_gravi
### Key Features
42 2 zero_gravi
 
43 52 zero_gravi
* RISC-V 32-bit `rv32` [**NEORV32 CPU**](#NEORV32-CPU-Features), compatible to
44 51 zero_gravi
  * subset of the *Unprivileged ISA Specification* [(Version 2.2)](https://github.com/stnolting/neorv32/blob/master/docs/riscv-spec.pdf)
45
  * subset of the *Privileged Architecture Specification* [(Version 1.12-draft)](https://github.com/stnolting/neorv32/blob/master/docs/riscv-privileged.pdf)
46 52 zero_gravi
  * the [official RISC-V architecture tests](#Status) (*passing*)
47
* Configurable RISC-V-compatible CPU extensions
48 51 zero_gravi
  * [`A`](#A---Atomic-memory-access-extension) - atomic memory access instructions (optional)
49 52 zero_gravi
  * [`B`](#B---Bit-manipulation-instructions-extension) - Bit manipulation instructions (optional) :construction:
50 51 zero_gravi
  * [`C`](#C---Compressed-instructions-extension) - compressed instructions (16-bit) (optional)
51
  * [`E`](#E---Embedded-CPU-version-extension) - embedded CPU (reduced register file size) (optional)
52
  * [`I`](#I---Base-integer-instruction-set) - base integer instruction set (always enabled)
53
  * [`M`](#M---Integer-multiplication-and-division-hardware-extension) - integer multiplication and division hardware (optional)
54
  * [`U`](#U---Privileged-architecture---User-mode-extension) - less-privileged *user mode* (optional)
55
  * [`X`](#X---NEORV32-specific-CPU-extensions) - NEORV32-specific extensions (always enabled)
56
  * [`Zicsr`](#Zicsr---Privileged-architecture---CSR-access-extension) - control and status register access instructions (+ exception/irq system) (optional)
57
  * [`Zifencei`](#Zifencei---Privileged-architecture---Instruction-stream-synchronization-extension) - instruction stream synchronization (optional)
58
  * [`PMP`](#PMP---Privileged-architecture---Physical-memory-protection) - physical memory protection (optional)
59
  * [`HPM`](#HPM---Privileged-architecture---Hardware-performance-monitors) - hardware performance monitors (optional)
60 39 zero_gravi
* Full-scale RISC-V microcontroller system / **SoC** [**NEORV32 Processor**](#NEORV32-Processor-Features) with optional submodules
61 41 zero_gravi
  * optional embedded memories (instructions/data/bootloader, RAM/ROM) and caches
62 52 zero_gravi
  * timers (watch dog, RISC-V-compatible machine timer)
63 50 zero_gravi
  * serial interfaces (SPI, TWI, UARTs)
64 47 zero_gravi
  * general purpose IO and PWM channels
65 37 zero_gravi
  * external bus interface (Wishbone / [AXI4](#AXI4-Connectivity))
66 53 zero_gravi
  * dedicated NeoPixel(TM) LED interface
67 48 zero_gravi
  * subsystem for custom co-processors
68 37 zero_gravi
  * [more ...](#NEORV32-Processor-Features)
69 36 zero_gravi
* Software framework
70 37 zero_gravi
  * core libraries for high-level usage of the provided functions and peripherals
71
  * application compilation based on [GNU makefiles](https://github.com/stnolting/neorv32/blob/master/sw/example/blink_led/makefile)
72 46 zero_gravi
  * GCC-based toolchain ([pre-compiled toolchains available](https://github.com/stnolting/riscv-gcc-prebuilt))
73 45 zero_gravi
  * bootloader with UART interface console
74 36 zero_gravi
  * runtime environment
75
  * several example programs
76 49 zero_gravi
  * [doxygen-based](https://github.com/stnolting/neorv32/blob/master/docs/doxygen_makefile_sw) software documentation: available on [GitHub pages](https://stnolting.github.io/neorv32/files.html)
77 36 zero_gravi
  * [FreeRTOS port](https://github.com/stnolting/neorv32/blob/master/sw/example/demo_freeRTOS) available
78 34 zero_gravi
* [**Full-blown data sheet**](https://raw.githubusercontent.com/stnolting/neorv32/master/docs/NEORV32.pdf) (pdf)
79 32 zero_gravi
* Completely described in behavioral, platform-independent VHDL - no primitives, macros, etc.
80
* Fully synchronous design, no latches, no gated clocks
81
* Small hardware footprint and high operating frequency
82 15 zero_gravi
 
83 22 zero_gravi
 
84 2 zero_gravi
### Design Principles
85
 
86 39 zero_gravi
 * From zero to *hello_world*: Completely open source and documented.
87 2 zero_gravi
 * Plain VHDL without technology-specific parts like attributes, macros or primitives.
88
 * Easy to use – working out of the box.
89
 * Clean synchronous design, no wacky combinatorial interfaces.
90 51 zero_gravi
 * Be as small as possible – but with a reasonable size-performance trade-off.
91 40 zero_gravi
 * Be as RISC-V-compliant as possible.
92 51 zero_gravi
 * The processor has to fit in a Lattice iCE40 UltraPlus 5k low-power FPGA running at 22+ MHz.
93 2 zero_gravi
 
94
 
95 36 zero_gravi
### Status
96 3 zero_gravi
 
97 31 zero_gravi
The processor is [synthesizable](#FPGA-Implementation-Results) (tested on *real hardware* using Intel Quartus Prime, Xilinx Vivado and Lattice Radiant/Synplify Pro) and can successfully execute
98 30 zero_gravi
all the [provided example programs](https://github.com/stnolting/neorv32/tree/master/sw/example) including the [CoreMark benchmark](#CoreMark-Benchmark).
99 2 zero_gravi
 
100 52 zero_gravi
**RISC-V Architecture Tests**: The processor passes the official `rv32_m/C`, `rv32_m/I`, `rv32_m/M`, `rv32_m/privilege` and `rv32_m/Zifencei`
101
[riscv-arch-test](https://github.com/riscv/riscv-arch-test) tests. More information regarding the NEORV32 port of the riscv-arch-test test framework can be found in
102
[`riscv-arch-test/README.md`](https://github.com/stnolting/neorv32/blob/master/riscv-arch-test/README.md).
103 2 zero_gravi
 
104 43 zero_gravi
| Project component | CI status |
105
|:----------------- |:----------|
106 52 zero_gravi
| [NEORV32 processor](https://github.com/stnolting/neorv32)                                              | [![Processor Check](https://github.com/stnolting/neorv32/workflows/Processor%20Check/badge.svg)](https://github.com/stnolting/neorv32/actions?query=workflow%3A%22Processor+Check%22) |
107
| [SW Framework Documentation (online at GH-pages)](https://stnolting.github.io/neorv32/files.html)        | [![Doc@GitHub-pages](https://github.com/stnolting/neorv32/workflows/Deploy%20SW%20Framework%20Documentation%20to%20GitHub-Pages/badge.svg)](https://stnolting.github.io/neorv32/files.html) |
108
| [Pre-built toolchains](https://github.com/stnolting/riscv-gcc-prebuilt)                                | [![Test Toolchains](https://github.com/stnolting/riscv-gcc-prebuilt/workflows/Test%20Toolchains/badge.svg)](https://github.com/stnolting/riscv-gcc-prebuilt/actions?query=workflow%3A%22Test+Toolchains%22) |
109
| [RISC-V architecture test](https://github.com/stnolting/neorv32/blob/master/riscv-arch-test/README.md) | [![riscv-arch-test](https://github.com/stnolting/neorv32/actions/workflows/riscv-arch-test.yml/badge.svg)](https://github.com/stnolting/neorv32/actions/workflows/riscv-arch-test.yml) |
110 6 zero_gravi
 
111
 
112 2 zero_gravi
## Features
113
 
114 34 zero_gravi
The full-blown data sheet of the NEORV32 Processor and CPU is available as pdf file:
115 40 zero_gravi
[:page_facing_up: NEORV32 data sheet](https://raw.githubusercontent.com/stnolting/neorv32/master/docs/NEORV32.pdf).
116 31 zero_gravi
 
117 44 zero_gravi
 
118 36 zero_gravi
### NEORV32 Processor Features
119 2 zero_gravi
 
120 11 zero_gravi
![neorv32 Overview](https://raw.githubusercontent.com/stnolting/neorv32/master/docs/figures/neorv32_processor.png)
121
 
122 23 zero_gravi
The NEORV32 Processor provides a full-scale microcontroller-like SoC based on the NEORV32 CPU. The setup
123 37 zero_gravi
is highly customizable via the processor's top generics and already provides the following *optional* modules:
124 2 zero_gravi
 
125 41 zero_gravi
* processor-internal data and instruction memories (**DMEM** / **IMEM**) & cache (**iCACHE**)
126
* bootloader (**BOOTLDROM**) with UART console and automatic application boot from SPI flash option
127 52 zero_gravi
* machine system timer (**MTIME**), RISC-V-compatible
128 37 zero_gravi
* watchdog timer (**WDT**)
129 51 zero_gravi
* two independent universal asynchronous receivers and transmitters (**UART0** & **UART1**) with optional hardware flow control (RTS/CTS)
130 37 zero_gravi
* 8/16/24/32-bit serial peripheral interface controller (**SPI**) with 8 dedicated chip select lines
131
* two wire serial interface controller (**TWI**), with optional clock-stretching, compatible to the I²C standard
132
* general purpose parallel IO port (**GPIO**), 32xOut & 32xIn, with pin-change interrupt
133 52 zero_gravi
* 32-bit external bus interface, Wishbone b4 compatible (**WISHBONE**)
134 37 zero_gravi
* wrapper for **AXI4-Lite Master Interface** (see [AXI Connectivity](#AXI4-Connectivity))
135
* PWM controller with 4 channels and 8-bit duty cycle resolution (**PWM**)
136 47 zero_gravi
* ring-oscillator-based true random number generator (**TRNG**)
137
* custom functions subsystem (**CFS**) for tightly-coupled custom co-processor extensions
138 49 zero_gravi
* numerically-controlled oscillator (**NCO**) with three independent channels
139 52 zero_gravi
* smart LED interface (**NEOLED**) - WS2812 / NeoPixel(c) compatible
140 51 zero_gravi
* system configuration information memory to check hardware configuration by software (**SYSINFO**)
141 23 zero_gravi
 
142 44 zero_gravi
 
143 36 zero_gravi
### NEORV32 CPU Features
144 2 zero_gravi
 
145 52 zero_gravi
The NEORV32 CPU implements the
146 12 zero_gravi
[official RISC-V specifications (2.2)](https://raw.githubusercontent.com/stnolting/neorv32/master/docs/riscv-spec.pdf) including a subset of the
147 40 zero_gravi
[RISC-V privileged architecture specifications (1.12-draft)](https://raw.githubusercontent.com/stnolting/neorv32/master/docs/riscv-spec.pdf)
148 52 zero_gravi
- tested via the [official riscv-arch-test Test Framework](https://github.com/riscv/riscv-arch-test)
149
(see [`riscv-arch-test/README`](https://github.com/stnolting/neorv32/blob/master/riscv-arch-test/README.md)).
150 2 zero_gravi
 
151 11 zero_gravi
More information regarding the CPU including a detailed list of the instruction set and the available CSRs can be found in
152 40 zero_gravi
the [:page_facing_up: NEORV32 data sheet](https://raw.githubusercontent.com/stnolting/neorv32/master/docs/NEORV32.pdf).
153 11 zero_gravi
 
154
 
155 47 zero_gravi
#### General Features
156
 
157 26 zero_gravi
  * Modified Harvard architecture (separate CPU interfaces for data and instructions; NEORV32 processor: Single processor-internal bus via I/D mux)
158 12 zero_gravi
  * Two stages in-order pipeline (FETCH, EXECUTE); each stage uses a multi-cycle processing scheme
159 15 zero_gravi
  * No hardware support of unaligned accesses - they will trigger an exception
160 40 zero_gravi
  * BIG-ENDIAN byte-order, processor's external memory interface allows endianness configuration to connect to system with different endianness
161 23 zero_gravi
  * All reserved or unimplemented instructions will raise an illegal instruction exception
162 15 zero_gravi
  * Privilege levels: `machine` mode, `user` mode (if enabled via `U` extension)
163 33 zero_gravi
  * Official [RISC-V open-source architecture ID](https://github.com/riscv/riscv-isa-manual/blob/master/marchid.md)
164 11 zero_gravi
 
165
 
166 51 zero_gravi
#### `A` - Atomic memory access extension
167 2 zero_gravi
 
168 47 zero_gravi
  * Supported instructions: `LR.W` (load-reservate) `SC.W` (store-conditional)
169
 
170
 
171 51 zero_gravi
#### `B` - Bit manipulation instructions extension
172 47 zero_gravi
 
173 53 zero_gravi
  * :construction: **work-in-progress** :construction:
174
  * :warning: this extension has not been officially ratified yet!
175
  * :books: more information can be found here: [RISC-V `B` spec.](https://github.com/riscv/riscv-bitmanip)
176 47 zero_gravi
  * Compatible to [v0.94-draft](https://raw.githubusercontent.com/stnolting/neorv32/master/docs/bitmanip-draft.pdf) of the bit manipulation spec
177
  * Support via intrisc library (see [`sw/example/bit_manipulation`](https://github.com/stnolting/neorv32/tree/master/sw/example/bit_manipulation))
178 52 zero_gravi
  * `Zbb` base instruction set: `CLZ` `CTZ` `CPOP` `SEXT.B` `SEXT.H` `MIN[U]` `MAX[U]` `ANDN` `ORN` `XNOR` `ROL` `ROR[I]` `zext`(*pseudo-instruction* for `PACK rd, rs, zero`) `rev8`(*pseudo-instruction* for `GREVI rd, rs, -8`) `orc.b`(*pseudo-instruction* for `GORCI rd, rs, 7`)
179
  * `Zbs` single-bit instructions: `SBSET[I]` `SBCLR[I]` `SBINV[I]` `SBEXT[I]`
180 53 zero_gravi
  * `Zba` shifted-add instructions: `SH1ADD` `SH2ADD` `SH3ADD`
181 47 zero_gravi
 
182
 
183 51 zero_gravi
#### `C` - Compressed instructions extension
184 47 zero_gravi
 
185 51 zero_gravi
  * ALU instructions: `C.ADDI4SPN` `C.ADD[I]` `C.ADDI16SP` `C.LI` `C.LUI` `C.SLLI` `C.SRLI` `C.SRAI` `C.ANDI` `C.SUB` `C.XOR` `C.OR` `C.AND` `C.MV` `C.NOP`
186 7 zero_gravi
  * Jump and branch instructions: `C.J` `C.JAL` `C.JR` `C.JALR` `C.BEQZ` `C.BNEZ`
187 2 zero_gravi
  * Memory instructions: `C.LW` `C.SW` `C.LWSP` `C.SWSP`
188 52 zero_gravi
  * System instructions: `C.EBREAK` (requires `Zicsr` extension)
189 40 zero_gravi
  * Pseudo-instructions are not listed
190 2 zero_gravi
 
191 51 zero_gravi
#### `E` - Embedded CPU version extension
192 47 zero_gravi
 
193 52 zero_gravi
  * Reduced register file (only the 16 lowest registers are implemented)
194 2 zero_gravi
 
195 47 zero_gravi
 
196 51 zero_gravi
#### `I` - Base integer instruction set
197 47 zero_gravi
 
198 51 zero_gravi
  * ALU instructions: `LUI` `AUIPC` `ADD[I]` `SLT[I][U]` `XOR[I]` `OR[I]` `AND[I]` `SLL[I]` `SRL[I]` `SRA[I]` `SUB`
199 47 zero_gravi
  * Jump and branch instructions: `JAL` `JALR` `BEQ` `BNE` `BLT` `BGE` `BLTU` `BGEU`
200
  * Memory instructions: `LB` `LH` `LW` `LBU` `LHU` `SB` `SH` `SW`
201
  * System instructions: `ECALL` `EBREAK` `FENCE`
202
  * Pseudo-instructions are not listed
203
 
204
 
205 51 zero_gravi
#### `M` - Integer multiplication and division hardware extension
206 47 zero_gravi
 
207 2 zero_gravi
  * Multiplication instructions: `MUL` `MULH` `MULHSU` `MULHU`
208
  * Division instructions: `DIV` `DIVU` `REM` `REMU`
209 19 zero_gravi
  * By default, the multiplier and divider cores use an iterative bit-serial processing scheme
210
  * Multiplications can be mapped to DSPs via the `FAST_MUL_EN` generic to increase performance
211 2 zero_gravi
 
212 39 zero_gravi
 
213 51 zero_gravi
#### `U` - Privileged architecture - User mode extension
214 44 zero_gravi
 
215 47 zero_gravi
  * Requires `Zicsr` extension
216
  * Privilege levels: `M` (machine mode) + less-privileged `U` (user mode)
217
 
218
 
219 51 zero_gravi
#### `X` - NEORV32-specific CPU extensions
220 47 zero_gravi
 
221
* The NEORV32-specific extensions are always enabled and are indicated via the `X` bit set in the `misa` CSR.
222 48 zero_gravi
* 16 *fast interrupt* request channels with according control/status bits in `mie` and `mip` and custom exception codes in `mcause`
223 47 zero_gravi
* `mzext` CSR to check for implemented `Z*` CPU extensions (like `Zifencei`)
224
* All undefined/umimplemented/malformed/illegal instructions do raise an illegal instruction exception
225
 
226
 
227 53 zero_gravi
#### `Zfinx` - Single-precision floating-point extension (using integer `x` registers)
228
 
229
  * :construction: **work-in-progress** :construction:
230
  * :warning: this extension has not been officially ratified yet!
231
  * :books: more information can be found here: [RISC-V `Zfinx` spec.](https://github.com/riscv/riscv-zfinx)
232
  * :information_source: check out the [floating-point extension project board](https://github.com/stnolting/neorv32/projects/4) for the current implementation state
233
 
234
 
235 51 zero_gravi
#### `Zicsr` - Privileged architecture - CSR access extension
236 47 zero_gravi
 
237 2 zero_gravi
  * Privilege levels: `M-mode` (Machine mode)
238 51 zero_gravi
  * CSR access instructions: `CSRRW[I]` `CSRRS[I]` `CSRRC[I]`
239 8 zero_gravi
  * System instructions: `MRET` `WFI`
240 40 zero_gravi
  * Pseudo-instructions are not listed
241 42 zero_gravi
  * Counter CSRs: `[m]cycle[h]` `[m]instret[m]` `time[h]` `[m]hpmcounter*[h]`(3..31, configurable) `mcounteren` `mcountinhibit` `mhpmevent*`(3..31, configurable)
242
  * Machine CSRs: `mstatus[h]` `misa`(read-only!) `mie` `mtvec` `mscratch` `mepc` `mcause` `mtval` `mip` `mvendorid` [`marchid`](https://github.com/riscv/riscv-isa-manual/blob/master/marchid.md) `mimpid` `mhartid` `mzext`(custom)
243 52 zero_gravi
  * Supported (sync.) exceptions (implementing the RISC-V specs):
244 2 zero_gravi
    * Misaligned instruction address
245 51 zero_gravi
    * Instruction access fault (via timeout/error after unacknowledged bus access)
246 2 zero_gravi
    * Illegal instruction
247 4 zero_gravi
    * Breakpoint (via `ebreak` instruction)
248 2 zero_gravi
    * Load address misaligned
249 51 zero_gravi
    * Load access fault (via timeout/error after unacknowledged bus access)
250 4 zero_gravi
    * Store address misaligned
251 38 zero_gravi
    * Store access fault (via unacknowledged bus access after timeout)
252 40 zero_gravi
    * Environment call from U-mode (via `ecall` instruction in user mode)
253
    * Environment call from M-mode (via `ecall` instruction in machine mode)
254 51 zero_gravi
  * Supported (async.) exceptions / interrupts:
255 52 zero_gravi
    * Machine timer interrupt `mti` (via processor's MTIME unit / external signal)
256
    * Machine software interrupt `msi` (via external signal)
257
    * Machine external interrupt `mei` (via external signal)
258 51 zero_gravi
    * 16 fast interrupt requests (custom extension), 6+1 available for custom usage
259 2 zero_gravi
 
260 15 zero_gravi
 
261 51 zero_gravi
#### `Zifencei` - Privileged architecture - Instruction stream synchronization extension
262 47 zero_gravi
 
263 41 zero_gravi
  * System instructions: `FENCE.I` (among others, used to clear and reload instruction cache)
264 8 zero_gravi
 
265 47 zero_gravi
 
266 51 zero_gravi
#### `PMP` - Privileged architecture - Physical memory protection
267 47 zero_gravi
 
268
  * Requires `Zicsr` extension
269 44 zero_gravi
  * Configurable number of regions (0..63)
270 42 zero_gravi
  * Additional machine CSRs: `pmpcfg*`(0..15) `pmpaddr*`(0..63)
271 2 zero_gravi
 
272 47 zero_gravi
 
273 51 zero_gravi
#### `HPM` - Privileged architecture - Hardware performance monitors
274 47 zero_gravi
 
275
  * Requires `Zicsr` extension
276 44 zero_gravi
  * Configurable number of counters (0..29)
277
  * Additional machine CSRs: `mhpmevent*`(3..31) `[m]hpmcounter*[h]`(3..31)
278 15 zero_gravi
 
279 23 zero_gravi
 
280 52 zero_gravi
### :warning: Non-RISC-V-Compatible Issues and Limitations
281 44 zero_gravi
 
282 40 zero_gravi
* CPU and Processor are BIG-ENDIAN, but this should be no problem as the external memory bus interface provides big- and little-endian configurations
283 30 zero_gravi
* `misa` CSR is read-only - no dynamic enabling/disabling of synthesized CPU extensions during runtime; for compatibility: write accesses (in m-mode) are ignored and do not cause an exception
284 42 zero_gravi
* The physical memory protection (**PMP**) only supports `NAPOT` mode yet and a minimal granularity of 8 bytes
285 39 zero_gravi
* The `A` extension only implements `lr.w` and `sc.w` instructions yet. However, these instructions are sufficient to emulate all further AMO operations
286 44 zero_gravi
* The `mcause` trap code `0x80000000` (originally reserved in the RISC-V specs) is used to indicate a hardware reset (as "non-maskable interrupt")
287 52 zero_gravi
* The bit manipulation extension is not yet officially ratified, but is expected to stay unchanged. There is no software support in the upstream GCC RISC-V port yet. However, an intrinsic library is provided to utilize the provided bit manipulation extension from C-language code (see [`sw/example/bit_manipulation`](https://github.com/stnolting/neorv32/tree/master/sw/example/bit_manipulation)). NEORV32's `B` extension is compatible to spec. version "0.94-draft".
288 23 zero_gravi
 
289
 
290
 
291 2 zero_gravi
## FPGA Implementation Results
292
 
293 23 zero_gravi
### NEORV32 CPU
294
 
295
This chapter shows exemplary implementation results of the NEORV32 CPU for an **Intel Cyclone IV EP4CE22F17C6N FPGA** on
296 37 zero_gravi
a DE0-nano board. The design was synthesized using **Intel Quartus Prime Lite 20.1** ("balanced implementation"). The timing
297 4 zero_gravi
information is derived from the Timing Analyzer / Slow 1200mV 0C Model. If not otherwise specified, the default configuration
298 42 zero_gravi
of the CPU's generics is assumed (e.g. no physical memory protection, no hardware performance monitors).
299 49 zero_gravi
No constraints were used at all.
300 2 zero_gravi
 
301 49 zero_gravi
Results generated for hardware version [`1.5.1.4`](https://github.com/stnolting/neorv32/blob/master/CHANGELOG.md).
302 2 zero_gravi
 
303 44 zero_gravi
| CPU Configuration                        | LEs        | FFs      | Memory bits | DSPs | f_max   |
304
|:-----------------------------------------|:----------:|:--------:|:-----------:|:----:|:-------:|
305 49 zero_gravi
| `rv32i`                                  |        979 |      409 |        1024 |    0 | 123 MHz |
306
| `rv32i`     + `Zicsr`                    |       1789 |      847 |        1024 |    0 | 122 MHz |
307
| `rv32im`    + `Zicsr`                    |       2381 |     1125 |        1024 |    0 | 122 MHz |
308
| `rv32imc`   + `Zicsr`                    |       2608 |     1140 |        1024 |    0 | 122 MHz |
309
| `rv32imac`  + `Zicsr`                    |       2621 |     1144 |        1024 |    0 | 122 MHz |
310
| `rv32imacb` + `Zicsr`                    |       3013 |     1310 |        1024 |    0 | 122 MHz |
311
| `rv32imacb` + `Zicsr` + `u`              |       3031 |     1313 |        1024 |    0 | 122 MHz |
312
| `rv32imacb` + `Zicsr` + `u` + `Zifencei` |       3050 |     1313 |        1024 |    0 | 116 MHz |
313 2 zero_gravi
 
314 49 zero_gravi
Setups with enabled "embedded CPU extension" `E` show the same LUT and FF utilization and identical f_max as the according `I` configuration.
315
However, the size of the register file is cut in half.
316 2 zero_gravi
 
317 39 zero_gravi
 
318 23 zero_gravi
### NEORV32 Processor-Internal Peripherals and Memories
319
 
320 52 zero_gravi
Results generated for hardware version [`1.5.2.4`](https://github.com/stnolting/neorv32/blob/master/CHANGELOG.md).
321 11 zero_gravi
 
322 25 zero_gravi
| Module    | Description                                          | LEs | FFs | Memory bits | DSPs |
323 31 zero_gravi
|:----------|:-----------------------------------------------------|----:|----:|------------:|-----:|
324 37 zero_gravi
| BOOT ROM  | Bootloader ROM (default 4kB)                         |   3 |   1 |      32 768 |    0 |
325 49 zero_gravi
| BUSSWITCH | Bus mux for CPU instr. & data interfaces             |  65 |   8 |           0 |    0 |
326 45 zero_gravi
| i-CACHE   | Proc.-int. nstruction cache (default 1x4x64 bytes)   | 234 | 156 |       8 192 |    0 |
327 47 zero_gravi
| CFS       | Custom functions subsystem                           |   - |   - |           - |    - |
328 39 zero_gravi
| DMEM      | Processor-internal data memory (default 8kB)         |   6 |   2 |      65 536 |    0 |
329 40 zero_gravi
| GPIO      | General purpose input/output ports                   |  67 |  65 |           0 |    0 |
330 39 zero_gravi
| IMEM      | Processor-internal instruction memory (default 16kb) |   6 |   2 |     131 072 |    0 |
331 40 zero_gravi
| MTIME     | Machine system timer                                 | 274 | 166 |           0 |    0 |
332 49 zero_gravi
| NCO       | Numerically-controlled oscillator                    | 254 | 226 |           0 |    0 |
333 52 zero_gravi
| NEOLED    | Smart LED Interface (NeoPixel-compatibile) [4x FIFO] | 347 | 309 |           0 |    0 |
334 39 zero_gravi
| PWM       | Pulse-width modulation controller                    |  71 |  69 |           0 |    0 |
335 40 zero_gravi
| SPI       | Serial peripheral interface                          | 138 | 124 |           0 |    0 |
336
| SYSINFO   | System configuration information memory              |  11 |  10 |           0 |    0 |
337 31 zero_gravi
| TRNG      | True random number generator                         | 132 | 105 |           0 |    0 |
338 40 zero_gravi
| TWI       | Two-wire interface                                   |  77 |  46 |           0 |    0 |
339 50 zero_gravi
| UART0/1   | Universal asynchronous receiver/transmitter 0/1      | 176 | 132 |           0 |    0 |
340 40 zero_gravi
| WDT       | Watchdog timer                                       |  60 |  45 |           0 |    0 |
341 39 zero_gravi
| WISHBONE  | External memory interface                            | 129 | 104 |           0 |    0 |
342 2 zero_gravi
 
343
 
344 23 zero_gravi
### NEORV32 Processor - Exemplary FPGA Setups
345 6 zero_gravi
 
346 47 zero_gravi
Exemplary processor implementation results for different FPGA platforms. The processor setup uses *the default peripheral configuration* (like no _CFS_ and no _TRNG_),
347 23 zero_gravi
no external memory interface and only internal instruction and data memories. IMEM uses 16kB and DMEM uses 8kB memory space. The setup's top entity connects most of the
348 11 zero_gravi
processor's [top entity](https://github.com/stnolting/neorv32/blob/master/rtl/core/neorv32_top.vhd) signals
349 40 zero_gravi
to FPGA pins - except for the Wishbone bus and the interrupt signals. The "default" strategy of each toolchain is used.
350 6 zero_gravi
 
351 40 zero_gravi
Results generated for hardware version [`1.4.9.0`](https://github.com/stnolting/neorv32/blob/master/CHANGELOG.md).
352 6 zero_gravi
 
353 40 zero_gravi
| Vendor  | FPGA                              | Board            | Toolchain                  | CPU Configuration                              | LUT / LE   | FF / REG   | DSP    | Memory Bits  | BRAM / EBR | SPRAM    | Frequency     |
354
|:--------|:----------------------------------|:-----------------|:---------------------------|:-----------------------------------------------|:-----------|:-----------|:-------|:-------------|:-----------|:---------|--------------:|
355
| Intel   | Cyclone IV `EP4CE22F17C6N`        | Terasic DE0-Nano | Quartus Prime Lite 20.1    | `rv32imc` + `u` + `Zicsr` + `Zifencei`         | 3813 (17%) | 1904  (8%) | 0 (0%) | 231424 (38%) |          - |        - |       119 MHz |
356
| Lattice | iCE40 UltraPlus `iCE40UP5K-SG48I` | Upduino v2.0     | Radiant 2.1 (Synplify Pro) | `rv32ic`  + `u` + `Zicsr` + `Zifencei`         | 4397 (83%) | 1679 (31%) | 0 (0%) |            - |   12 (40%) | 4 (100%) | *c* 22.15 MHz |
357
| Xilinx  | Artix-7 `XC7A35TICSG324-1L`       | Arty A7-35T      | Vivado 2019.2              | `rv32imc` + `u` + `Zicsr` + `Zifencei` + `PMP` | 2465 (12%) | 1912  (5%) | 0 (0%) |            - |    8 (16%) |        - |   *c* 100 MHz |
358 2 zero_gravi
 
359 23 zero_gravi
**_Notes_**
360 20 zero_gravi
* The Lattice iCE40 UltraPlus setup uses the FPGA's SPRAM memory primitives for the internal IMEM and DMEM (each 64kb).
361 12 zero_gravi
The FPGA-specific memory components can be found in [`rtl/fpga_specific`](https://github.com/stnolting/neorv32/blob/master/rtl/fpga_specific/lattice_ice40up).
362
* The clock frequencies marked with a "c" are constrained clocks. The remaining ones are _f_max_ results from the place and route timing reports.
363 11 zero_gravi
* The Upduino and the Arty board have on-board SPI flash memories for storing the FPGA configuration. These device can also be used by the default NEORV32
364
bootloader to store and automatically boot an application program after reset (both tested successfully).
365 40 zero_gravi
* The setups with `PMP` implement 2 regions with a minimal granularity of 64kB.
366 42 zero_gravi
* No HPM counters are implemented.
367 2 zero_gravi
 
368 22 zero_gravi
 
369
 
370 2 zero_gravi
## Performance
371
 
372
### CoreMark Benchmark
373
 
374
The [CoreMark CPU benchmark](https://www.eembc.org/coremark) was executed on the NEORV32 and is available in the
375
[sw/example/coremark](https://github.com/stnolting/neorv32/blob/master/sw/example/coremark) project folder. This benchmark
376
tests the capabilities of a CPU itself rather than the functions provided by the whole system / SoC.
377
 
378
~~~
379
**Configuration**
380 45 zero_gravi
Hardware:       32kB IMEM, 16kB DMEM, no caches, 100MHz clock
381 38 zero_gravi
CoreMark:       2000 iterations, MEM_METHOD is MEM_STACK
382
Compiler:       RISCV32-GCC 10.1.0 (rv32i toolchain)
383
Compiler flags: default, see makefile
384
Peripherals:    UART for printing the results
385 2 zero_gravi
~~~
386
 
387 42 zero_gravi
Results generated for hardware version [`1.4.9.8`](https://github.com/stnolting/neorv32/blob/master/CHANGELOG.md).
388
 
389
| CPU (including `Zicsr`)                     | Executable Size | Optimization | CoreMark Score | CoreMarks/MHz |
390 34 zero_gravi
|:--------------------------------------------|:---------------:|:------------:|:--------------:|:-------------:|
391 42 zero_gravi
| `rv32i`                                     |    28 756 bytes |        `-O3` |          36.36 |    **0.3636** |
392
| `rv32im`                                    |    27 516 bytes |        `-O3` |          68.97 |    **0.6897** |
393
| `rv32imc`                                   |    22 008 bytes |        `-O3` |          68.97 |    **0.6897** |
394
| `rv32imc` + `FAST_MUL_EN`                   |    22 008 bytes |        `-O3` |          86.96 |    **0.8696** |
395
| `rv32imc` + `FAST_MUL_EN` + `FAST_SHIFT_EN` |    22 008 bytes |        `-O3` |          90.91 |    **0.9091** |
396 2 zero_gravi
 
397 34 zero_gravi
The `FAST_MUL_EN` configuration uses DSPs for the multiplier of the `M` extension (enabled via the `FAST_MUL_EN` generic). The `FAST_SHIFT_EN` configuration
398
uses a barrel shifter for CPU shift operations (enabled via the `FAST_SHIFT_EN` generic).
399 2 zero_gravi
 
400 31 zero_gravi
When the `C` extension is enabled, branches to an unaligned uncompressed instruction require additional instruction fetch cycles.
401 22 zero_gravi
 
402 34 zero_gravi
 
403 2 zero_gravi
### Instruction Cycles
404
 
405 11 zero_gravi
The NEORV32 CPU is based on a two-stages pipelined architecutre. Each stage uses a multi-cycle processing scheme. Hence,
406 9 zero_gravi
each instruction requires several clock cycles to execute (2 cycles for ALU operations, ..., 40 cycles for divisions).
407
The average CPI (cycles per instruction) depends on the instruction mix of a specific applications and also on the available
408 42 zero_gravi
CPU extensions. *By default* the CPU-internal shifter (e.g. for the `SLL` instruction) as well as the multiplier and divider of the
409 2 zero_gravi
`M` extension use a bit-serial approach and require several cycles for completion.
410
 
411 6 zero_gravi
The following table shows the performance results for successfully running 2000 CoreMark
412 9 zero_gravi
iterations, which reflects a pretty good "real-life" work load. The average CPI is computed by
413 12 zero_gravi
dividing the total number of required clock cycles (only the timed core to avoid distortion due to IO wait cycles; sampled via the `cycle[h]` CSRs)
414 19 zero_gravi
by the number of executed instructions (`instret[h]` CSRs). The executables were generated using optimization `-O3`.
415 2 zero_gravi
 
416 42 zero_gravi
Results generated for hardware version [`1.4.9.8`](https://github.com/stnolting/neorv32/blob/master/CHANGELOG.md).
417 2 zero_gravi
 
418 42 zero_gravi
| CPU  (including `Zicsr`)                    | Required Clock Cycles | Executed Instructions | Average CPI |
419 34 zero_gravi
|:--------------------------------------------|----------------------:|----------------------:|:-----------:|
420 42 zero_gravi
| `rv32i`                                     |         5 595 750 503 |         1 466 028 607 |    **3.82** |
421
| `rv32im`                                    |         2 966 086 503 |           598 651 143 |    **4.95** |
422
| `rv32imc`                                   |         2 981 786 734 |           611 814 918 |    **4.87** |
423
| `rv32imc` + `FAST_MUL_EN`                   |         2 399 234 734 |           611 814 918 |    **3.92** |
424
| `rv32imc` + `FAST_MUL_EN` + `FAST_SHIFT_EN` |         2 265 135 174 |           611 814 948 |    **3.70** |
425 2 zero_gravi
 
426 34 zero_gravi
The `FAST_MUL_EN` configuration uses DSPs for the multiplier of the `M` extension (enabled via the `FAST_MUL_EN` generic). The `FAST_SHIFT_EN` configuration
427
uses a barrel shifter for CPU shift operations (enabled via the `FAST_SHIFT_EN` generic).
428
 
429 36 zero_gravi
When the `C` extension is enabled branches to an unaligned uncompressed instruction require additional instruction fetch cycles.
430 12 zero_gravi
 
431 22 zero_gravi
 
432 31 zero_gravi
 
433 14 zero_gravi
## Top Entities
434 2 zero_gravi
 
435 51 zero_gravi
The top entity of the **NEORV32 Processor** (SoC) is [`rtl/core/neorv32_top.vhd`](https://github.com/stnolting/neorv32/blob/master/rtl/core/neorv32_top.vhd),
436
which provides a Wishbone b4-compatoible bus interface.
437 2 zero_gravi
 
438 51 zero_gravi
:information_source: It is recommended to use the processor setup even if you want to **use the CPU in stand-alone mode**. Simply disable all the processor-internal
439
modules via the generics and you will get a "CPU wrapper" that already provides a minimal CPU environment and an external memory interface (like AXI4).
440
This setup also allows to further use the default bootloader and software framework. From this base you can start building your own processor system.
441 14 zero_gravi
 
442 36 zero_gravi
Use the top's generics to configure the system according to your needs. Each generic is initilized with the default configuration.
443 34 zero_gravi
Detailed information regarding the interface signals and configuration generics can be found in
444 40 zero_gravi
the [:page_facing_up: NEORV32 data sheet](https://raw.githubusercontent.com/stnolting/neorv32/master/docs/NEORV32.pdf) (pdf).
445 22 zero_gravi
 
446 51 zero_gravi
All signals of the top entity are of type *std_ulogic* or *std_ulogic_vector*, respectively
447
(except for the processor's TWI signals, which are of type *std_logic*). Leave all unused output ports unconnected and tie all unused
448
input ports to zero.
449 23 zero_gravi
 
450 51 zero_gravi
**Alternative top entities**, like the simplified ["hello world" test setup](#Create-a-new-Hardware-Project) or CPU/Processor
451 36 zero_gravi
wrappers with resolved port signal types (i.e. *std_logic*), can be found in [`rtl/top_templates`](https://github.com/stnolting/neorv32/blob/master/rtl/top_templates).
452
 
453
 
454 35 zero_gravi
### AXI4 Connectivity
455 22 zero_gravi
 
456 35 zero_gravi
Via the [`rtl/top_templates/neorv32_top_axi4lite.vhd`](https://github.com/stnolting/neorv32/blob/master/rtl/top_templates/neorv32_top_axi4lite.vhd)
457
wrapper the NEORV32 provides an **AXI4-Lite** compatible master interface. This wrapper instantiates the default
458
[NEORV32 processor top entitiy](https://github.com/stnolting/neorv32/blob/master/rtl/core/neorv32_top.vhd) and implements a Wishbone to AXI4-Lite bridge.
459 2 zero_gravi
 
460 35 zero_gravi
The AXI4-Lite interface has been tested using Xilinx Vivado 19.2 block designer:
461
 
462
![AXI-SoC](https://raw.githubusercontent.com/stnolting/neorv32/master/docs/figures/neorv32_axi_soc.png)
463
 
464
The processor was packed as custom IP using `neorv32_top_axi4lite.vhd` as top entity. The AXI interface is automatically detected by the packager.
465
All remaining IO interfaces are available as custom signals. The configuration generics are available via the "customize IP" dialog.
466
In the figure above the resulting IP block is named "neorv32_top_axi4lite_v1_0".
467
*(Note: Use Syntheiss option "global" when generating the block design to maintain the internal TWI tri-state drivers.)*
468
 
469
The setup uses an AXI interconnect to attach two block RAMs to the processor. Since the processor in this example is configured *without* IMEM and DMEM,
470
the attached block RAMs are used for storing instructions and data: the first RAM is used as instruction memory
471
and is mapped to address `0x00000000 - 0x00003fff` (16kB), the second RAM is used as data memory and is mapped to address `0x80000000 - 0x80001fff` (8kB).
472
 
473
 
474
 
475 2 zero_gravi
## Getting Started
476
 
477
This overview is just a short excerpt from the *Let's Get It Started* section of the NEORV32 documentary:
478
 
479 40 zero_gravi
[:page_facing_up: NEORV32 data sheet](https://raw.githubusercontent.com/stnolting/neorv32/master/docs/NEORV32.pdf)
480 2 zero_gravi
 
481
 
482 51 zero_gravi
### 1. Get the Toolchain
483 2 zero_gravi
 
484 50 zero_gravi
At first you need a **RISC-V GCC toolchain**. You can either [download the sources](https://github.com/riscv/riscv-gnu-toolchain)
485 2 zero_gravi
and build the toolchain by yourself, or you can download a prebuilt one and install it.
486
 
487 23 zero_gravi
To build the toolchain by yourself, follow the official [build instructions](https://github.com/riscv/riscv-gnu-toolchain).
488 14 zero_gravi
Make sure to use the `ilp32` or `ilp32e` ABI.
489 2 zero_gravi
 
490 15 zero_gravi
**Alternatively**, you can download a prebuilt toolchain. I have uploaded the toolchains I am using to GitHub. These toolchains
491 40 zero_gravi
were compiled on a 64-bit x86 Ubuntu 20.04 LTS (Ubuntu on Windows, actually). Download the toolchain of choice:
492 46 zero_gravi
[:octocat: github.com/stnolting/riscv-gcc-prebuilt](https://github.com/stnolting/riscv-gcc-prebuilt)
493 2 zero_gravi
 
494 45 zero_gravi
You can also use the toolchains provided by [SiFive](https://github.com/sifive/freedom-tools/releases). These are 64-bit toolchains that can also emit 32-bit
495 50 zero_gravi
RISC-V code. They were compiled for more sophisticated machines (`rv32imac`) so make sure the according NEORV32 hardware extensions are enabled.
496 2 zero_gravi
 
497 45 zero_gravi
:warning: Keep in mind that – for instance – a `rv32imc` toolchain only provides library code compiled with compressed and
498
`mul`/`div` instructions! Hence, this code cannot be executed (without emulation) on an architecture without these extensions!
499
 
500 50 zero_gravi
To check everything works fine, make sure `GNU Make` and a native `GCC` compiler are installed.
501
Test the installation of the RISC-V toolchain by navigating to an [example program project](https://github.com/stnolting/neorv32/tree/master/sw/example) like
502
`sw/example/blink_led` and running:
503 45 zero_gravi
 
504 50 zero_gravi
    neorv32/sw/example/blink_led$ make check
505 2 zero_gravi
 
506 50 zero_gravi
 
507 51 zero_gravi
### 2. Download the NEORV32 Project
508 50 zero_gravi
 
509 23 zero_gravi
Get the sources of the NEORV32 Processor project. The simplest way is using `git clone` (suggested for easy project updates via `git pull`):
510 12 zero_gravi
 
511 2 zero_gravi
    $ git clone https://github.com/stnolting/neorv32.git
512
 
513 23 zero_gravi
Alternatively, you can either download a specific [release](https://github.com/stnolting/neorv32/releases) or get the most recent version
514
of this project as [`*.zip` file](https://github.com/stnolting/neorv32/archive/master.zip).
515 2 zero_gravi
 
516 22 zero_gravi
 
517 51 zero_gravi
### 3. Create a new FPGA Project
518 22 zero_gravi
 
519 23 zero_gravi
Create a new project with your FPGA design tool of choice. Add all the `*.vhd` files from the [`rtl/core`](https://github.com/stnolting/neorv32/blob/master/rtl)
520
folder to this project. Make sure to add these files to a **new design library** called `neorv32`.
521
 
522 40 zero_gravi
You can either instantiate the [processor's top entity](https://github.com/stnolting/neorv32/blob/master/rtl/core/neorv32_top.vhd) or one of its
523 51 zero_gravi
[wrappers](https://github.com/stnolting/neorv32/blob/master/rtl/top_templates) in your own project. If you just want to try thing out,
524
you can use the simple [**test setup** (`rtl/top_templates/neorv32_test_setup.vhd`)](https://github.com/stnolting/neorv32/blob/master/rtl/top_templates/neorv32_test_setup.vhd) as top entity.
525 2 zero_gravi
 
526 40 zero_gravi
![neorv32 test setup](https://raw.githubusercontent.com/stnolting/neorv32/master/docs/figures/neorv32_test_setup.png)
527
 
528
 
529 51 zero_gravi
This test setup instantiates the processor and implements most of the peripherals and some ISA extensions. Only the UART0 communications lines, clock, reset and some
530
GPIO output signals are propagated as actual top entity interface signals. Basically, it is a FPGA version of a "hello world" example:
531 23 zero_gravi
 
532 2 zero_gravi
```vhdl
533 9 zero_gravi
  entity neorv32_test_setup is
534
    port (
535
      -- Global control --
536 50 zero_gravi
      clk_i       : in  std_ulogic := '0'; -- global clock, rising edge
537
      rstn_i      : in  std_ulogic := '0'; -- global reset, low-active, async
538 9 zero_gravi
      -- GPIO --
539 50 zero_gravi
      gpio_o      : out std_ulogic_vector(7 downto 0); -- parallel output
540
      -- UART0 --
541 51 zero_gravi
      uart0_txd_o : out std_ulogic;       -- UART0 send data
542 50 zero_gravi
      uart0_rxd_i : in  std_ulogic := '0' -- UART0 receive data
543 9 zero_gravi
    );
544
  end neorv32_test_setup;
545 2 zero_gravi
```
546
 
547
 
548 50 zero_gravi
### 4. Compile an Example Program
549 2 zero_gravi
 
550 50 zero_gravi
The NEORV32 project includes several [example program project](https://github.com/stnolting/neorv32/tree/master/sw/example) from
551
which you can start your own application. There are example programs to check out the processor's peripheral like I2C or the true-random number generator.
552
And yes, there is also a port of [Conway's Game of Life](https://github.com/stnolting/neorv32/tree/master/sw/example/game_of_life) available! :wink:
553 2 zero_gravi
 
554 50 zero_gravi
Simply compile one of these projects using
555 2 zero_gravi
 
556 23 zero_gravi
    neorv32/sw/example/blink_led$ make clean_all exe
557 2 zero_gravi
 
558 50 zero_gravi
This will create a NEORV32 *executable* `neorv32_exe.bin` in the same folder, which you can upload via the bootloader.
559 23 zero_gravi
 
560
 
561 50 zero_gravi
### 5. Upload the Executable via the Bootloader
562 34 zero_gravi
 
563 50 zero_gravi
Connect your FPGA board via UART to your computer and open the according port to interface with the fancy NEORV32 bootloader. The bootloader
564 2 zero_gravi
uses the following default UART configuration:
565
 
566 32 zero_gravi
* 19200 Baud
567
* 8 data bits
568
* 1 stop bit
569
* No parity bits
570
* No transmission / flow control protocol (raw bytes only)
571
* Newline on `\r\n` (carriage return & newline) - also for sent data
572 2 zero_gravi
 
573 51 zero_gravi
Use the bootloader console to upload the `neorv32_exe.bin` executable gerated during application compiling and *run* your application.
574 2 zero_gravi
 
575 9 zero_gravi
```
576 43 zero_gravi
<< NEORV32 Bootloader >>
577
 
578
BLDV: Nov  7 2020
579
HWV:  0x01040606
580
CLK:  0x0134FD90 Hz
581
USER: 0x0001CE40
582
MISA: 0x42801104
583
PROC: 0x03FF0035
584
IMEM: 0x00010000 bytes @ 0x00000000
585
DMEM: 0x00010000 bytes @ 0x80000000
586
 
587
Autoboot in 8s. Press key to abort.
588
Aborted.
589
 
590
Available CMDs:
591
 h: Help
592
 r: Restart
593
 u: Upload
594
 s: Store to flash
595
 l: Load from flash
596
 e: Execute
597
CMD:> u
598
Awaiting neorv32_exe.bin... OK
599
CMD:> e
600
Booting...
601
 
602
Blinking LED demo program
603 9 zero_gravi
```
604 2 zero_gravi
 
605 40 zero_gravi
Going further: Take a look at the _Let's Get It Started!_ chapter of the [:page_facing_up: NEORV32 data sheet](https://raw.githubusercontent.com/stnolting/neorv32/master/docs/NEORV32.pdf).
606 2 zero_gravi
 
607
 
608
 
609 40 zero_gravi
## Contribute/Feedback/Questions
610 2 zero_gravi
 
611 51 zero_gravi
I'm always thankful for help! So if you have any questions, bug reports, ideas or if you want to give any kind of feedback, feel free
612
to [open a new issue](https://github.com/stnolting/neorv32/issues), start a new [discussion on GitHub](https://github.com/stnolting/neorv32/discussions)
613
or directly [drop me a line](mailto:stnolting@gmail.com).
614 2 zero_gravi
 
615 51 zero_gravi
Here is a simple guide line if you'd like to contribute to this repository:
616 22 zero_gravi
 
617 51 zero_gravi
0. :star: this repository :wink:
618 40 zero_gravi
1. Check out the project's [code of conduct](https://github.com/stnolting/neorv32/tree/master/CODE_OF_CONDUCT.md)
619
2. [Fork](https://github.com/stnolting/neorv32/fork) this repository and clone the fork
620
3. Create a feature branch in your fork: `git checkout -b awesome_new_feature_branch`
621
4. Create a new remote for the upstream repo: `git remote add upstream https://github.com/stnolting/neorv32`
622
5. Commit your modifications: `git commit -m "Awesome new feature!"`
623
6. Push to the branch: `git push origin awesome_new_feature_branch`
624
7. Create a new [pull request](https://github.com/stnolting/neorv32/pulls)
625 2 zero_gravi
 
626 40 zero_gravi
 
627 11 zero_gravi
## Legal
628 2 zero_gravi
 
629 12 zero_gravi
This project is released under the BSD 3-Clause license. No copyright infringement intended.
630 11 zero_gravi
Other implied or used projects might have different licensing - see their documentation to get more information.
631
 
632 37 zero_gravi
#### Citing
633 11 zero_gravi
 
634 51 zero_gravi
If you are using the NEORV32 or parts of the project in some kind of publication, please cite it as follows:
635 2 zero_gravi
 
636 51 zero_gravi
> S. Nolting, "The NEORV32 RISC-V Processor", github.com/stnolting/neorv32
637 2 zero_gravi
 
638 9 zero_gravi
#### BSD 3-Clause License
639 2 zero_gravi
 
640 42 zero_gravi
Copyright (c) 2021, Stephan Nolting. All rights reserved.
641 2 zero_gravi
 
642
Redistribution and use in source and binary forms, with or without modification, are
643
permitted provided that the following conditions are met:
644
 
645
1. Redistributions of source code must retain the above copyright notice, this list of
646
conditions and the following disclaimer.
647
2. Redistributions in binary form must reproduce the above copyright notice, this list of
648
conditions and the following disclaimer in the documentation and/or other materials
649
provided with the distribution.
650
3. Neither the name of the copyright holder nor the names of its contributors may be used to
651
endorse or promote products derived from this software without specific prior written
652
permission.
653
 
654
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
655
OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
656
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
657
COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
658
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
659
GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
660
AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
661
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
662
OF THE POSSIBILITY OF SUCH DAMAGE.
663
 
664
 
665 9 zero_gravi
#### Limitation of Liability for External Links
666
 
667 36 zero_gravi
Our website contains links to the websites of third parties ("external links"). As the
668 9 zero_gravi
content of these websites is not under our control, we cannot assume any liability for
669
such external content. In all cases, the provider of information of the linked websites
670
is liable for the content and accuracy of the information provided. At the point in time
671
when the links were placed, no infringements of the law were recognisable to us. As soon
672
as an infringement of the law becomes known to us, we will immediately remove the
673
link in question.
674
 
675
 
676 11 zero_gravi
#### Proprietary  Notice
677 9 zero_gravi
 
678 2 zero_gravi
"Artix" and "Vivado" are trademarks of Xilinx Inc.
679
 
680 45 zero_gravi
"Cyclone" and "Quartus Prime Lite" are trademarks of Intel Corporation.
681 2 zero_gravi
 
682 35 zero_gravi
"iCE40", "UltraPlus" and "Radiant" are trademarks of Lattice Semiconductor Corporation.
683 11 zero_gravi
 
684 35 zero_gravi
"AXI", "AXI4" and "AXI4-Lite" are trademarks of Arm Holdings plc.
685 2 zero_gravi
 
686 52 zero_gravi
"NeoPixel" is a trademark of Adafruit Industries.
687 2 zero_gravi
 
688
 
689 52 zero_gravi
 
690 18 zero_gravi
## Acknowledgements
691 9 zero_gravi
 
692 18 zero_gravi
[![RISC-V](https://raw.githubusercontent.com/stnolting/neorv32/master/docs/figures/riscv_logo.png)](https://riscv.org/)
693
 
694 23 zero_gravi
[RISC-V](https://riscv.org/) - Instruction Sets Want To Be Free!
695 11 zero_gravi
 
696 43 zero_gravi
Continous integration provided by [:octocat: GitHub Actions](https://github.com/features/actions) and powered by [GHDL](https://github.com/ghdl/ghdl).
697 2 zero_gravi
 
698
![Open Source Hardware Logo https://www.oshwa.org](https://raw.githubusercontent.com/stnolting/neorv32/master/docs/figures/oshw_logo.png)
699
 
700
This project is not affiliated with or endorsed by the Open Source Initiative (https://www.oshwa.org / https://opensource.org).
701
 
702 32 zero_gravi
--------
703 2 zero_gravi
 
704 36 zero_gravi
Made with :coffee: in Hannover, Germany :eu:

powered by: WebSVN 2.1.0

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