94. Ethernet switch acceleration module (ETHSW_ACM)
This section applies to STM32MP25xx devices only.
94.1 Introduction
Copyright TTTech Industrial Automation AG, 2021.
This section gives an overview of the Ethernet switch acceleration module (ETHSW_ACM). This peripheral works only when the ETHSW peripheral is enabled, and shares the same external pins. It provides ultra-low latency, cut-through forwarding between two external Ethernet ports, together with on-the-fly frame processing (extraction and insertion of data). It allows for multimaster distributed networks, based for example on OPC UA over TSN, whilst still meeting the performance requirements for high-speed motion control applications. The ACM is used in combination with a TSN Ethernet switch, a gPTP synchronized clock, and a host CPU as shown in Figure 1164 below.
Figure 1164. System block diagram

The diagram illustrates the system architecture for the Ethernet switch acceleration module (ACM). At the top is a 'Host CPU' block. Below it is a 'TSN Ethernet switch' block, which contains a 'PTP clock' sub-block. At the bottom is the 'ACM' block. On the left and right sides are 'PHY' blocks. The connections are as follows: a blue line connects the Host CPU to the TSN Ethernet switch; a black line connects the TSN Ethernet switch to the ACM; a yellow line connects the left PHY to the ACM; a yellow line connects the ACM to the right PHY; and a blue line connects the right PHY back to the TSN Ethernet switch.
This section is an overview and does not include a detailed functional description nor the registers and message buffer description.
TTTech Industrial Automation AG or STMicroelectronics sales representative must be contacted for getting access to the full documentation (delivered under NDA).
94.2 ETHSW_ACM main features
- • Ultra-low latency cut-through
- – ~400 ns including data manipulation (Gigabit)
- • Scheduled cut-through and forwarding
- – Information can be sent with low latency alongside other traffic
- – Frames not subject to acceleration are fully IEEE 802.1Q compliant
- • Scatter-gather engine
- – Information can be added and/or extracted dynamically without CPU
- – Frame is composed dynamically
- – Header and Trailer are statically configured
- – CPU does not need to process the entire frame
- • Summation frame
- – Information can be added to one frame as it passes from node to node
- – Significantly enhances bandwidth efficiency for short messages in lines
94.3 ETHSW_ACM application example
Typical application scenarios for ACM are industrial line or ring topologies as shown in Figure 1165. The example shows several use cases in a simple setup based on OPC UA over TSN, but this is also applicable for other protocols over TSN.
In such an example, the programmable logic controller (PLC) runs a control loop for some motion controllers (drives) and other input/output (I/O) devices. It also considers the input from some of the I/Os for controlling the drives. To do so the PLC generates a frame that can contain multiple submessages targeted at different nodes. The devices are configured so that the message travels around the ring until it reaches the last node that requires the data or the PLC again in case there is an immediate response. The DataSetMessage 1 and 2 are generated by the PLC and are targeted at the drives and the left/right I/O module, respectively. To show the distributed / multimaster usage, the bottom I/O module generates the DataSetMessage 3 that is consumed by the left and the right I/O without the PLC being involved. In addition, the left/right I/O communicates via a data exchange on DataSetMessage 4.
The fact that a single frame can be used for multiple submessages allows lower overhead for small process data updates and therefore significantly faster cycle times. To further increase the update rate, ACM allows data insertion (produce operation) and extraction (consume operation) during the forwarding process, without any CPU involvement. Data is taken from / provided to a triple buffer memory allowing the CPU to write/read only the parts of a frame that contain relevant process data for the same node. The remaining frame is automatically assembled/parsed by the ACM according to predefined rules during the forwarding process. The triple buffer towards the CPU guarantees permanent availability of the latest available data including a timestamp.
In a ring topology (as shown in Figure 1165), the module also supports seamless redundancy compatible with IEEE 802.1CB. This allows timely delivery of frames even in case of disruptions on one path within the network. Frames are sent in both directions and only one copy is used by the node in case both arrive. Overall, the design guarantees a constant delay per hop as low as 0.4 µs for Gigabit Ethernet or 3.8 µs for Fast Ethernet independent of CPU performance, number of frames and submessages.
Figure 1165. Topology example

