20. Neural-ART accelerator™ (NPU)

20.1 NPU introduction

Neural-ART accelerator is a branded family of design-time parametric and runtime reconfigurable neural processing unit (NPU) cores. These cores are specifically designed to accelerate (in area-constrained embedded and IoT devices) the inference execution of a wide range of quantized convolutional neural network (CNN) models.

Figure 114. Stream processing engine

Block diagram of the Stream processing engine showing internal components and interfaces.

The diagram illustrates the internal architecture of the Stream processing engine. At the top, an 'AHB ctrl I/F' connects to a 'Clocks / Configuration / Interrupts / Debug control' block. Below this, a 'System bus I/F and arbiter' block is connected to two external 'AXI' interfaces: 'AXI-0 master I/F' and 'AXI-1 master I/F'. The central part of the engine features a 'Stream switch configurable network' block. To its left are three 'Stream engine' blocks, and to its right are three 'Processing unit' blocks. Each 'Stream engine' and 'Processing unit' is connected to the 'Stream switch' via dashed lines. The 'Stream switch' itself has multiple ports, indicated by small squares, which connect to the 'Stream engines' and 'Processing units'. A legend at the bottom identifies the components: 'FCT' (Functional unit) for the Stream engine and Processing unit blocks, 'CTRL' (Interface or Control unit) for the System bus I/F and arbiter and Clocks/Configuration/Interrupts/Debug control blocks, 'Master port' (dark blue square) for the AXI interfaces and Stream switch, and 'Slave port' (light blue square) for the connections between the Stream switch and the Stream engines/Processing units. The diagram is labeled 'MSv56773V1' in the bottom right corner.

Block diagram of the Stream processing engine showing internal components and interfaces.

Stream processing

The ST stream processing technology allows the creation of on-demand performance- and area-tailored instances to address artificial intelligence (AI) applications, from the lowest to the highest end class.

The ST stream processing technology is deemed far more flexible than a hardware data path, and more power-efficient than an on-chip memory bus. The core is a configurable data flow fabric, also known as stream switch, which can be programmed at runtime to create arbitrary virtual chains of processing units (PUs), implementing the sequence of operations to execute. Multiple chains can be active at the same time, provided there are enough available hardware resources.

In the virtual chains, data flow unidirectionally from one PU to the other, hence a processing chain cannot be faster than the slowest element in the chain. A back pressure mechanism controls the data flow in a virtual chain, and data streams can be easily forked or joined to feed multiple destinations, enabling multicasting, context switching, and filtering.

Chaining as many accelerators as possible in a single virtual chain reduces the number of useless and power consuming transfers from/to memory, thus reducing the overall memory traffic and the power consumption.

The resulting IP communicates with the rest of the system through stream engine units. These are smart half-DMA's that can read, and write the data to/from external memory to transfer from/to the IP internal buffers. Although not primarily intended for that, memory-to-memory transfers are possible, connecting two stream engines back to back.

Figure 115. Chaining of processing units

Diagram illustrating the chaining of processing units. It shows three 'Streamer IN' units on the left, each receiving data from memory. These units are connected to two processing units, PU1,1 and PU2,2. PU1,1 is connected to PU1,2, which is then connected to a 'Streamer OUT' unit. PU2,2 is connected to another 'Streamer OUT' unit. The 'Streamer OUT' units push data to memory. The entire system is enclosed in a dashed box labeled MSV56774V1.
Diagram illustrating the chaining of processing units. It shows three 'Streamer IN' units on the left, each receiving data from memory. These units are connected to two processing units, PU1,1 and PU2,2. PU1,1 is connected to PU1,2, which is then connected to a 'Streamer OUT' unit. PU2,2 is connected to another 'Streamer OUT' unit. The 'Streamer OUT' units push data to memory. The entire system is enclosed in a dashed box labeled MSV56774V1.

Epoch definition

The execution of CNN models is organized into indivisible processing sequences called epochs. A hardware epoch is defined by the sequence that starts with the configuration of the NPU by the host CPU, and ends with an interrupt sent back to the CPU. The host CPU can then trigger another hardware epoch or execute some software computing for the layers not accelerated by the hardware.

20.2 NPU implementation

The Neural-ART 14 NPU uses a 4CA configuration with the functional units listed in Table 108.

Table 108. Neural-ART 14 NPU configuration

CountUnitDescription
1STRSWITCHCentral data stream switch
2DECUNDecompression unit
4CONVACCConvolutional accelerator
2POOLPooling unit
2ACTIVActivation unit
4ARITHArithmetic unit for scalar arithmetic operators
1RECBUFReconfigurable buffer (FIFO smart buffer)
10STRENGStream engines , with embedded cipher
2BUSIF64-bit AXI interface
1EPOCHEpoch controller

Table 108. Neural-ART 14 NPU configuration (continued)

CountUnitDescription
1DEBUGDebug controller
-SERVICESConfiguration network, Clock and reset manager, Interrupt controller

20.3 NPU functional description

20.3.1 NPU block diagram

The internal organization of the NPU is shown in Figure 116 .

Figure 116. Neural-ART 14 NPU accelerator

Block diagram of the Neural-ART 14 NPU accelerator showing internal components and interfaces.

