1 |
69 |
zero_gravi |
<<<
|
2 |
|
|
:sectnums:
|
3 |
|
|
== Adding Custom Hardware Modules
|
4 |
|
|
|
5 |
|
|
In resemblance to the RISC-V ISA, the NEORV32 processor was designed to ease customization and _extensibility_.
|
6 |
|
|
The processor provides several predefined options to add application-specific custom hardware modules and accelerators.
|
7 |
|
|
|
8 |
|
|
|
9 |
|
|
=== Standard (_External_) Interfaces
|
10 |
|
|
|
11 |
|
|
The processor already provides a set of standard interfaces that are intended to connect _chip-external_ devices.
|
12 |
|
|
However, these interfaces can also be used chip-internally. The most suitable interfaces are
|
13 |
|
|
https://stnolting.github.io/neorv32/#_general_purpose_input_and_output_port_gpio[GPIO],
|
14 |
|
|
https://stnolting.github.io/neorv32/#_primary_universal_asynchronous_receiver_and_transmitter_uart0[UART],
|
15 |
|
|
https://stnolting.github.io/neorv32/#_serial_peripheral_interface_controller_spi[SPI] and
|
16 |
|
|
https://stnolting.github.io/neorv32/#_two_wire_serial_interface_controller_twi[TWI].
|
17 |
|
|
|
18 |
|
|
The SPI and (especially) the GPIO interfaces might be the most straightforward approaches since they
|
19 |
|
|
have a minimal protocol overhead. Device-specific interrupt capabilities can be added using the
|
20 |
|
|
https://stnolting.github.io/neorv32/#_external_interrupt_controller_xirq[External Interrupt Controller (XIRQ)].
|
21 |
|
|
Beyond simplicity, these interface only provide a very limited bandwidth and require more sophisticated
|
22 |
|
|
software handling ("bit-banging" for the GPIO).
|
23 |
|
|
|
24 |
|
|
|
25 |
|
|
=== External Bus Interface
|
26 |
|
|
|
27 |
|
|
The https://stnolting.github.io/neorv32/#_processor_external_memory_interface_wishbone_axi4_lite[External Bus Interface]
|
28 |
|
|
provides the classic approach to connect to custom IP. By default, the bus interface implements the widely adopted
|
29 |
|
|
Wishbone interface standard. However, this project also includes wrappers to bridge to other protocol standards like ARM's
|
30 |
|
|
AXI4-Lite or Intel's Avalon. By using a full-featured bus protocol, complex SoC structures can be implemented (including
|
31 |
|
|
several modules and even multi-core architectures). Many FPGA EDA tools provide graphical editors to build and customize
|
32 |
|
|
whole SoC architectures and even include pre-defined IP libraries.
|
33 |
|
|
|
34 |
|
|
.Example AXI SoC using Xilinx Vivado
|
35 |
|
|
image::neorv32_axi_soc.png[]
|
36 |
|
|
|
37 |
|
|
The bus interface uses a memory-mapped approach. All data transfers are handled by simple load/store operations since the
|
38 |
|
|
external bus interface is mapped into the processor's https://stnolting.github.io/neorv32/#_address_space[address space].
|
39 |
|
|
This allows a very simple still high-bandwidth communications.
|
40 |
|
|
|
41 |
|
|
|
42 |
|
|
=== Stream Link Interface
|
43 |
|
|
|
44 |
|
|
The NEORV32 https://stnolting.github.io/neorv32/#_stream_link_interface_slink[Stream Link Interface] provides
|
45 |
|
|
point-to-point, unidirectional and parallel data channels that can be used to transfer streaming data. In
|
46 |
|
|
contrast to the external bus interface, the streaming data does not provide any kind of "direction" control,
|
47 |
|
|
so it can be seen as "constant address bursts". The stream link interface provides less protocol overhead
|
48 |
|
|
and less latency than the bus interface. Furthermore, FIFOs can be be configured to each direction (RX/TX) to
|
49 |
|
|
allow more CPU-independent operation.
|
50 |
|
|
|
51 |
|
|
|
52 |
|
|
=== Custom Functions Subsystem
|
53 |
|
|
|
54 |
|
|
The NEORV32 https://stnolting.github.io/neorv32/#_custom_functions_subsystem_cfs[Custom Functions Subsystem] is
|
55 |
|
|
an "empty" template for a processor-internal module. It provides 32 32-bit memory-mapped interface
|
56 |
|
|
registers that can be used to communicate with any arbitrary custom design logic. The intentions of this
|
57 |
|
|
subsystem is to provide a simple base, where the user can concentrate on implementing the actual design logic
|
58 |
|
|
rather than taking care of the communication between the CPU/software and the design logic. The interface
|
59 |
|
|
registers are already allocated within the processor's address space and are supported by the software framework
|
60 |
|
|
via low-level hardware access mechanisms. Additionally, the CFS provides a direct pre-defined interrupt channel to
|
61 |
|
|
the CPU, which is also supported by the NEORV32 runtime environment.
|