The diagram illustrates a TSN network topology. At the top, a PLC is connected to a TSN ring. The ring also connects to two I/Os blocks on the left and right. Below the right I/Os block are four Drives. The diagram shows the flow of data between these components using colored arrows: blue for the TSN ring, green for I/Os to PLC, yellow for I/Os to Drives, and purple for Drives to I/Os. At the top and bottom, the structure of a UADP network message is shown in a grey box, containing an Ethernet header, an 802.1Q tag, a UADP network message (which includes one or two UADP DataSetMessages), and an Ethernet FCS. The top message shows two DataSetMessages (1 in pink, 2 in green) being sent to the PLC. The bottom message shows two DataSetMessages (3 in purple, 3 in yellow) being sent from the Drives to the I/Os.
94.4 ETHSW_ACM functional description
94.4.1 ETHSW_ACM block diagram
The ACM is composed of several submodules, namely: Bypass module (x2), Message buffer, Schedule and Redundancy (see Figure 1166). The main purpose of the Bypass module is to enable low-latency frame cut-through functionality between Ethernet ports. Moreover, the Bypass module supports advanced frame processing (that is extraction/insertion of data into/from the passing frames, recovery frame functionality, frame policing, data exchange with the CPU via Message buffer). The Bypass module and the TSN Ethernet switch are interconnected via GMII interfaces. The Schedule module consists of two Scheduler units to provide timing for the two Bypass modules.
Figure 1166. ACM block diagram

The diagram illustrates the internal architecture of the Ethernet switch acceleration module (ACM). It is divided into a main block and external interfaces. Inside the main block, a 'Host I/F' connects to a 'Message Buffer' and a 'Schedule' block. The 'Message Buffer' feeds into two multiplexers (P/S) that route data to 'Bypass 0 (port 1 to 0)' and 'Bypass 1 (port 0 to 1)'. These bypass blocks are interconnected with a central 'Redundancy' block. The outputs of the bypass blocks pass through multiplexers controlled by 'Bypass_0_Disable' and 'Bypass_1_Disable' signals. These signals also control multiplexers that select between the bypass outputs and a 'DELAY' block. The selected signals are then combined by 'OR' gates and sent to output multiplexers (S/P) that drive the 'PHY0_TX' and 'PHY1_TX' interfaces. Externally, 'PHY0_RX' and 'PHY1_RX' inputs enter the main block. Below the main block, a 'TSN Switch' is shown with four ports (Port 0 RXM, Port 0 TXM, Port 1 RXM, Port 1 TXM). It is connected to 'SW0_RX', 'SW1_RX', 'SW0_TX', and 'SW1_TX' signals. A 'PTP Clock' block provides 'PTP time' to the TSN Switch and the ACM's internal logic.
The two Bypass modules can be connected to the TSN Ethernet switch either in parallel or in series (see options P and S in Figure 1166). When connected in parallel, the Bypass modules enable a frame cut-through operation between the TSN Ethernet switch ports 0 and 1 (see the Bypass 1 module), and between the TSN Ethernet switch ports 1 and 0 (see the Bypass 0 module). The configuration in parallel is used when both adjacent nodes operate at the same GMII speed and are able to achieve sufficient PTP clock synchronization precision.
When connected in series, the ingress frame first passes through the TSN Ethernet switch and then through the Bypass module (without crossing), port 0 is connected to the Bypass 0 and port 1 is connected to the Bypass 1. The configuration in series is used when the two adjacent network nodes either operate at different line speeds (for example one operates at 1 Gbps and the other at 100 Mbps), or one of the two adjacent nodes has poor timing characteristics.
In serial mode, the data that come from the TSN Ethernet switch and do not pass the Bypass module (Bypass module is disabled), are delayed to match the data delay through the Bypass module. These delay blocks are shown in the TSN Ethernet switch data path in Figure 1166.
The ACM can also be completely isolated from the TSN Ethernet switch by disabling it. In this case the TSN Ethernet switch output is directly fed to the PHY interface without introducing additional delay, which is the default behavior at startup.
94.4.2 ETHSW_ACM pins
The ETHSW_ACM pins are shared with the ETHSW peripheral. It is not necessary to enable specific alternate functions for operating it.
94.4.3 ETHSW_ACM clocks
The ETHSW_ACM peripheral must be clocked at 200MHz. The RCC features 2 independent clock enable bits, for the ETHSW_ACM configuration registers and message buffer.
94.4.4 Frame format
The format of a frame that is processed by the Bypass module is depicted in Figure 1167. All the fields are shown in the transmission/reception order (bytes in the left side are transmitted/received first).
Figure 1167. Frame format according to IEEE 802.1Q

