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 like AHB ctrl I/F, Clocks / Configuration / Interrupts / Debug control, System bus I/F and arbiter, Stream engines, Stream switch configurable network, and Processing units. It also includes a legend for Functional unit, Interface or Control unit, Master port, and Slave port.

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. On the left, 'AXI-0 master I/F' and 'AXI-1 master I/F' interfaces connect to a 'System bus I/F and arbiter' block. This arbiter is linked to three 'Stream engine' blocks. These engines feed into a central 'Stream switch configurable network', which in turn connects to three 'Processing unit' blocks. A legend at the bottom defines the symbols: a blue box for 'Functional unit', a grey box for 'Interface or Control unit', a black square for 'Master port', and a white square for 'Slave port'. The identifier 'MSv56773V1' is located in the bottom right corner of the diagram area.

Block diagram of the Stream processing engine showing internal components like AHB ctrl I/F, Clocks / Configuration / Interrupts / Debug control, System bus I/F and arbiter, Stream engines, Stream switch configurable network, and Processing units. It also includes a legend for Functional unit, Interface or Control unit, Master port, and Slave port.

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-DMAs 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

Block diagram showing the chaining of processing units. Data flows from 'Fetch data from memory' through three 'Streamer IN' blocks. The top two Streamer IN blocks feed into 'PU1.1', which then feeds into 'PU1.2' and then 'Streamer OUT'. The bottom Streamer IN block feeds into 'PU2.2' and then 'Streamer OUT'. The final 'Streamer OUT' blocks lead to 'Push data to memory'. A reference code 'MSv56774V1' is at the bottom right.
graph LR; subgraph NPU; direction LR; S1[Streamer IN] --> PU11[PU1.1]; S2[Streamer IN] --> PU11; PU11 --> PU12[PU1.2]; PU12 --> SO1[Streamer OUT]; S3[Streamer IN] --> PU22[PU2.2]; PU22 --> SO2[Streamer OUT]; end; Fetch[Fetch data from memory] --> S1; Fetch --> S2; Fetch --> S3; SO1 --> Push[Push data to memory]; SO2 --> Push;
Block diagram showing the chaining of processing units. Data flows from 'Fetch data from memory' through three 'Streamer IN' blocks. The top two Streamer IN blocks feed into 'PU1.1', which then feeds into 'PU1.2' and then 'Streamer OUT'. The bottom Streamer IN block feeds into 'PU2.2' and then 'Streamer OUT'. The final 'Streamer OUT' blocks lead to 'Push data to memory'. A reference code 'MSv56774V1' is at the bottom right.

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
ST logo
ST logo

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. It is organized into several functional blocks:

Legend:

MSv56775V1

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. 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.

  1. 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

Block diagram of Stream engines architecture. An AXI master I/F connects to an AXI I/F CTRL block. This block connects to a switch. The switch connects to a Priority arbiter and three engine paths (Engine0, Engine1, ..., EngineN). Each engine path consists of a Pack block, an Engine block, and an unPack block. The Priority arbiter connects to the Pack blocks of all engines. The Engine blocks connect to Buffers, which in turn connect to Stream Link IFs (Link IF0, Link IF1, ..., Link IFN). A Control I/F connects to Configuration registers, which also interface with the switch and the engine paths. The diagram is labeled MSv56776V1 in the bottom right corner.
Block diagram of Stream engines architecture. An AXI master I/F connects to an AXI I/F CTRL block. This block connects to a switch. The switch connects to a Priority arbiter and three engine paths (Engine0, Engine1, ..., EngineN). Each engine path consists of a Pack block, an Engine block, and an unPack block. The Priority arbiter connects to the Pack blocks of all engines. The Engine blocks connect to Buffers, which in turn connect to Stream Link IFs (Link IF0, Link IF1, ..., Link IFN). A Control I/F connects to Configuration registers, which also interface with the switch and the engine paths. 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