The diagram illustrates the internal architecture of the Neural-ART 14 NPU accelerator. At the top, a 'Stream switch' block (enclosed in a dashed pink box) is connected to a 'REC BUF' block on the left and a vertical stack of functional units on the right: 'COMPR 2x ', 'CA 0 2x ', 'CA 1 2x ', 'POOL 2x ', 'ACTIV 2x ', and 'ARITH 4x '. The 'Stream switch' contains a '4CA' label and a key icon with the binary sequence '10101011'. Below the stream switch, four 'DMA' blocks (0, 4, 5, and 9) are shown, each connected to a 'Bus arbiter and System bus I/F' block. These bus arbiters are connected to '64-bit AXI master I/Fs' at the bottom. On the left side, there are 'CLK CTRL', 'IT I/F' (connected to 'IT Lines'), and 'CTRL I/F' blocks. The 'CTRL I/F' is connected to an 'AHB slave I/F' at the bottom. On the right side, there are 'Debug/Trace unit' and 'Epoch CTRL' blocks. A legend at the bottom identifies the components: 'FCT' (Functional unit), 'IF' (Interface unit), 'CTRL' (Control unit), 'Master port' (dark blue square), and 'Slave port' (light blue square). The reference code 'MSV56775V1' is in the bottom right corner.

Block diagram of the Neural-ART 14 NPU accelerator showing internal components and interfaces.

When the NPU is configured and started, it autonomously fetches data from the external memory to feed its internal dynamically interconnected processing units. Similarly, the result of the operation sequence is flushed to the external memory.

Inputs/sources can be the activations/features, but also parameters, such as weights and

biases constant data hosted in a memory-mapped nonvolatile memory. When the data-stream processing pipes are configured and started, the settings cannot be modified until the end-of-transfer event notifications of all DMA-outs and sinks.

20.3.2 NPU pins and internal signals

The NPU connects to the system through:

One interrupt signal fires when the processing for the current epoch is complete. Some additional signals are used for clock, reset, test, and debug. The complete list is given in Table 109 .

Table 109. Neural-ART 14 NPU signals

SignalDirectionWidthDescription
ipu_clkIn1Main clock
ipu_rst_nIn1Reset
host_intOut4Host interrupts
dbg_freeze_asyncIn1Debug freeze input signal (active high)
ext_triggers_asyncIn4External synchronization triggers (line based)
trig_sigOut8Trigger signals to an external trace unit (available only in configurations including debug and trace unit)
AXI 0AXI master port 0See Arm specification
AXI 1AXI master port 1
AHBAHB slave port
ATPIn26Memory test port
TBYPASSIn26
TBISTxIn26Memory BIST
HSIn26Memory speed select
STDBYIn26Memory standby
PSWLARGEMAIn26Memory power enable
PSWLARGEMPIn26
PSWSMALLMAIn26
PSWSMALLMPIn26
SLEEPIn26Memory sleep

20.3.3 Configuration network

Each of the functional units, whether accelerator or interface, has a configuration space made of a collection of configuration registers. These registers are accessible through the AHB interface. Their detailed description is out of the scope of the present document.

The NPU embeds a configuration network that provides host processor access to the configuration space of the different units in the Neural-ART core. This configuration network connects to the system backbone through a 32-bit AHB5-lite port. It supports a single 32-bit wide read and write transaction, with no pipelining nor outstanding transactions.

20.3.4 Clock/reset manager

The purpose of this unit is twofold:

1. Clock control

The NPU uses a single functional clock provided by the RCC. This input clock is fed to the clock control unit from where it is gated and fed to the different units of the IP.

The clock unit generates clocks not gated, and clocks gated by default that need to be enabled after reset.

Clock gating is controlled by a configuration register bank, accessible via the configuration network, and programmed by the control code generated by the NPU compiler tool chain.

2. Reset control

The NPU uses a single functional reset provided by the RCC. This reset signal is synchronized inside the IP and fed to the different functional units.

Setting the clear bit in the control configuration register triggers a global NPU reset.

A stream link is a unidirectional interconnection to transport data streams from accelerator units, stream engines, and interfaces to the stream switch and vice versa.

The stream consists of data, messages, or commands, and additional signaling information.

20.3.6 Stream switch

This switch dynamically connects output stream link ports to input stream link ports, depending on the configuration data written to the configuration registers.

All input stream link ports can forward their data streams to one or multiple (multicast) output ports at the same time, allowing replication of the data stream.

Two stream links can be connected to a single output port of the switch. In this case, the output data are managed using a time-division context switch approach.

20.3.7 Stream engines

These engines manage the transfer from the system to the processing units and vice versa.

Figure 117. Stream engines

Figure 117. Stream engines. A block diagram showing the internal architecture of the Neural-ART accelerator. On the left, an 'AXI master I/F' connects to an 'AXI I/F CTRL' block. This block is connected to a 'Priority arbiter' and a 'Configuration registers' block. The 'Priority arbiter' is connected to a series of stream engines: 'Engine0', 'Engine1', and 'EngineN'. Each engine has a 'Pack' and 'unPack' block between the arbiter and the engine. Each engine also has a 'Buffer' block between the engine and a 'Stream Link IF' (labeled 'Stream Link IF0', 'Stream Link IF1', and 'Stream Link IFN' respectively). The 'Configuration registers' block is connected to the 'Control I/F' and the 'AXI I/F CTRL' block. The diagram is labeled 'MSv56776V1' in the bottom right corner.
Figure 117. Stream engines. A block diagram showing the internal architecture of the Neural-ART accelerator. On the left, an 'AXI master I/F' connects to an 'AXI I/F CTRL' block. This block is connected to a 'Priority arbiter' and a 'Configuration registers' block. The 'Priority arbiter' is connected to a series of stream engines: 'Engine0', 'Engine1', and 'EngineN'. Each engine has a 'Pack' and 'unPack' block between the arbiter and the engine. Each engine also has a 'Buffer' block between the engine and a 'Stream Link IF' (labeled 'Stream Link IF0', 'Stream Link IF1', and 'Stream Link IFN' respectively). The 'Configuration registers' block is connected to the 'Control I/F' and the 'AXI I/F CTRL' block. The diagram is labeled 'MSv56776V1' in the bottom right corner.