| 7 | 1 | 6 | 6 | 4 | (6) | 2 | 42 (36) ... 1500 | 4 | 8...12 | ||||||||||
| PREAMBLE | Start of Frame (SOF) | Destination MAC Address | Source MAC Address | 802.1Q VLAN TAG | 802.1CB Redundancy TAG (R-Tag) | ETH_TYPE/LENGTH | Layer 2 Payload | Frame Check Sequence (FCS) | Inter Frame Gap (IFG) |
Transmission/Reception byte order ←
| 2 | 2 | 2 | |||
| Eth type (TPID) 0x8100 [31:24] 0x81 [23:16] 0x00 | Priority (PCP) [15:13] | Drop Eligible Frame (DEI) [12] | VLAN ID (VID) [11:0] | ||
| 2 | 2 | 2 | |||
| Eth type (TPID) 0xF1C1 [47:40] 0xF1 [39:32] 0xC1 | Reserved [31:16] [31:28] 0x00 [27:24] 0x00 | Sequence Number (SeqNum) [15:0] |
Frame fields that are processed by the ACM are discussed in the following paragraphs.
Destination MAC address
Destination MAC address is a unicast or a locally administered multicast address of the target node that should receive the frame.
IEEE 802.1Q VLAN tag structure
The VLAN tag is composed of four bytes [1]. The first two bytes contain the defined TPID = 0x8100 indicating an IEEE 802.1Q-tagged frame. If this value is not found in the frame, the Bypass module must drop the frame, because it belongs to the best effort traffic. Moreover, the Bypass module compares the VID field to decide whether to drop the frame or process it further. The TSN Ethernet switch VID filtering must be complementary to the Bypass modules VID filtering, meaning that the TSN Ethernet switch must process frames dropped by the Bypass modules and vice versa. Similar, the TSN Ethernet switch must run a mutual exclusive IEEE 802.1Qbv schedule [2] to prevent conflicts on the node egress ports.
Frames containing the VLAN tag are referred to as tagged and those not containing the VLAN tag are referred to as untagged.
IEEE 802.1CB Redundancy Tag structure
The Redundancy Tag (R-Tag) is composed of six bytes [3]. The first two bytes contain the defined TPID = 0xF1C1. If this value is found in the frame, the frame is considered as a redundant traffic and handled accordingly. The second two bytes are reserved and their content is ignored on reception and transmitted with 0x0000 value. The last two bytes of the R-Tag contain the 16-bit sequence number. Whenever a frame is transmitted as two replicas, both replicas are recognized by carrying the same sequence number.
Layer 7 UADP protocol
Layer 2 payload contains data that can be interpreted as protocols operating on the higher layers of the OSI model. For certain protocols (namely UADP [4] protocol) operating on layer 7 all the lower layer protocols are defined (i.e. implement the IP protocol and the UDP protocol). Therefore, most of the data in these higher layer headers can be mapped one-to-one to a specific stream ID. Thus, Bypass modules can be configured to compare the layer 3 to layer 7 frame bytes against a preconfigured byte sequence. If a match is found, layer 7 check is considered successful and the frame is processed further. On the contrary, if the match is not found the frame is dropped.
Frames types
Frames are classified based on their destination MAC address and the VLAN ID (further referred to as VID), as it is the recommended method for stream identification described in the IEEE 802.1Q standard [1]. Frames that are processed by the Bypass module can be split into the following classes:
- • Best-effort frames: these frames are not processed by the Bypass module but rather by the TSN Ethernet switch. Therefore, Bypass modules have to be configured in a way to drop these frames when connected in parallel, or forward them unchanged when connected in series. Best-effort frames either do not contain a VLAN tag, or their VID does not match any of the configured VIDs.
- • Isochronous frames: all the frames that are processed by the Bypass module. These frames contain a VLAN tag and their VID must match to at least one of the configured VIDs. Moreover, these frames can be split into redundant copies and delivered to the destination using different paths. If both copies are received correctly at the destination, one of them is dropped and the other one provided to the host CPU. The isochronous frames can be further divided into the following subclasses:
- – One-to-one frames: One-to-one frames (further on referred to as Cross-traffic frames) are produced by one node (a producing node) and consumed by another
node (a consuming node). All the other nodes in the network only forward such frames to reach their destination node.
- – One-to-many summation frames: A one-to-many summation frame is produced by the first node in the network (i.e. master node) and contains several submessages for a group of nodes. All the nodes outside the group only forward the frame. Each node in the group can consume (i.e. read the submessage) its submessage (but can also read more submessages) and can also remove the read message from the frame (i.e. by shortening the frame). The last node in the group consumes the last submessage in the frame and discards the received frame.
- – Many-to-one summation frames: A many-to-one summation frame is produced by the last node of the group of nodes (i.e. slave node). The producing node also inserts its submessage into this frame. The frame is then transmitted in the direction towards the master node. All other nodes in the group then insert their submessage into the frame. After leaving the group, the frame is forwarded by other nodes until it reaches the master node. Optionally, the producing node can also pad the frame with zero bytes, so that the frame size is the same as the final size when the frame leaves the group. In such case, other nodes in the group not only insert their submessage to the frame, but also remove the same number of zero bytes from the frame. This way, the frame size remains constant while the frame is updated by the group nodes.
- – First-stage recovery frame: The first-stage recovery frame is a frame that is produced by a node in the group in case the expected many-to-one frame did not arrive. The node that produces the first stage recovery frame also inserts its submessage into the frame and transmits the frame towards the master node.
94.4.5 Bypass module overview
Figure 1168 diagram presents the Bypass module block diagram.
Figure 1168. Bypass module block diagram

