URL
https://opencores.org/ocsvn/neorv32/neorv32/trunk
Subversion Repositories neorv32
Compare Revisions
- This comparison shows the changes necessary to convert path
/neorv32/trunk/docs/userguide
- from Rev 64 to Rev 65
- ↔ Reverse comparison
Rev 64 → Rev 65
/content.adoc
29,21 → 29,20
:sectnums: |
=== Building the Toolchain from Scratch |
|
To build the toolchain by yourself you can follow the guide from the official https://github.com/riscv/riscv-gnu-toolchain GitHub page. |
To build the toolchain by yourself you can follow the guide from the official https://github.com/riscv-collab/riscv-gnu-toolchain GitHub page. |
You need to make sure the generated toolchain fits the architecture of the NEORV32 core. To get a toolchain that even supports minimal |
ISA extension configurations, it is recommend to compile for `rv32i` only. Please note that this minimal ISA also provides further ISA |
extensions like `m` or `c`. Of course you can use a `multilib` approach to generate |
toolchains for several target ISAs. |
extensions like `m` or `c`. Of course you can use a _multilib_ approach to generate toolchains for several target ISAs at once. |
|
.Configuring GCC build for `rv32i` (minimal ISA) |
[source,bash] |
---- |
riscv-gnu-toolchain$ ./configure --prefix=/opt/riscv --with-arch=rv32i –-with-abi=ilp32 |
riscv-gnu-toolchain$ ./configure --prefix=/opt/riscv --with-arch=rv32i --with-abi=ilp32 |
riscv-gnu-toolchain$ make |
---- |
|
[IMPORTANT] |
Keep in mind that – for instance – a toolchain build with `--with-arch=rv32imc` only provides library code compiled with |
Keep in mind that - for instance - a toolchain build with `--with-arch=rv32imc` only provides library code compiled with |
compressed (`C`) and `mul`/`div` instructions (`M`)! Hence, this code cannot be executed (without |
emulation) on an architecture without these extensions! |
|
196,8 → 195,8
<3> Default size of internal data memory: 8kB |
|
[start=7] |
. If you feel like it – or if your FPGA does not provide sufficient resources – you can modify the |
_memory sizes_ (`MEM_INT_IMEM_SIZE` and `MEM_INT_DMEM_SIZE` – marked with notes "2" and "3"). But as mentioned |
. If you feel like it - or if your FPGA does not provide sufficient resources - you can modify the |
_memory sizes_ (`MEM_INT_IMEM_SIZE` and `MEM_INT_DMEM_SIZE` - marked with notes "2" and "3"). But as mentioned |
above, let's keep things simple at first and use the standard configuration for now. |
. There is one generic that _has to be set according to your FPGA board_ setup: the actual clock frequency |
of the top's clock input signal (`clk_i`). Use the `CLOCK_FREQUENCY` generic to specify your clock source's |
205,7 → 204,7
|
[NOTE] |
If you have changed the default memory configuration (`MEM_INT_IMEM_SIZE` and `MEM_INT_DMEM_SIZE` generics) |
keep those new sizes in mind – these values are required for setting |
keep those new sizes in mind - these values are required for setting |
up the software framework in the next section <<_general_software_framework_setup>>. |
|
[start=9] |
249,7 → 248,7
|
[start=10] |
. Attach the clock input `clk_i` to your clock source and connect the reset line `rstn_i` to a button of |
your FPGA board. Check whether it is low-active or high-active – the reset signal of the processor is |
your FPGA board. Check whether it is low-active or high-active - the reset signal of the processor is |
**low-active**, so maybe you need to invert the input signal. |
. If possible, connected _at least_ bit `0` of the GPIO output port `gpio_o` to a LED (see "Signal Polarity" note above). |
. Finally, if your are using the UART-based test setup (`neorv32_testsetup_bootloader.vhd`) |
288,7 → 287,7
---- |
MEMORY |
{ |
ram (rwx) : ORIGIN = 0x80000000, LENGTH = DEFINED(make_bootloader) ? 512 : 8*1024 # <1> |
ram (rwx) : ORIGIN = 0x80000000, LENGTH = DEFINED(make_bootloader) ? 512 : 8*1024 <1> |
... |
---- |
<1> Size of the data memory address space (right-most value) (internal/external DMEM); here 8kB |
616,8 → 615,8
[source,makefile] |
---- |
# CPU architecture and ABI |
MARCH = -march=rv32i # <1> |
MABI = -mabi=ilp32 # <2> |
MARCH ?= rv32i <1> |
MABI ?= ilp32 <2> |
---- |
<1> MARCH = Machine architecture ("ISA string") |
<2> MABI = Machine binary interface |
642,7 → 641,7
|
[source,bash] |
---- |
$ make MARCH=-march=rv32ic clean_all all |
$ make MARCH=rv32ic clean_all all |
---- |
|
[NOTE] |
1037,9 → 1036,13
. Save everything, let VIVADO create a HDL-Wrapper for the block-design and choose this as your _Top Level Design_. |
. Define your constraints and generate your bitstream. |
|
.TWI Tri-State Drivers |
[IMPORTANT] |
Set the synthesis option "global" when generating the block design to maintain the internal TWI tri-state drivers. |
|
[NOTE] |
Guide provided by GitHub user https://github.com/AWenzel83[`AWenzel83`] from |
https://github.com/stnolting/neorv32/discussions/52#discussioncomment-819013 |
Guide provided by GitHub user https://github.com/AWenzel83[`AWenzel83`] (see |
https://github.com/stnolting/neorv32/discussions/52#discussioncomment-819013). ❤️ |
|
|
|
1181,7 → 1184,7
|
To do a quick test of the NEORV32 make sure to have https://github.com/ghdl/ghdl[GHDL] and a |
[RISC-V gcc toolchain](https://github.com/stnolting/riscv-gcc-prebuilt) installed. |
Navigate to the project's `sw/example/hello_world` folder and run `make USER_FLAGS+=-DUART0_SIM_MODE MARCH=-march=rv32imac clean_all sim`: |
Navigate to the project's `sw/example/hello_world` folder and run `make USER_FLAGS+=-DUART0_SIM_MODE MARCH=rv32imac clean_all sim`: |
|
[TIP] |
The simulator will output some _sanity check_ notes (and warnings or even errors if something is ill-configured) |
1189,7 → 1192,7
|
[source, bash] |
---- |
stnolting@Einstein:/mnt/n/Projects/neorv32/sw/example/hello_world$ make USER_FLAGS+=-DUART0_SIM_MODE MARCH=-march=rv32imac clean_all sim |
stnolting@Einstein:/mnt/n/Projects/neorv32/sw/example/hello_world$ make USER_FLAGS+=-DUART0_SIM_MODE MARCH=rv32imac clean_all sim |
../../../sw/lib/source/neorv32_uart.c: In function 'neorv32_uart0_setup': |
../../../sw/lib/source/neorv32_uart.c:301:4: warning: #warning UART0_SIM_MODE (primary UART) enabled! Sending all UART0.TX data to text.io simulation output instead of real UART0 transmitter. Use this for simulations only! [-Wcpp] |
301 | #warning UART0_SIM_MODE (primary UART) enabled! Sending all UART0.TX data to text.io simulation output instead of real UART0 transmitter. Use this for simulations only! <1> |
1310,6 → 1313,23
<<< |
// #################################################################################################################### |
:sectnums: |
== Zephyr RTOS Support 🪁 |
|
The NEORV32 processor is supported by upstream Zephyr RTOS: https://docs.zephyrproject.org/latest/boards/riscv/neorv32/doc/index.html |
|
[IMPORTANT] |
The absolute path to the NEORV32 executable image generator binary (`.../neorv32/sw/image_gen`) has to be added to the `PATH` variable |
so the Zephyr build system can generate executables and memory-initialization images. |
|
[NOTE] |
Zephyr OS port provided by GitHub user https://github.com/henrikbrixandersen[henrikbrixandersen] |
(see https://github.com/stnolting/neorv32/discussions/172). ❤️ |
|
|
|
<<< |
// #################################################################################################################### |
:sectnums: |
== FreeRTOS Support |
|
A NEORV32-specific port and a simple demo for FreeRTOS (https://github.com/FreeRTOS/FreeRTOS) are |
1436,7 → 1456,7
.Compile the test application |
[source, bash] |
-------------------------- |
.../neorv32/sw/example/blink_led$ make MARCH=-march=rv32i USER_FLAGS+=-g clean_all all |
.../neorv32/sw/example/blink_led$ make MARCH=rv32i USER_FLAGS+=-g clean_all all |
-------------------------- |
|
.Adding debug symbols to the executable |