A stream engine connects to the stream switch by one input and one output stream link.

The stream engine offers a high configurability on read/write memory patterns:

Linked lists are supported.

20.3.8 Encryption/Decryption unit

A low overhead/latency encryption/decryption unit based on Keccak-p[200] SHA-3 algorithm cipher, with a programmable number of rounds, is integrated in the bus interface, and can be shared between the different stream engines. It supports both weights and activation decryption and encryption.

20.3.9 Decompression unit

This unit supports on-the-fly decoding for scalar quantized data associated with kernels weights (with arbitrary quantization function), and decoding of vector quantized groups of weights.

An n-dimensional space can be described in a lossy way, by subdividing it into subvolumes, each described by its centroid. The subvolumes are obtained to minimize a predefined distortion function. The whole signal space can be represented with huge savings in terms of storage, as it is possible to represent the space of interest using only centroid values.

Figure 118. Two dimensional lossy compression

A 2D scatter plot showing lossy compression. The x-axis is labeled x1 and the y-axis is labeled x2, both ranging from 0 to 1.0. The plot is divided into several irregular polygonal regions. Within each region, there are numerous small grey dots representing data points. A few larger pink dots are placed within each region, representing the quantized values or code vectors. The text 'MSv56777V1' is visible in the bottom right corner of the plot area.
A 2D scatter plot showing lossy compression. The x-axis is labeled x1 and the y-axis is labeled x2, both ranging from 0 to 1.0. The plot is divided into several irregular polygonal regions. Within each region, there are numerous small grey dots representing data points. A few larger pink dots are placed within each region, representing the quantized values or code vectors. The text 'MSv56777V1' is visible in the bottom right corner of the plot area.

Quantization functions and/or vector quantizer code books (CB) are defined with an offline tool part of the NPU compiler toolchain. The encoder maps the input range into a finite range of rational values, called the code book. Any value stored by the CB is called a code vector. A code vector is made by up to eight code words. Each code book can store up to 256 code vectors (CV).

Figure 119. Decompression unit (DECUN)

A block diagram of the Decompression unit (DECUN). On the left, three inputs are shown: 'Data index' (8-bit), 'Kernel data' (24-bit), and 'Control I/F'. The 'Data index' and 'Kernel data' inputs pass through 'Stream buffer' blocks. The 'Control I/F' input passes through a 'Control' block. These three components feed into a central 'LUT' (Look-Up Table) block. Inside the 'LUT' block, there is a 'Control' block and two 'codeBook' blocks labeled 'codeBook 0' and 'codeBook 1'. The output of the 'LUT' block passes through another 'Stream buffer' block to produce the final 'Decompressed data'. The text 'MSv56778V1' is visible in the bottom right corner of the diagram area.
A block diagram of the Decompression unit (DECUN). On the left, three inputs are shown: 'Data index' (8-bit), 'Kernel data' (24-bit), and 'Control I/F'. The 'Data index' and 'Kernel data' inputs pass through 'Stream buffer' blocks. The 'Control I/F' input passes through a 'Control' block. These three components feed into a central 'LUT' (Look-Up Table) block. Inside the 'LUT' block, there is a 'Control' block and two 'codeBook' blocks labeled 'codeBook 0' and 'codeBook 1'. The output of the 'LUT' block passes through another 'Stream buffer' block to produce the final 'Decompressed data'. The text 'MSv56778V1' is visible in the bottom right corner of the diagram area.

The decompression unit connects to the stream switch by two input stream links and one output stream link.

20.3.10 Convolutional accelerator

This is the core of the NPU. It implements clusters of multiply-accumulate (MAC) engines supporting fixed-point acceleration of the 3x3 convolutions used by many of the neural network models. It can be configured as 16- or 8-bit MACs, depending on which fixed-point precision for kernels and feature data is considered sufficient.

Figure 120. Convolutional accelerator (CONVACC)

Figure 120. Convolutional accelerator (CONVACC) block diagram. The diagram shows three input streams on the left: Feature data (16-bit), Kernel data (16-bit), and BatchN-1 (24-bit). Feature data passes through a Stream buffer, Pre processing, and Feature line buffer to a MAC clusters block (containing six clusters of three MAC units each). Kernel data passes through a Stream buffer to a Kernel buffer, which also feeds into the MAC clusters. BatchN-1 passes through a Stream buffer to an Adder tree. The MAC clusters also feed into the Adder tree. The Adder tree output passes through a Stream buffer to an output stream labeled BatchN. A Control I/F block at the bottom right connects to the Adder tree and Configuration registers. The diagram is labeled MSv56779V1.
Figure 120. Convolutional accelerator (CONVACC) block diagram. The diagram shows three input streams on the left: Feature data (16-bit), Kernel data (16-bit), and BatchN-1 (24-bit). Feature data passes through a Stream buffer, Pre processing, and Feature line buffer to a MAC clusters block (containing six clusters of three MAC units each). Kernel data passes through a Stream buffer to a Kernel buffer, which also feeds into the MAC clusters. BatchN-1 passes through a Stream buffer to an Adder tree. The MAC clusters also feed into the Adder tree. The Adder tree output passes through a Stream buffer to an output stream labeled BatchN. A Control I/F block at the bottom right connects to the Adder tree and Configuration registers. The diagram is labeled MSv56779V1.

The convolution accelerator connects to the stream switch by three input stream links and one output stream link.