Two dimensional lossy compression diagram showing a 2D space partitioned into Voronoi cells representing quantization regions. The axes are labeled x1 (horizontal, from 0 to 1.0) and x2 (vertical, from 0.2 to 1.0). Small grey dots represent data points scattered across the space, and magenta circles represent code vectors (centroids). Labeled MSv56777V1 at the bottom right.
Two dimensional lossy compression diagram showing a 2D space partitioned into Voronoi cells representing quantization regions. The axes are labeled x1 (horizontal, from 0 to 1.0) and x2 (vertical, from 0.2 to 1.0). Small grey dots represent data points scattered across the space, and magenta circles represent code vectors (centroids). Labeled MSv56777V1 at the bottom right.

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)

Block diagram of Decompression unit (DECUN). Inputs: Data index (8-bit bus with slash), Kernel data (24-bit bus with slash), and Control I/F. Stream buffers receive Data index and Kernel data, routing to Control. Control connects to a LUT containing codeBook 0 and codeBook 1. The output goes to an output Stream buffer which outputs Decompressed data. Labeled MSv56778V1 at the bottom right.
Block diagram of Decompression unit (DECUN). Inputs: Data index (8-bit bus with slash), Kernel data (24-bit bus with slash), and Control I/F. Stream buffers receive Data index and Kernel data, routing to Control. Control connects to a LUT containing codeBook 0 and codeBook 1. The output goes to an output Stream buffer which outputs Decompressed data. Labeled MSv56778V1 at the bottom right.

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)

Block diagram of the Convolutional accelerator (CONVACC) showing data flow from Feature data, Kernel data, and Batch data through stream buffers, pre-processing, feature line buffer, kernel buffer, MAC clusters, adder tree, and stream buffer to Batch output.

The diagram illustrates the internal architecture of the Convolutional accelerator (CONVACC). It shows three main input paths: Feature data (16-bit), Kernel data (16-bit), and Batch data (24-bit). Each input passes through a stream buffer. The Feature data path includes a pre-processing unit and a feature line buffer before entering the MAC clusters. The Kernel data path includes a kernel buffer before entering the MAC clusters. The Batch data path goes directly to the adder tree. The MAC clusters consist of six clusters, each containing three MAC units. The output of the MAC clusters goes to the adder tree, which then feeds into a final stream buffer before the Batch output. Configuration registers and Control I/F are also shown within the accelerator block.

Block diagram of the Convolutional accelerator (CONVACC) showing data flow from Feature data, Kernel data, and Batch data through stream buffers, pre-processing, feature line buffer, kernel buffer, MAC clusters, adder tree, and stream buffer to Batch output.

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: Example of pooling operations. It illustrates Max pool with 2x2 filters and stride 2 on a 4x4 matrix resulting in a 2x2 matrix, and Average pool with 2x2 filters and stride 2 on a 4x4 matrix resulting in a 2x2 matrix.

Max pool with 2x2 filters and stride 2 Average pool with 2x2 filters and stride 2

MSv56780V1

Figure 121: Example of pooling operations. It illustrates Max pool with 2x2 filters and stride 2 on a 4x4 matrix resulting in a 2x2 matrix, and Average pool with 2x2 filters and stride 2 on a 4x4 matrix resulting in a 2x2 matrix.

Figure 122. Pooling unit (POOL)

Figure 122: Pooling unit (POOL) block diagram showing data flow through Stream filter, Cropper, Line buffers, Row calc, Padding control, Batch buffer (partial results), Row calc, Global pooling unit, Avg/Mul, Stride mgt, along with Control I/F and Configuration registers.

MSv56781V1