The diagram illustrates the internal architecture of the Bypass module. It features several interconnected blocks: RxMAC receives GMII_IN and Configuration Interface inputs. It interacts with Individual recovery (exchanging Error and RxSeqNum) and Rule ID lookup & Layer 7 check (exchanging Rule ID). The Rule ID lookup & Layer 7 check block also provides Rule ID to the DMA command lookup block. RxMAC feeds into Gather frame buffer and Scatter frame buffer. DMA command lookup receives Rule ID and Stream Information (from the buffers) and outputs Redundancy group & RxSeqNum to the Redundancy block, and Schedule IF (Open/Close window) and TxSeqNum, redundancy control/drop to the Schedule block. A Schedule trigger signal is sent to Gather DMA and Scatter DMA. Gather DMA and Scatter DMA exchange Addr and Data with the Constant buffer and the Message buffer. The Constant buffer also provides Data to the Message buffer. Finally, Gather DMA feeds into the TX MAC, which outputs GMII_OUT. The Message buffer is also connected to Status and Control blocks.
Each of the two Bypass blocks of the ETHSW_ACM consists of the following blocks:
- • Rx MAC
- • Frame buffer
- • Rule ID lookup & layer 7 check
- • Individual recovery
- • DMA command lookup
- • Scatter DMA
- • Gather DMA
- • Constant buffer
- • Tx MAC
The Bypass module performs frame classification based on the destination MAC address (DMAC) and VID. Frames can be classified to one of the 17 stream classes and receive a Rule ID for which specific processing actions can be defined. The layer 7 check can optionally be performed (i. e. layer 2 payload data up a configured depth are compared against a configured byte sequence), so that it is possible to drop frames based on data content.
Based on the selected Rule ID a DMA command list is selected for the Scatter and the Gather DMA module separately. These two modules then perform the stored list of operations on the frame while the frame is being forwarded. For frame assembly the module provides prefetching operations to make data available in a local buffer. From this or the constants memory it is then possible to modify, forward, or assemble the frame while forwarding. Further, selectable operations include for ingress policing (policing arrival time of a frame) or recovery frame generation. The Scatter DMA allows to extract (multiple) parts of the received frame for further processing by the host CPU. That way the CPU can define upfront the parts of the frame it is interested in and can offload the frame processing.
94.4.6 Schedule module overview
This section presents the basic scheduling principles.
Purpose
The Schedule module is responsible for fetching and executing the schedule events at exact moments of time. The schedule module outputs the result of a schedule event in form of a schedule command that instructs a Bypass module to enable/disable Bypass modules, open/close ingress policing windows, or trigger a Gather DMA chain execution. The schedule module follows the principles of the IEEE 802.1Qbv [2] standard.
Scheduling principles
The schedule receives the global network time information from the external PTP Clock module (according to the IEEE 802.1AS standard [5]) and synchronizes its execution with this time. This way, schedule modules in all nodes in the network execute events based on the same time reference.
Figure 1169. Schedule execution example