Each convolution accelerator supports signed or unsigned arithmetic. It includes eighteen 16-bit MAC units grouped as six clusters of three MAC units. Each MAC performs a single 16x16-, two 16x8-, or four 8x8-bit multiply accumulate operation, which sums up to a maximum of 18 16x16-, 36 16x8-, or 72 8x8-bit multiply accumulate operations per clock cycle and per convolution accelerator unit.

The preprocessing unit implements the following sequence:

  1. 1. Format detection: determines if the data is raster scan or raw
  2. 2. Shift/round/saturation
  3. 3. HOR/VER cropping
  4. 4. Zero frame generation: on-the-fly extend the feature tensor structure.
  5. 5. Iteration control: simplifies the iterative processing of kernels larger than the 3x3 natively supported by the convolutional accelerator.

20.3.11 Pooling unit

This unit supports pooling operations like local 2D windowed (MxN) min, max, average pooling, as well as global max, min, or average pooling.

Supported features include:

Figure 121. Example of pooling operations

Figure 121 shows two examples of pooling operations. The left example shows a 4x4 input grid with values [1, 1, 2, 4; 5, 6, 7, 8; 3, 2, 1, 0; 1, 2, 3, 4] being processed with a 2x2 filter and stride 2 to produce a 2x2 output grid [6, 8; 3, 4]. The right example shows a 4x4 input grid with values [0, 0, 2, 4; 2, 2, 6, 8; 9, 3, 2, 2; 7, 5, 2, 2] being processed with a 2x2 filter and stride 2 to produce a 2x2 output grid [1, 5; 6, 2].

Max pool with 2x2 filters and stride 2

Average pool with 2x2 filters and stride 2

MSV56780V1

Figure 121 shows two examples of pooling operations. The left example shows a 4x4 input grid with values [1, 1, 2, 4; 5, 6, 7, 8; 3, 2, 1, 0; 1, 2, 3, 4] being processed with a 2x2 filter and stride 2 to produce a 2x2 output grid [6, 8; 3, 4]. The right example shows a 4x4 input grid with values [0, 0, 2, 4; 2, 2, 6, 8; 9, 3, 2, 2; 7, 5, 2, 2] being processed with a 2x2 filter and stride 2 to produce a 2x2 output grid [1, 5; 6, 2].

Figure 122. Pooling unit (POOL)

Figure 122 is a block diagram of the Pooling unit (POOL). It shows a sequence of processing blocks: Stream filter, Cropper, Line buffers, Row calc, Padding control, Batch buffer (partial results), Row calc, Avg/Mul, and Stride mgt. A Global pooling unit is connected to the output of the Row calc block. All blocks are controlled by a Configuration registers block, which is in turn controlled by a Control I/F.

MSV56781V1

Figure 122 is a block diagram of the Pooling unit (POOL). It shows a sequence of processing blocks: Stream filter, Cropper, Line buffers, Row calc, Padding control, Batch buffer (partial results), Row calc, Avg/Mul, and Stride mgt. A Global pooling unit is connected to the output of the Row calc block. All blocks are controlled by a Configuration registers block, which is in turn controlled by a Control I/F.

The pooling unit connects to the stream switch by one input and one output stream link:

20.3.12 Activation unit

This unit implements the activation functions associated with convolutional neural networks. It provides a dedicated path to compute ReLU-like activations such as plain, parametric, and thresholded ReLUs. There is also a generic function evaluator using a second-degree piece-wise polynomial approximation ( \( y = ax^2 + bx + c \) or \( y = (ax + b) * x + c \) ). It uses a hierarchical uniform segmentation scheme to implement the evaluator.

Figure 123. Activation unit (ACTIV)

Block diagram of the Activation unit (ACTIV). The unit takes 'Activation data' (8-bit) and a 'Control I/F' as inputs. The 'Activation data' is split: one path goes to a 'LUT address generator', which outputs an 'Address' to 'Coefficient memory'. The 'Coefficient memory' outputs three values to a 'Function evaluator'. Another path of the 'Activation data' goes directly to the 'Function evaluator' and a 'RELU variant evaluator'. The 'Control I/F' goes to a 'Control' block, which outputs to 'Configuration registers'. The 'Configuration registers' provide 'ReLU activation type', 'ReLU parameters', and 'Activation type' to the 'RELU variant evaluator'. Both the 'Function evaluator' and the 'RELU variant evaluator' output to a multiplexer. The output of the multiplexer is the final result, indicated by an arrow pointing out of the unit. The diagram is labeled MSv56782V1.
Block diagram of the Activation unit (ACTIV). The unit takes 'Activation data' (8-bit) and a 'Control I/F' as inputs. The 'Activation data' is split: one path goes to a 'LUT address generator', which outputs an 'Address' to 'Coefficient memory'. The 'Coefficient memory' outputs three values to a 'Function evaluator'. Another path of the 'Activation data' goes directly to the 'Function evaluator' and a 'RELU variant evaluator'. The 'Control I/F' goes to a 'Control' block, which outputs to 'Configuration registers'. The 'Configuration registers' provide 'ReLU activation type', 'ReLU parameters', and 'Activation type' to the 'RELU variant evaluator'. Both the 'Function evaluator' and the 'RELU variant evaluator' output to a multiplexer. The output of the multiplexer is the final result, indicated by an arrow pointing out of the unit. The diagram is labeled MSv56782V1.

The unit connects to the stream switch by one input stream link and one output stream link.

Table 110 provides examples of usual activation functions.

Table 110. Activation functions example

FunctionPlotEquationDerivative
Identity

Image: Plot of the identity function f(x) = x, showing a straight line with a slope of 1 passing through the origin on a grid.