Figure 122: Pooling unit (POOL) block diagram showing data flow through Stream filter, Cropper, Line buffers, Row calc, Padding control, Batch buffer (partial results), Row calc, Global pooling unit, Avg/Mul, Stride mgt, along with Control I/F and Configuration registers.

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²+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 8-bit Activation data and Control I/F as inputs. The Activation data is split to feed into a LUT address generator, a Function evaluator, and a RELU variant evaluator. The LUT address generator provides an Address to a Coefficient memory. The Coefficient memory provides coefficients to the Function evaluator. The RELU variant evaluator receives ReLU activation type and ReLU parameters from the Configuration registers. The Function evaluator and RELU variant evaluator outputs are multiplexed by a switch controlled by the Activation type from the Configuration registers. The switch output is then processed by a final block to produce the output. The Control I/F feeds into a Control block, which in turn feeds into the Configuration registers.

MSv56782V1

Block diagram of the Activation unit (ACTIV). The unit takes 8-bit Activation data and Control I/F as inputs. The Activation data is split to feed into a LUT address generator, a Function evaluator, and a RELU variant evaluator. The LUT address generator provides an Address to a Coefficient memory. The Coefficient memory provides coefficients to the Function evaluator. The RELU variant evaluator receives ReLU activation type and ReLU parameters from the Configuration registers. The Function evaluator and RELU variant evaluator outputs are multiplexed by a switch controlled by the Activation type from the Configuration registers. The switch output is then processed by a final block to produce the output. The Control I/F feeds into a Control block, which in turn feeds into the Configuration registers.

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 passing through the origin with a slope of 1.

f(x) = xf(x) = 1

Table 110. Activation functions example (continued)