The diagram illustrates the schedule execution example. A horizontal timeline represents time in milliseconds (ms). Key points on the timeline are marked at 0 ms, 2 ms, 4 ms, 6 ms, and 8 ms. A PTP clock is shown pointing to the 0 ms mark. Arrows indicate 'Table start time' at 2 ms and 4 ms, and 'Next cycle time' at 4 ms and 6 ms. The 'Cycle time' is indicated as 2 ms, spanning from 2 ms to 4 ms, 4 ms to 6 ms, and 6 ms to 8 ms. Events are grouped in cycles, with each cycle containing two events labeled 0 and 1. The cycles are labeled 'Cycle = 0', 'Cycle = 1', and 'Cycle = 2'.
Figure 1169 gives an example of the schedule composed of two schedule events being repeated in cycles. When the schedule starts its operation at a specific table start time, the first cycle is executed.
The schedule block can be reconfigured during runtime (on-the-fly). In order to enable uninterrupted execution of the events, the schedule module uses two tables instead of one. While one of the tables is being processed (i.e. events are fetched and executed), the software can access the other table and store the new events into table rows. Tables can be swapped at a specific point in time in an atomic operation.
94.4.7 Redundancy functionality overview
The main objective of seamless redundancy is to ensure that a frame is delivered from the source node (node 0 in Figure 1170) to the destination node (node 6 in Figure 1170) even if the connection between two nodes is physically interrupted. In order to guarantee this, the frames are replicated at the source node, transported through the network on disjoint paths (see blue and pink paths in Figure 1170) and then received and evaluated by the destination node. If both frame replicas arrive and pass the frame check sequence (FCS) verification, only one is provided to the host and the other one is dropped. If one of the frame replicas gets corrupted or even lost on its way to the destination node, the other one is delivered via a different path.
Figure 1170. Redundant schedule execution example

In case if one of the paths delays the frames above a certain limit and the source node generates several replicated frame pairs with a short time distance between them, it may happen that the newer frame replica arrives faster to the destination node via a faster path than the older frame replica arriving via the slower path. For the sake of correct replica elimination on the destination node's side, each replicated frame pair contains a Redundancy Tag (R-Tag) with an identical sequence number (see Figure 1167). The ACM supports automated duplication of frames generated on the node, as well as transparent elimination of redundant copies before they are delivered to the host CPU. Thus, redundancy operation is fully transparent to the CPU and only requires one time configuration.
94.5 Bibliography
[1]
IEEE 802.1Q-2014 IEEE Standard for Local and metropolitan area networks—Media Access Control (MAC) Bridges and Virtual Bridged Local Area Networks.
http://www.ieee802.org/1/pages/802.1Q-2014.html.
[2]
IEEE 802.1Qbv, Draft Standard for Local and Metropolitan Area Networks—Bridges and Bridged Networks—Amendment: Enhancements for Scheduled Traffic, Draft 3.1.
http://www.ieee802.org/1/pages/802.1bv.html.
[3]
IEEE 802.1CB™, Draft Standard for Local and metropolitan area networks — Frame Replication and Elimination for Reliability, Draft 2.6.
https://1.ieee802.org/tsn/802-1cb/.
[4]
OPC Foundation, OPC Unified Architecture Specification, Part14: PubSub, Draft 1.04.17.
https://opcfoundation.org/developer-tools/specifications-unified-architecture.
[5]
IEEE 802.1AS-Rev, Draft Standard for Timing and Synchronization for Time - Sensitive Applications, Draft 4.2.
https://1.ieee802.org/tsn/802-1as-rev/.
94.6 ETHSW_ACM registers
The ETHSW_ACM configuration and message buffer address space is described in the table below.
Table 998. Memory map for ACM configuration
| Name | Offset (Bytes) | Size (Bytes) |
|---|---|---|
| Common registers | 0x0000 0000 | 0x0000 0300 |
| Reserved | 0x0000 0300 - 0x0000 FFFF | 0x0000 FD00 |
| Bypass module 1 (port 0 to port 1) | 0x0001 0000 | 0x0001 0000 |
| Reserved | 0x0002 0000 - 0x0002 FFFF | 0x0001 0000 |
| Bypass module 0 (port 1 to port 0) | 0x0003 0000 | 0x0001 0000 |
| Reserved | 0x0004 0000 - 0x0004 FFFF | 0x0001 0000 |
| Redundancy | 0x0005 0000 | 0x0000 1000 |
| Reserved | 0x0005 1000 - 0x0005 FFFF | 0x0000 F000 |
| FSC | 0x0006 0000 | 0x0002 0000 |
| Message buffer | 0x0008 0000 | 0x0004 0000 |