\( f(x) = x \)\( f'(x) = 1 \)

Table 110. Activation functions example (continued)

FunctionPlotEquationDerivative
Binary stepPlot of the binary step function, which is 0 for x < 0 and 1 for x >= 0.
\[ f(x) = \begin{cases} 0 & \text{for } x < 0 \\ 1 & \text{for } x \geq 0 \end{cases} \]
\[ f'(x) = \begin{cases} 0 & \text{for } x \neq 0 \\ \infty & \text{for } x = 0 \end{cases} \]
LogisticPlot of the logistic function, an S-shaped curve ranging from 0 to 1.
\[ f(x) = \frac{1}{1 + e^{-x}} \]
\[ f'(x) = f(x)(1 - f(x)) \]
Hyperbolic tangentPlot of the hyperbolic tangent function, an S-shaped curve ranging from -1 to 1.
\[ f(x) = \tanh(x) \]

\[ = \left( \frac{2}{1 + e^{-2x}} - 1 \right) \]
\[ f'(x) = 1 - f(x)^2 \]
ArctanPlot of the arctan function, an S-shaped curve ranging from -pi/2 to pi/2.
\[ f(x) = \text{atan}(x) \]
\[ f'(x) = \frac{1}{x^2 + 1} \]
Rectified linear unit (ReLU)Plot of the ReLU function, which is 0 for x < 0 and x for x >= 0.
\[ f(x) = \begin{cases} 0 & \text{for } x < 0 \\ x & \text{for } x \geq 0 \end{cases} \]
\[ f'(x) = \begin{cases} 0 & \text{for } x < 0 \\ 1 & \text{for } x \geq 0 \end{cases} \]
Parametric rectified linear unit (PReLU)Plot of the PReLU function, which is ax for x < 0 and x for x >= 0.
\[ f(x) = \begin{cases} ax & \text{for } x < 0 \\ x & \text{for } x \geq 0 \end{cases} \]
\[ f'(x) = \begin{cases} a & \text{for } x < 0 \\ 1 & \text{for } x \geq 0 \end{cases} \]

Table 110. Activation functions example (continued)

FunctionPlotEquationDerivative
Exponential linear unit (ELU)Plot of the Exponential linear unit (ELU) function. The curve is negative for x < 0, approaching a horizontal asymptote at y = -a, and passes through the origin (0,0) with a slope of 1. For x > 0, it increases linearly.
\[ f(x) = \begin{cases} a(e^x - 1) \text{ for } x < 0 \\ x \text{ for } x \geq 0 \end{cases} \]
\[ f'(x) = \begin{cases} f(x) + a \text{ for } x < 0 \\ 1 \text{ for } x \geq 0 \end{cases} \]
SoftPlusPlot of the SoftPlus function. It is a smooth, convex curve that is approximately linear for negative x and approaches a horizontal asymptote at y = ln(2) for positive x. It passes through the origin (0,0).
\[ f(x) = \ln(1 + e^x) \]
\[ f'(x) = \frac{1}{1 + e^{-x}} \]

20.3.13 Arithmetic unit

The arithmetic unit can handle outputs coming directly from the convolution accelerators. The main function is \( aX + bY + c \) , where X and Y are input data streams, supplied via two input stream link interfaces and a, b and c are constants that are either vectors or scalars, which are preloaded into an internal memory via the configuration interface.

The arithmetic unit can be configured to perform other operations:

Based on the choice and type of coefficients, the unit can also perform element-wise operations like \( x - y \) , \( x + y \) , and similar ones.

Figure 124. Arithmetic unit (ARITH)

Block diagram of the Arithmetic unit (ARITH). Two inputs, X and Y, enter stream buffers. The buffered data is fed into a central processing block containing Logical, X * Y, Min(X, Y), Max(X, Y), and aX + bY + c operations. A Control I/F connects to a Control block, which in turn connects to configuration registers 'a', 'b', and 'c'. These registers provide inputs to the aX + bY + c operation. The output of the central block passes through a Clip block to an output stream link. The identifier MSV56783V1 is shown in the bottom right corner.
Block diagram of the Arithmetic unit (ARITH). Two inputs, X and Y, enter stream buffers. The buffered data is fed into a central processing block containing Logical, X * Y, Min(X, Y), Max(X, Y), and aX + bY + c operations. A Control I/F connects to a Control block, which in turn connects to configuration registers 'a', 'b', and 'c'. These registers provide inputs to the aX + bY + c operation. The output of the central block passes through a Clip block to an output stream link. The identifier MSV56783V1 is shown in the bottom right corner.

This unit connects to the stream switch by two input stream links and one output stream link.

20.3.14 Reconfigurable buffer

The amount of data to process is usually divided using channel-wise data segmentation strategies. The data are then organized in execution epochs and channel data blocks along the three spatial dimensions. Data blocks are created considering the number of channels and the size of the incoming data. The partial data coming out from the different data blocks must then be reorganized and used in the next processing.

The reconfigurable buffer takes and stores the input data before making them available to the following units, which is useful to avoid deadlocks.

20.3.15 Epoch controller

This controller makes the NPU operation independent from the host CPU, which just provides a pointer to a 64-bit aligned “binary blob” placed in a memory space accessible through the AXI IF. The binary blob can be encrypted.

The core of the epoch controller is an FSM that decodes the control microinstructions, to appropriately configure all the processing units involved in the model execution using direct access to the NPU internal configuration bus.

The synchronization with the NPU is interrupt-based. An available step-by-step mode allows the execution of one microinstruction at a time. The execution is triggered by a write in a dedicated bit in the IRQ register.

The controller frees the AHB control bus for other uses, and improves the performance through a faster NPU programming. The binary blob is fetched through the AXI interface, which provides a larger bandwidth than the AHB. The direct access to the internal configuration bus allows bypassing all the bus external structure, where transactions from the host processor need to pass through.

20.3.16 Interrupt controller

Functional units can generate level-sensitive, active high, interrupts. These are collected by the interrupt controller, routed to four master interrupt lines, and forwarded to the host CPU.

When a master interrupt fires, the host CPU must read the INTREG register to identify the source of the current interrupt signaling. Interrupt routing to the four master interrupt lines and selective enabling are controlled by the INTORMSK and INTANDMSK mask registers, which have as many bits as interrupt sources.

20.4 Configuration examples

The following figures illustrate typical examples of streaming processing supported by the Neural-ART 14 NPU.

20.4.1 DMA transfer

The simplest possible chain involves one input streamer and one output streamer connected back-to-back, which (although not primarily intended for that) configures the NPU as a high-bandwidth DMA.

Figure 125. Memory to memory transfer

Diagram of memory to memory transfer showing Data IN (Memory) connected to Streamer IN, which is connected to Streamer OUT, which is connected to Data OUT (Memory). The streamers are enclosed in a dashed box representing the NPU.

The diagram illustrates a memory-to-memory transfer setup. On the left, a cylinder labeled 'Data IN' and 'Memory' has an arrow pointing to a blue rectangular block labeled 'Streamer IN'. This 'Streamer IN' block is connected to another blue rectangular block labeled 'Streamer OUT'. Both streamer blocks are enclosed within a dashed rectangular box. An arrow points from the 'Streamer OUT' block to a cylinder on the right labeled 'Data OUT' and 'Memory'. In the bottom right corner of the diagram, the text 'MSV56784V1' is present.

Diagram of memory to memory transfer showing Data IN (Memory) connected to Streamer IN, which is connected to Streamer OUT, which is connected to Data OUT (Memory). The streamers are enclosed in a dashed box representing the NPU.

20.4.2 Simple processing

The simplest processing chain involves one input streamer and one output streamer, with one processing unit in between.

Figure 126. Simple processing

Diagram of simple processing flow: Data IN (Memory) -> Streamer IN -> ARITH -> Streamer OUT -> Data OUT (Memory).

The diagram illustrates a simple processing chain. On the left, a 'Data IN' memory block feeds into a 'Streamer IN' block. This is followed by an 'ARITH' (arithmetic) block, then a 'Streamer OUT' block, which finally outputs to a 'Data OUT' memory block. The four central blocks are enclosed in a dashed box. A small label 'MSV56785V1' is in the bottom right corner.

Diagram of simple processing flow: Data IN (Memory) -> Streamer IN -> ARITH -> Streamer OUT -> Data OUT (Memory).

20.4.3 Multiple processing

Implements several independent simple processing chains, like the one in Figure 126.

Figure 127. Multiple processing

Diagram of multiple processing showing two independent chains. The top chain consists of Data IN (Memory) -> Streamer IN -> OP1 -> Streamer OUT -> Data OUT (Memory). The bottom chain consists of Data IN (Memory) -> Streamer IN -> OPN -> Streamer OUT -> Data OUT (Memory). Vertical ellipsis between OP1 and OPN indicates additional chains.

This diagram shows multiple independent processing chains. Two are explicitly shown: the top chain has 'Data IN' (Memory) -> 'Streamer IN' -> 'OP 1 ' -> 'Streamer OUT' -> 'Data OUT' (Memory); the bottom chain has 'Data IN' (Memory) -> 'Streamer IN' -> 'OP N ' -> 'Streamer OUT' -> 'Data OUT' (Memory). A vertical ellipsis between 'OP 1 ' and 'OP N ' indicates additional chains. Each chain's central part is in a dashed box. A small label 'MSV56786V1' is in the bottom right corner.

Diagram of multiple processing showing two independent chains. The top chain consists of Data IN (Memory) -> Streamer IN -> OP1 -> Streamer OUT -> Data OUT (Memory). The bottom chain consists of Data IN (Memory) -> Streamer IN -> OPN -> Streamer OUT -> Data OUT (Memory). Vertical ellipsis between OP1 and OPN indicates additional chains.

The number of independent chains is limited by the available hardware resources. It cannot exceed half the number of available stream engines, that is, five pairs of stream engines on Neural-ART 14, thus five chains.

20.4.4 Conv-Pool-ReLU

The virtual chain implementing the classical Conv-Pool-ReLU processing is illustrated in Figure 128.

Figure 128. Classical Conv-Pool-ReLU

Diagram of Classical Conv-Pool-ReLU processing flow. Two input streams, features IN (Memory) and kernel IN (Memory), feed into Streamer IN blocks. These then feed into a CONV block, followed by POOL, ReLU, and Streamer OUT blocks, which output to features OUT (Memory).

The diagram shows the 'Classical Conv-Pool-ReLU' processing flow. Two input streams, 'features IN' (Memory) and 'kernel IN' (Memory), each feed into a 'Streamer IN' block. Both 'Streamer IN' blocks then feed into a 'CONV' (convolution) block. This is followed by a 'POOL' (pooling) block, a 'ReLU' (rectified linear unit) block, and a 'Streamer OUT' block, which outputs to a 'features OUT' memory block. The five central blocks are enclosed in a dashed box. A note below the box states 'Note: POOL Is not always needed'. A small label 'MSV56787V1' is in the bottom right corner.

Diagram of Classical Conv-Pool-ReLU processing flow. Two input streams, features IN (Memory) and kernel IN (Memory), feed into Streamer IN blocks. These then feed into a CONV block, followed by POOL, ReLU, and Streamer OUT blocks, which output to features OUT (Memory).

20.4.5 Chained convolutions

Figure 129 shows an example of chained convolutions.

Figure 129. Chained convolutions

Diagram of chained convolutions showing a sequence of operations: Streamer IN, CONV1, CONV2, ..., CONVn, POOL, ReLU, and Streamer OUT. Data flows from features IN and kernel IN memory through these stages to produce features OUT.

The diagram illustrates a chain of operations within a dashed box. It starts with 'features IN' and 'kernel IN' in 'Memory' blocks. 'features IN' connects to a 'Streamer IN' block, which then connects to a series of convolution blocks labeled 'CONV 1 ', 'CONV 2 ', ..., 'CONV N '. A 'Partial sum' line connects 'CONV 1 ' to 'CONV 2 '. This is followed by 'POOL', 'ReLU', and 'Streamer OUT' blocks. The output of 'Streamer OUT' goes to a 'features OUT' 'Memory' block. A note at the bottom states: 'Note: Chaining can run from 1 to N = 4 convolutions'. The identifier 'MSv56788V1' is in the bottom right corner.

Diagram of chained convolutions showing a sequence of operations: Streamer IN, CONV1, CONV2, ..., CONVn, POOL, ReLU, and Streamer OUT. Data flows from features IN and kernel IN memory through these stages to produce features OUT.

Neural-ART 14 allows chaining up to four convolutions.

It is possible to use S CONVACCs in series, which requires (S times) more feature data bandwidth, but the same bandwidth for accumulation and output data as a single accelerator.

It is also possible to use P CONVACCs in parallel (see Figure 127), which reuse the same feature data requiring P times the amount of accumulation data and output data bandwidth.

20.4.6 Split convolutions

Figure 130 shows an example of split convolution.

Figure 130. Split convolution

Diagram of split convolution showing two parallel processing paths. Each path consists of Streamer IN, CONV, POOL, ReLU, and Streamer OUT blocks. Both paths take features IN and kernel IN as input and produce their own features OUT.

The diagram shows two parallel processing paths within a dashed box. Both paths start with 'features IN' and 'kernel IN' in 'Memory' blocks. Each path has its own 'Streamer IN' block. The first path consists of 'CONV', 'POOL', 'ReLU', and 'Streamer OUT' blocks, leading to a 'features OUT' 'Memory' block. The second path is identical to the first. The identifier 'MSv56789V1' is in the bottom right corner.

Diagram of split convolution showing two parallel processing paths. Each path consists of Streamer IN, CONV, POOL, ReLU, and Streamer OUT blocks. Both paths take features IN and kernel IN as input and produce their own features OUT.

20.5 Address space

The configuration bus address mapping depends on the specific NPU instance configuration. Each of the functional units has a 4-Kbyte configuration space, which yields a 128-Kbyte configuration space for the total IP, organized as shown in Table 111 .

Table 111. Neural-ART 14 functional units memory base addresses (1)

OffsetUnitDescription
0x0000CLKCTRLClock and reset manager
0x1000INTCTRLInterrupt controller
0x2000BUSIF0Bus interface 0
0x3000BUSIF1Bus interface 1
0x4000STRSWITCHStream switch
0x5000STRENG0Stream engine 0
0x6000STRENG1Stream engine 1
0x7000STRENG2Stream engine 2
0x8000STRENG3Stream engine 3
0x9000STRENG4Stream engine 4
0xA000STRENG5Stream engine 5
0xB000STRENG6Stream engine 6
0xC000STRENG7Stream engine 7
0xD000STRENG8Stream engine 8
0xE000STRENG9Stream engine 9
0xF000CONVACC0Convolutional accelerator unit 1
0x10000CONVACC1Convolutional accelerator unit 2
0x11000CONVACC2Convolutional accelerator unit 3
0x12000CONVACC3Convolutional accelerator unit 4
0x13000DECUN0Decompression unit 0
0x14000DECUN1Decompression unit 1
0x15000ACTIV0Activation unit 0
0x16000ACTIV1Activation unit 1
0x17000ARITH0Arithmetic unit 0
0x18000ARITH1Arithmetic unit 1
0x19000ARITH2Arithmetic unit 2
0x1A000ARITH3Arithmetic unit 3
0x1B000POOL0Pooling unit 0
0x1C000POOL1Pooling unit 1
0x1D000RECBUF0Reconfigurable buffer 0
Table 111. Neural-ART 14 functional units memory base addresses (1) (continued)
OffsetUnitDescription
0x1E000EPOCHCTRL0Epoch controller 0
0x1F000DEBUG0Debug and Trace unit 0
  1. 1. The base address is the offset relative to the first address location of the Neural-ART core, defined at integration level. Refer to the memory map.

20.6 System integration

20.6.1 System considerations

The amount of memory required by the NPU depends on the complexity (number of layers to execute, size of the input data) and target performance of the selected model of neural network. This amount can vary by 1.5 orders of magnitude.

To reach peak performance, the system memory must be configured with enough independent memory banks. These must have a separate AXI slave port on the system interconnect to guarantee the maximum internal memory bandwidth and to benefit of the AXI bus parallelism.

In addition to the on-chip memory, dedicated external memory interfaces are needed to access a nonvolatile memory, where the model parameters (weights and biases) are hosted. Additional RAMs can be used to address large(r) neural networks that cannot fit entirely in the embedded memory. The response time (latency) and the available bandwidth of these interfaces is a limiting factor in the achievable frame rate and efficiency of the NPU processing units (such as MACs) utilization.

20.6.2 Architecture intent

The system architecture is designed to provide 4.2 Mbytes of contiguous system memory that can be seamlessly shared between the host and the NPU subsystems. At the same time, it offers privileged access to a meaningful high(er)-speed portion of these 4.2 Mbytes to the NPU.

A dedicated NPU cache (CACHEAXI) allows the mitigation of the bandwidth limitation when accessing external memories. When not used for caching, it can be configured as an additional RAM.

The Neural-ART 14 NPU simply connects to the system by two master AXI 64-bit ports that provide the high throughput needed for efficient acceleration of neural network models. Synchronization with the Cortex-M host CPU is through a slave AHB 32-bit port for NPU configuration, and interrupts connected to the NVIC.

Figure 131. Neural-ART 14 integration

Block diagram of Neural-ART 14 integration showing CM55ss, neuralArt NPU, Local NPU NIC, CPU NOC, and various memory components with their interconnections and bandwidths.

The diagram illustrates the integration of the Neural-ART 14 NPU with a Cortex-M55ss host CPU. The CM55ss (800 MHz / 600 MHz) includes I-TCM (64KB), D-TCM (32KB) with 6.4 GBps bandwidth, FPU, M-Profile Vector Extension, 32KB I$ and D$, and interfaces via S-AHB, M-AXI, and P-AHB. It connects to the neuralArt NPU (1 GHz / 800 MHz) via a 32-bit interface and IRQs. The NPU connects to the Local NPU NIC (900 MHz / 800 MHz) via two 64-bit AXI interfaces, each providing 16 GBps. The NIC connects to four AXISRAM banks (448KB each) with 14.4 GBps bandwidth each. The NPU also has access to CPU RAMs (6.4 GBps) and external RAMs (6.4 GBps). The CPU NOC (400 MHz) connects to flexMEM (400KB), AXISRAM1 (640KB), and AXISRAM2 (1MB) via 3x 64-bit AXI interfaces (6.4 GBps each). It also connects to NPU$ CTRL and NPU$ RAM (256KB) via CPU access to Fast axiRAMs and Cache access to external RAMs. The NOC connects to FMC, xSPI1, xSPI2, and xSPI3, which are further connected to xSPI PHY1 and xSPI PHY2. These PHYs connect to off-chip memory devices: SDRAM (32-bit, 166 MHz) with 666 MBps, hexaRAM (200 MHz) with 800 MBps, and octoFlash (200 MHz) with 400 MBps. The CPU NOC also connects to an AHB BUS (200 MHz) via 1.6 GBps interfaces, which in turn connects to AHB RAM (16KB) with 2x 1.6 GBps bandwidth. A key identifies Functional Units (FOT), Memory accessible by the NPU (xRAM), Memory accessible by the host CPU (yRAM), Master ports, Functional unit AXI master port, Functional unit AHB master port, and Slave Port. The diagram is labeled MSV56790V3.

Block diagram of Neural-ART 14 integration showing CM55ss, neuralArt NPU, Local NPU NIC, CPU NOC, and various memory components with their interconnections and bandwidths.

Security

The Neural-ART 14 is not TrustZone aware. Therefore, multicontext and multitenancy are supported through the implementation of isolation compartments separated by CIDs. The AHB control interface is protected by a RISUP placed upstream. A RIMU is placed in the downstream of the AXI master interfaces, to assign CID values, so that NPU could only access the sole memories protected with that CID. Refer to the security chapter for further information.

Control interface

The Cortex-M55 host CPU configures the Neural-ART 14 NPU subsystem through the AHB slave port, which is connected to one of the ports of the AHB system bus matrix.

Data interface

The two 64-bit wide master AXI-4 ports of the NPU connect to a high-speed local interconnect that provides four 448-Kbyte banks of fast memory with a privileged, high-throughput / low-latency, asynchronous access. Each bank is implemented as four 112-Kbyte physical memory cuts, served by a full-duplex memory controller. This offers

14.4 Gbyte/s, provided reads/writes are done to different memory cuts, distant by at least 112 Kbytes.

The high-speed local NIC also connects to the main NOC through an asynchronous bridge, which gives access to medium throughput / medium latency on-chip memories:

Finally, the NOC provides additional lower bandwidth / higher latency access to external memories connected to the FMC or xSPI controllers, with bandwidths of respectively 664 and 800 Mbyte/s.

The NPU does not have access to VENC or AHB memories.

Hardware triggers

The NPU provides four external asynchronous hardware trigger inputs. One of these is connected to the DCMIPP. The control SW can enable it to implement a CPU-less synchronization scheme between the camera pipeline and the NPU. This ancillary benefit of this pure hardware synchronization scheme is to reduce the size of the memory buffers used, as it is no longer needed to store a complete frame buffer.

Note: This synchronization scheme cannot be used if the model of CNN to execute requires preserving the input layer for the whole duration of the inference.

Virtual memPool

The actual amount of internal memory allocated to the NPU operation and the organization thereof is configurable by software.

Depending on the model of neural network to be executed, and of the size of the memory buffers it requires, the NPU compiler can dynamically decide to, either:

The compiler can create one or more virtual memory pools, which can group two or more of the contiguous memories accessible through the bus. This decision is frequency a/o protocol agnostic and only cares about address ranges. A virtual memory pool can thus group as many memory banks as needed and can extend from axiRAM1 (main NOC, clocked at 400 MHz) to axiRAM6 (NPU NIC, clocked at 1 GHz).

External memories accessible through the FMC or xSPI interfaces are not contiguous with any other on-chip memory and cannot be part of a virtual memory pool.


a. This grouping of two or more contiguous memory banks is known as a “virtual memory pool”.