FunctionPlotEquationDerivative
Binary stepPlot of the Binary step function: a horizontal line at y=0 for x < 0 and a horizontal line at y=1 for x >= 0, with a jump at 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 that starts near y=0 for large negative x and approaches y=1 for large positive x, passing through (0, 0.5).
\[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 that starts near y=-1 for large negative x and approaches y=1 for large positive x, passing through (0, 0).
\[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 that starts near y=-pi/2 for large negative x and approaches y=pi/2 for large positive x, passing through (0, 0).
\[f(x) = \text{atan}(x)\]
\[f'(x) = \frac{1}{x^2 + 1}\]
Rectified linear unit (ReLU)Plot of the Rectified Linear Unit (ReLU) function: a horizontal line at y=0 for x < 0 and a line with a slope of 1 for x >= 0, meeting at the origin (0, 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 Parametric Rectified Linear Unit (PReLU) function: a line with a small positive slope 'a' for x < 0 and a line with a slope of 1 for x >= 0, meeting at the origin (0, 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 smooth, passing through the origin, and has a horizontal asymptote at y = -1 for negative x values.
\[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. The curve is an S-shaped function that is always positive, passing through the origin, and has horizontal asymptotes at y = 0 for negative x and y = infinity for positive x.
\[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). Inputs X and Y pass through stream buffers into a central processing block containing Logical, X * Y, Min(X, Y), Max(X, Y), and aX + bY + c units. A Control block receives Control I/F and provides parameters a, b, and c to the aX + bY + c unit. The output of the central block goes to a Clip unit and then to the final output.

The diagram illustrates the Arithmetic unit (ARITH) architecture. It features two input streams, X and Y, which pass through stream buffers. These buffers feed into a central processing block containing five functional units: Logical, X*Y, Min(X,Y), Max(X,Y), and aX+bY+c. A Control block, which receives Control I/F, provides parameters a, b, and c to the aX+bY+c unit. The output of the central block is then processed by a Clip unit before reaching the final output. The diagram is labeled MSv56783V1.

Block diagram of the Arithmetic unit (ARITH). Inputs X and Y pass through stream buffers into a central processing block containing Logical, X * Y, Min(X, Y), Max(X, Y), and aX + bY + c units. A Control block receives Control I/F and provides parameters a, b, and c to the aX + bY + c unit. The output of the central block goes to a Clip unit and then to the final output.

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

A block diagram showing a memory to memory transfer. It includes 'Data IN' and 'Data OUT' labels, two 'Memory' blocks, and two 'Streamer' blocks (IN and OUT) connected in a sequence.
A block diagram showing a memory to memory transfer. It includes 'Data IN' and 'Data OUT' labels, two 'Memory' blocks, and two 'Streamer' blocks (IN and OUT) connected in a sequence.

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 Figure 126: Simple processing diagram. A single processing chain is shown within a dashed box. Data flows from 'Data IN Memory' to 'Streamer IN', then to 'ARITH', then to 'Streamer OUT', and finally to 'Data OUT Memory'. The reference code 'MSv56785V1' is in the bottom right corner.
Figure 126: Simple processing diagram. A single processing chain is shown within a dashed box. Data flows from 'Data IN Memory' to 'Streamer IN', then to 'ARITH', then to 'Streamer OUT', and finally to 'Data OUT Memory'. The reference code 'MSv56785V1' is in the bottom right corner.

20.4.3 Multiple processing

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

Figure 127. Multiple processing Figure 127: Multiple processing diagram. Two parallel processing chains are shown within a dashed box. Each chain starts with 'Data IN Memory' leading to 'Streamer IN', followed by an operation block (OP1 for the top chain, OPN for the bottom chain), then 'Streamer OUT', and finally 'Data OUT Memory'. Vertical dots between the chains indicate multiple independent chains. The reference code 'MSv56786V1' is in the bottom right corner.
Figure 127: Multiple processing diagram. Two parallel processing chains are shown within a dashed box. Each chain starts with 'Data IN Memory' leading to 'Streamer IN', followed by an operation block (OP1 for the top chain, OPN for the bottom chain), then 'Streamer OUT', and finally 'Data OUT Memory'. Vertical dots between the chains indicate multiple independent chains. The reference code 'MSv56786V1' is in the bottom right corner.

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 Figure 128: Classical Conv-Pool-ReLU diagram. A single processing chain is shown within a dashed box. It starts with two input memories: 'features IN Memory' and 'kernel IN Memory'. Both lead to 'Streamer IN' blocks, which then feed into a 'CONV' block. The output of 'CONV' goes to 'POOL', then 'ReLU', then 'Streamer OUT', and finally to 'features OUT Memory'. A note at the bottom states: 'Note: POOL Is not always needed'. The reference code 'MSv56787V1' is in the bottom right corner.
Figure 128: Classical Conv-Pool-ReLU diagram. A single processing chain is shown within a dashed box. It starts with two input memories: 'features IN Memory' and 'kernel IN Memory'. Both lead to 'Streamer IN' blocks, which then feed into a 'CONV' block. The output of 'CONV' goes to 'POOL', then 'ReLU', then 'Streamer OUT', and finally to 'features OUT Memory'. A note at the bottom states: 'Note: POOL Is not always needed'. The reference code 'MSv56787V1' is in the bottom right corner.

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 CONV, POOL, and ReLU blocks connected in series, with input and output streamers and memory units.

The diagram illustrates a chained convolution process. It starts with 'features IN' from a memory unit entering a 'Streamer IN' block. This streamer feeds into a series of convolution blocks labeled CONV1, CONV2, ..., CONVN. A 'kernel IN' from another memory unit is also fed into the first convolution block, CONV1. The output of each convolution block is connected to a 'POOL' block, which then connects to a 'ReLU' block. The final output of the ReLU block goes to a 'Streamer OUT' block, which writes the 'features OUT' to a memory unit. A dashed box encloses the streamers and convolution blocks. A note indicates that chaining can run from 1 to N = 4 convolutions. The reference code MSv56788V1 is at the bottom right.

Diagram of chained convolutions showing a sequence of CONV, POOL, and ReLU blocks connected in series, with input and output streamers and memory units.

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 for features and kernel data, each with CONV, POOL, and ReLU blocks.

The diagram shows a split convolution architecture. It has two parallel processing paths. The top path takes 'features IN' from memory into a 'Streamer IN', then through a 'CONV' block, 'POOL' block, and 'ReLU' block, ending at a 'Streamer OUT' which writes to 'features OUT' memory. The bottom path takes 'kernel IN' from memory into a 'Streamer IN', then through a 'CONV' block, 'POOL' block, and 'ReLU' block, ending at a 'Streamer OUT' which writes to 'features OUT' memory. A dashed box encloses the streamers and convolution blocks. The reference code MSv56789V1 is at the bottom right.

Diagram of split convolution showing two parallel processing paths for features and kernel data, each with CONV, POOL, and ReLU blocks.

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

A detailed block diagram of the Neural-ART 14 integration architecture. The diagram shows the Cortex-M55ss (CM55ss) CPU core connected to the neuralArt NPU. The CM55ss includes I-TCM (64KB), D-TCM (32KB), FPU, M-Profile Vector Extension, 32KB I$, and 32KB D$. It connects to the NPU via S-AHB (800 MHz / 600 MHz) and M-AXI (6.4 GBps). The NPU connects to a Local NPU NIC via 2x 64-bit AXI (16 GBps) and to the CPU NOC via 64-bit AXI (16 GBps). The Local NPU NIC connects to four AXISRAM banks (AXISRAM3-6, 448KB each) at 900 MHz / 800 MHz (14.4 GBps each). The CPU NOC (400 MHz) connects to flexMEM (400KB), AXISRAM1 (640KB), AXISRAM2 (1MB), and NPU$ CTRL / NPU$RAM CACHEAXI (256KB). It also connects to FMC, xSPI1, xSPI2, xSPI3, and xSPI PHY1/2. Off-chip memory devices include SDRAM (32-bit, 166 MHz, 666 MBps), hexaRAM (200 MHz, 800 MBps), and octoFlash (200 MHz, 400 MBps). The AHB BUS (200 MHz) connects to AHB RAM (16KB, 2x, 1.6 GBps). A vertical bar on the right indicates latency levels: High throughput, low latency (top), Medium throughput, medium latency (middle), and Low throughput, high latency (bottom). A key defines symbols for Functional Unit (FCT), Memory accessible by the NPU (RAM), Master port, Functional unit AXI master port, Functional unit AHB master port, and Slave Port.
A detailed block diagram of the Neural-ART 14 integration architecture. The diagram shows the Cortex-M55ss (CM55ss) CPU core connected to the neuralArt NPU. The CM55ss includes I-TCM (64KB), D-TCM (32KB), FPU, M-Profile Vector Extension, 32KB I$, and 32KB D$. It connects to the NPU via S-AHB (800 MHz / 600 MHz) and M-AXI (6.4 GBps). The NPU connects to a Local NPU NIC via 2x 64-bit AXI (16 GBps) and to the CPU NOC via 64-bit AXI (16 GBps). The Local NPU NIC connects to four AXISRAM banks (AXISRAM3-6, 448KB each) at 900 MHz / 800 MHz (14.4 GBps each). The CPU NOC (400 MHz) connects to flexMEM (400KB), AXISRAM1 (640KB), AXISRAM2 (1MB), and NPU$ CTRL / NPU$RAM CACHEAXI (256KB). It also connects to FMC, xSPI1, xSPI2, xSPI3, and xSPI PHY1/2. Off-chip memory devices include SDRAM (32-bit, 166 MHz, 666 MBps), hexaRAM (200 MHz, 800 MBps), and octoFlash (200 MHz, 400 MBps). The AHB BUS (200 MHz) connects to AHB RAM (16KB, 2x, 1.6 GBps). A vertical bar on the right indicates latency levels: High throughput, low latency (top), Medium throughput, medium latency (middle), and Low throughput, high latency (bottom). A key defines symbols for Functional Unit (FCT), Memory accessible by the NPU (RAM), Master port, Functional unit AXI master port, Functional unit AHB master port, and Slave Port.

MSv56790V3

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”.