Collaborative data transmission device and method
By introducing a protocol phase parser and a DMA engine into the I3C bus controller, and automatically executing multiple I3C transactions using transfer descriptors, the problem of frequent CPU intervention in configuring DMA parameters in existing technologies is solved, realizing automatic hardware pipelined processing and improving data transmission efficiency and system response speed.
Patent Information
- Application Number
- CN202611377497.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-07
- Publication Date
- 2026-11-17
AI Technical Summary
The loosely coupled architecture of the existing I3C bus controller and DMA engine causes the CPU to frequently intervene in configuring DMA parameters, increasing interrupt frequency and mode switching latency, and making it impossible to efficiently handle the real-time requirements of multi-sensor data acquisition.
By introducing a protocol phase parser and DMA engine into the I3C bus controller, multi-segment I3C transactions are automatically executed using transfer descriptors. Combined with an HDR data reassembly unit and a mode adaptation layer, hardware automatic pipeline processing is achieved, dynamically adapting transfer parameters and reducing CPU involvement.
It reduces CPU interrupt frequency and context switching overhead, improves data transmission efficiency and system response speed, reduces mode switching latency, and enables efficient acquisition of multi-sensor data.
Smart Images

Figure CN123115015A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of integrated circuit bus communication technology, and specifically to a collaborative data transmission device and method. Background Technology
[0002] In System-on-Chips (SoCs), the Improved Inter-Integrated Circuit (I3C) bus is widely used to connect various sensors such as temperature sensors, inertial measurement units, and pressure sensors, as well as for sideband management of memory, because it supports higher data rates, in-band interrupts, and dynamic address allocation while being compatible with traditional Inter-Integrated Circuits (I2C). In typical application architectures, the I3C bus controller, as the master device, is responsible for initiating communication transactions, managing bus arbitration, and controlling the data transmission process, while the Direct Memory Access (DMA) engine is used to move data between the I3C bus controller's buffer and system memory to reduce the load on the Central Processing Unit (CPU). As the real-time requirements for multi-sensor data acquisition from IoT devices continue to increase, how to efficiently complete complex I3C transactions involving multiple protocol stages, and how to handle advanced features such as High Data Rate (HDR) mode and In-Band Interrupt (IBI), have become key factors determining the overall system performance.
[0003] In existing technologies, the I3C bus controller and DMA engine typically employ a loosely coupled architecture. The DMA engine triggers data transfer solely based on the waterline signal of the First-In-First-Out (FIFO) buffer in the I3C bus controller. The progression of multiple protocol phases in the I3C protocol state machine relies entirely on the CPU's programmable input / output (PIO) configuration and intervention at each stage. For example, a certain microcontroller's integrated I3C bus controller controls read and write triggers through DMA From Bus (DMAFB) and DMA To Bus (DMATB) registers, supporting both single-frame and continuous coarse-grained modes. It also specifies the data width of the DMA operation through a DMA width field. However, it lacks the hardware's ability to automatically connect complete multi-stage transactions; each trigger is based on the FIFO waterline, and CPU intervention is required to reconfigure between different stages. In the implementation of a certain company's I3C bus controller, although a DMA handshake interface is provided and single data rate (SDR) and various high data rate modes are supported, when processing a complete transaction that includes multiple protocol stages, the central processing unit still needs to intervene to configure the transmission parameters of the next stage after each stage is completed, or directly participate in the processing of data with insufficient tail bytes.
[0004] This loosely coupled architecture has significant technical drawbacks. Specifically, a complete I3C transaction often consists of multiple stages. Existing solutions require CPU interrupts to reconfigure the DMA parameters for the next stage after each stage is completed. This causes the interrupt frequency to increase linearly with the transaction complexity, resulting in frequent CPU context switching and severe CPU resource consumption. When frequently switching between SDR and HDR modes in an I3C transaction, the data bit width, clock cycle, and cyclic redundancy check requirements are different in different modes. Each mode switch requires the CPU to reconfigure DMA transfer width, burst size, and other parameters, increasing the CPU burden and mode switching latency. In multi-sensor periodic polling scenarios, the hardware lacks autonomous scheduling capabilities. Each polling requires the CPU to issue a command and wait for completion. The CPU must wait for the previous task to complete before initiating the next request, resulting in slow system response and low energy efficiency. Summary of the Invention
[0005] In view of this, embodiments of the present disclosure propose a method and apparatus for collaborative data transmission between an I3C bus controller and a DMA engine.
[0006] In a first aspect, embodiments of this disclosure provide a cooperative data transmission device, including an I3C bus controller and a DMA engine. The I3C bus controller includes an I3C protocol controller and a protocol phase parser, wherein...
[0007] The I3C protocol controller is used to implement the I3C protocol state machine;
[0008] The DMA engine is used to move data between system memory and the I3C bus controller via the system bus;
[0009] The protocol phase parser is used to obtain the transport descriptor from the descriptor ring in the system memory, parse the transport descriptor to obtain the protocol phase type, and drive the I3C protocol state machine to generate a bus signal sequence according to the protocol phase type, so that the DMA engine and the I3C bus controller can automatically execute the corresponding protocol phases in multiple I3C transactions in sequence.
[0010] In some embodiments, the I3C bus controller further includes: a descriptor prefetching unit, configured to prefetch the transport descriptors in batches from the descriptor ring in the system memory via the system bus to a descriptor buffer inside the I3C bus controller; and the protocol phase parser to obtain the transport descriptors one by one from the descriptor buffer.
[0011] In some embodiments, the plurality of transport descriptors are used to describe a complete multi-segment I3C transaction or multiple independent transactions; the I3C protocol state machine generates an interrupt signal to notify the processor only when the plurality of transport descriptors have been executed or an error occurs.
[0012] In some embodiments, the protocol phase types include start conditions, address transmission, common command code transmission, data transmission, stop conditions, high data rate entry sequence, and high data rate exit sequence; the protocol phase parser directly controls the I3C protocol state machine to generate corresponding serial clock line and serial data line signals according to the parsed protocol phase type.
[0013] In some embodiments, the I3C bus controller further includes: an HDR data reassembly unit, configured to read data from a fill buffer in the transmission direction, reassemble the data according to the bit order of the high data rate mode, and output the data; and to concatenate multiple bytes of data received by the I3C bus controller in the reception direction into a data unit that conforms to the burst transmission width of the DMA engine, and trigger a DMA request when the width condition is met.
[0014] In some embodiments, the HDR data reassembly unit maps two bytes to the rising and falling edges of a clock signal according to the high-order bit-first rule in the transmission direction, and splices data received within multiple clock signal cycles into half-words or words in the reception direction to match the burst transmission width of the DMA engine.
[0015] In some embodiments, the transport descriptor further includes a high data rate mode flag, and the DMA engine adjusts the width and burst size of the data source or data destination according to the high data rate mode flag;
[0016] When the high data rate mode flag indicates single data rate mode, the DMA engine moves data in units of one byte.
[0017] When the high data rate mode flag indicates high data rate-dual data rate mode, high data rate-bulk transfer mode, or high data rate-tri-state pulse mode, the DMA engine moves data in units of the data width reconstructed by the HDR data reconstruction unit.
[0018] In some embodiments, the I3C bus controller further includes a mode adaptation layer for maintaining a current bus mode register and automatically converting the transfer parameters of the DMA engine according to the bus operating mode indicated by the current bus mode register.
[0019] In some embodiments, when the I3C protocol controller executes the transfer descriptor corresponding to the high data rate enter sequence or high data rate exit sequence, it updates the current bus mode register and sends a mode switching notification to the mode adaptation layer to trigger the automatic update of the DMA engine's transfer parameters.
[0020] In some embodiments, the I3C bus controller further includes an IBI buffer pool and a DMA selector. The IBI buffer pool contains multiple slots, each slot having a fixed storage capacity. The DMA selector is used to dynamically select the receive path based on the length of the in-band interrupt load, including: writing data to the slot when the load length is less than or equal to a preset threshold, and triggering the DMA engine to perform data transfer when the load length is greater than the preset threshold or exceeds the slot capacity.
[0021] In some embodiments, the I3C bus controller further includes an IBI DMA waterline predictor for recording the length distribution of historical in-band interrupt loads and adjusting a preset threshold for selecting a receive path or DMA receive path based on statistical results.
[0022] In some embodiments, the I3C bus controller further includes a polling scheduling engine for maintaining a sensor polling scheduling table; the polling scheduling engine further includes a timer for inserting the corresponding transport descriptor chain into the descriptor ring and initiating transport when the trigger time indicated by the table entry is reached.
[0023] In some embodiments, the polling scheduling engine allocates a first buffer and a second buffer to each sensor, and the I3C protocol controller switches the target buffer through the buffer selection field in the transport descriptor, so that when the polling result of the current round is written to the current buffer, the central processing unit can process the data stored in the other buffer in the previous round.
[0024] Secondly, embodiments of this disclosure provide a controller that integrates the collaborative data transmission device described above.
[0025] Thirdly, embodiments of this disclosure provide a collaborative data transmission method, including:
[0026] Obtain a transport descriptor, which contains a field indicating the protocol stage type;
[0027] Parse the transport descriptor to obtain the protocol stage type;
[0028] The I3C protocol state machine is driven to generate a bus signal sequence according to the protocol phase type;
[0029] Based on the bus signal sequence, each component is driven to automatically execute the corresponding protocol stages in multiple I3C transactions in sequence, so as to realize the automatic pipeline execution of hardware during the transmission of the multiple I3C transactions.
[0030] The cooperative data transmission device provided in this embodiment embeds the protocol stage type into the transmission descriptor and obtains the protocol stage type through parsing by the protocol stage parser. Based on this, it drives the I3C protocol state machine to generate a bus signal sequence, so that the DMA engine and the I3C bus controller can automatically execute each protocol stage in the multi-segment I3C transaction in sequence. This realizes pipelined processing at the hardware level, so that the central processing unit does not need to intervene in the configuration at each stage of the multi-segment transmission, which significantly reduces the interrupt frequency and context switching overhead.
[0031] Furthermore, the collaborative data transmission device utilizes an HDR data reassembly unit to reassemble data bit width between the FIFO and DMA engine according to the bus operating mode. This eliminates frequent DMA requests caused by data bit width mismatch in HDR mode, improves burst transmission efficiency, and reduces bus occupancy time. By using a mode adaptation layer to automatically update DMA transmission parameters during bus mode switching, the dependency between DMA configuration and physical bus mode is decoupled, avoiding register configuration delays during CPU switching between SDR and HDR modes. Through the IBI buffer pool and DMA selector, the program control input / output or DMA receive path is dynamically allocated according to the load length, ensuring low-latency response to short frame interrupts and achieving zero-copy data transfer for long frames, effectively alleviating the processor's pressure in handling in-band interrupts. Attached Figure Description
[0032] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the accompanying drawings used in the description of the embodiments or the prior art are briefly introduced below.
[0033] Figure 1 This is a schematic diagram of a master-slave device system architecture based on the I3C bus.
[0034] Figure 2 This is a system architecture diagram of the I3C bus controller and DMA engine working together, implemented based on an embodiment of the present invention.
[0035] Figure 3 This diagram illustrates the data flow of a multi-segment automated pipeline based on a descriptor ring.
[0036] Figure 4 A schematic diagram illustrating the data reconstruction and burst transmission process in HDR-DDR mode is shown.
[0037] Figure 5 This diagram illustrates the processing flow for automatic zero-copy reception of in-band interrupt payload;
[0038] Figure 6 This diagram illustrates the process of the mode adaptation layer automatically updating DMA parameters during bus mode switching.
[0039] Figure 7 The flowchart illustrates the process of autonomous periodic acquisition of sensor data through hardware polling of a scheduling table combined with DMA double buffering. Detailed Implementation
[0040] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of the present invention.
[0041] In the description of this invention, the term "protocol phase" refers to a specific operational stage in an Improved Inter-Integrated Circuit (I3C) transaction, such as start conditions, address transmission, common command code transmission, data transmission, or stop conditions.
[0042] The term "In-Band Interrupt" (IBI) refers to an asynchronous interrupt mechanism initiated by the I3C target device via the bus.
[0043] The term "transfer descriptor" refers to a data structure pre-filled by software and embedded with fields indicating the protocol stage type, which serves as the basis for the DMA engine to control data transfer.
[0044] This invention can be presented in various forms, some of which will be described below.
[0045] Figure 1 This diagram illustrates a master-slave device system architecture based on the I3C bus. Figure 1 As shown, master device 101, as the master node on the I3C bus, is responsible for initiating communication transactions, managing bus arbitration, and controlling the data transmission process. Slave device 102, as the target node on the I3C bus, responds to the addressing and command operations of master device 101. Bus 103 constitutes the physical transmission medium between master device 101 and slave device 102, including the serial data line SDA and the serial clock line SCL.
[0046] Figure 2 This is a system architecture diagram of the I3C bus controller 210 and DMA engine 240 working together, implemented based on an embodiment of the present invention. The I3C bus controller 210 and DMA engine 240 can be integrated into the main control chip of a storage device (e.g., a solid-state drive).
[0047] like Figure 2 As shown, the I3C bus controller 210 includes an I3C protocol controller 211, a protocol phase parser 213, and other functional modules. The I3C protocol controller 211 is connected to the external I3C bus interface SDA / SCL and internally implements the I3C protocol state machine.
[0048] Protocol phase parser 213 reads the prefetched descriptor from descriptor FIFO 218, parses the protocol phase type, and then drives the I3C protocol state machine inside I3C protocol controller 211 to generate the corresponding START, ADDR, CCC or STOP bus signal sequence, so as to drive I3C bus controller 210 and DMA engine 240 to automatically execute each protocol phase in multiple I3C transactions in sequence, so as to realize hardware automatic pipeline execution during the transmission of multiple I3C transactions.
[0049] The transmit FIFO 212 and receive FIFO 215 serve as buffer channels for data transmission and reception, respectively, connected between the I3C protocol controller 211 and the mode adaptation layer 216. The HDR data reconstruction unit 214 is embedded in the FIFO path and is used to perform bit-width conversion and splicing of data in HDR mode to match DMA burst transfer requirements. The mode adaptation layer 216 is located between the FIFO and DMA engine interface, automatically adjusting data transmission parameters according to the current bus operating mode to eliminate CPU configuration overhead during mode switching. The IBI buffer pool and DMA selector 217 manage the receiving path of in-band interrupt data. Combined with the IBI overflow ring buffer 251, it dynamically selects PIO or DMA transmission mode based on the load length, achieving fast response for short frames and zero-copy transfer for long frames.
[0050] The descriptor prefetching unit 219 loads descriptors in batches from the command and response descriptor ring 252 in system memory 250 to the descriptor FIFO 218 via the AXI bus, ensuring that the protocol phase parser 213 has a continuous flow of control commands. The polling scheduling engine 220 reads the sensor polling scheduling table 253, autonomously triggers periodic data acquisition tasks, and inserts transmission descriptors into the command and response descriptor ring 252 through a timer mechanism without real-time CPU intervention.
[0051] The DMA engine 240 interacts with system memory 250 via the AXI host interface 246 to perform large-scale data transfer tasks. The DMA channel arbitrator 241 is responsible for priority scheduling of multi-channel requests, the address decoding unit 242 resolves the target memory address, the burst transfer controller 243 optimizes the transfer efficiency of consecutive data blocks, and the scatter-gather engine 244 supports hash reads and writes of non-contiguous memory regions. The interrupt controller 245 sends an interrupt notification to the CPU when a batch of descriptors has finished executing or when an exception occurs, significantly reducing the interrupt frequency.
[0052] System memory 250 stores critical data structures and data buffers. The command and response descriptor ring 252 stores pre-filled transfer descriptors, each containing protocol stage type, control flags, and a data pointer, enabling DMA commands to be protocol-aware. The sensor polling schedule table 253 defines the polling period, target address, and priority of each sensor, supporting hardware-driven scheduling. The data send and receive buffer 254 temporarily stores payloads for regular I3C transactions, while the sensor double buffer 255 employs a ping-pong mechanism, allowing the processor to process the previous round of data while the DMA writes to the current buffer, achieving parallelization of acquisition and processing. The IBI overflow ring buffer 251 specifically stores long-frame IBI payloads exceeding the internal slot capacity, working in conjunction with the IBI buffer pool to complete complete data delivery.
[0053] In the workflow, the software first initializes the command and response descriptor ring 252 and the sensor polling schedule table 253. The descriptor prefetch unit 219 loads descriptors in batches into the descriptor FIFO 218. The protocol phase parser 213 parses the descriptors one by one. If the HDR_ENTRY or HDR_EXIT phase is detected, the mode adaptation layer 216 automatically updates the DMA transfer bit width and burst length without requiring the CPU to reconfigure registers. During the data transfer phase, the HDR data reassembly unit 214 reassembles the dual-edge sampled data under mode switching to meet the alignment requirements of DMA burst transfer, thereby reducing the number of DMA requests. For IBI events, the IBI buffer pool and DMA selector 217 predict the load length based on historical statistics. Short frames are directly stored in internal slots, and long frames trigger the DMA engine 240 to move the overflow data to the IBI overflow ring buffer 251. The polling schedule engine 220 automatically loads tasks from the sensor polling schedule table 253 and generates a descriptor ring based on the timer trigger signal, driving the DMA engine 240 to write sensor data into the sensor double buffer 255. This architecture significantly reduces the CPU's involvement in interrupt handling, parameter configuration, and data transfer by automatically connecting each protocol stage through hardware, dynamically adapting transmission parameters, and autonomously scheduling polling tasks, thereby improving bus utilization and system real-time performance.
[0054] Figure 3 This diagram illustrates the data flow of a multi-stage automated pipeline based on a descriptor ring. It demonstrates how the descriptor ring in system memory, through hardware prefetching and parsing mechanisms, drives the I3C bus controller to automatically execute transactions comprising multiple protocol stages, achieving continuous data transmission without processor intervention.
[0055] The system memory 250 maintains a descriptor ring 252, which exists as a queue. This queue is pre-filled by software with multiple I3C transfer descriptors. Figure 3The diagram shows multiple descriptor nodes arranged sequentially: Desc N (DATA), Desc N+1 (STOP), Desc N+2 (START), and Desc N+3 (ADDR). Desc N (DATA) indicates the current data transmission phase, and its descriptor contains information such as the destination address, data pointer, and data length. Desc N+1 (STOP) indicates the stop condition phase, used to terminate the current I3C transaction. Desc N+2 (START) indicates the start condition phase of the next I3C transaction. Desc N+3 (ADDR) indicates the address transmission phase of the next I3C transaction. In the descriptor ring, adjacent descriptors can be different protocol phases of the same transaction or connecting nodes for multiple independent transactions. The descriptors are linked sequentially by pointers and executed automatically by the hardware in order, thus supporting a batch of descriptors continuously describing multiple complete transactions or even multiple independent transactions.
[0056] Each descriptor contains information such as phase_type (protocol phase type), ctrl_flags (control flags), data_ptr (data pointer), data_len (data length), next_desc_ptr (next descriptor pointer), and status. The phase_type identifies the I3C protocol phase to which the current data segment belongs, such as START, ADDR, DATA, STOP, or HDR_ENTRY, thus upgrading the descriptor from a simple data movement instruction to a composite instruction with protocol control capabilities. The descriptor prefetch unit 219 is connected to the system memory 250 via the AXI host interface 246, and is responsible for reading descriptors in batches from the descriptor ring 252 and storing them in the descriptor FIFO 218 inside the I3C bus controller 210.
[0057] The I3C bus controller 210 integrates a protocol phase parser 213 and an I3C protocol state machine 221. The descriptor FIFO 218 outputs prefetched descriptors one by one to the protocol phase parser 213. The protocol phase parser 213 reads the `phase_type` field from the descriptor, determines the phase instruction to be executed based on the field value, and passes it to the I3C protocol state machine 221. Simultaneously, the protocol phase parser 213 also extracts the mode information from `ctrl_flags` to guide subsequent data transmission modes. The I3C protocol state machine 221 receives the parsed phase instructions and generates the corresponding SDA / SCL bus signals. For example, when phase_type is START, the state machine generates a start condition on the bus; when phase_type is ADDR, the state machine sends a 7-bit target address and read / write bits; when phase_type is DATA, the state machine controls the sending FIFO 212 or receiving FIFO 215 for data exchange; when phase_type is STOP, the state machine generates a stop condition; when phase_type is HDR_ENTRY, the state machine generates an HDR Entry sequence; when phase_type is HDR_EXIT, the state machine generates an HDR Exit sequence. When phase_type is DATA, refer to... Figure 2 As shown, if it is the sending direction, the DMA engine 240 moves the data in the system memory 250 to the sending FIFO 212 according to the data pointer and length in the descriptor; if it is the receiving direction, the data in the receiving FIFO 215 is moved back to the system memory 250 by the DMA engine 240.
[0058] This hardware-automated state transition mechanism allows a complete I3C transaction, which includes multiple stages, to be executed continuously by the hardware. An interrupt signal is only sent to the processor through the interrupt controller 245 when the entire batch of descriptors has been processed or when an error occurs, thereby significantly reducing the interrupt load on the CPU.
[0059] This embodiment combines software-defined descriptor rings and hardware automatic resolution to achieve pipelined batch processing of multiple I3C transaction transfers, while reducing the number of CPU interventions in the process.
[0060] Regarding data reassembly and burst transfer, a high data rate mode flag, HDR_MODE, has been added to the ctrl_flags field of the transfer descriptor. HDR_MODE consists of multiple bits, and different values can be set for each bit. The DMA engine adjusts the data width and burst size of the data source and target data terminals based on the value of this flag. For example, when HDR_MODE = 0 (SDR), the DMA engine transfers data in 1-byte units, and the burst size = 4; when HDR_MODE = 1 (HDR-DDR), the DMA engine transfers data in 2-byte units (after reassembly), and the burst size = 1; when HDR_MODE = 2 (HDR-BT), the DMA engine transfers data in 32-byte units (after reassembly), and the burst size = 1; when HDR_MODE = 2 (HDR-TSP), the DMA engine transfers data in 2-byte units (after reassembly), and the burst size = 1.
[0061] Figure 4 This diagram illustrates the data reassembly and burst transmission process in HDR-DDR mode. Figure 4 As shown, in the data processing flow in the receiving direction, the system executes steps S401 to S405, and in the data processing flow in the receiving direction, the system executes steps S405 to S410.
[0062] In steps S401 to S402, the DMA engine 240 initiates a send request and writes data into the send fill buffer of the send path in burst transfer mode. This buffer is configured to hold 4-byte burst data blocks, and the DMA engine 240 reads the target data from system memory through the AXI host interface and fills it into the buffer.
[0063] In step S403, the HDR data reassembly unit 214 intervenes. Since the I3C HDR-DDR mode uses two transition edges of the clock signal for data transmission at the physical layer, its effective data unit is a half-word, while DMA typically operates in units of bytes or words. The HDR transmit reassembly unit 214 reads two bytes of data from the transmit padding buffer and reassembles these two bytes into a half-word data unit according to the bit order definition of the HDR-DDR protocol. This reassembly operation ensures a strict match between the data format and the physical layer transmission requirements.
[0064] In steps S404 to S405, the reassembled data is sent to the physical layer interface of the I3C HDR-DDR. The physical layer interface sends the corresponding bit stream according to the most significant bit priority rule on each transition edge of the SCL clock on the SDA / SCL bidirectional signal line. This step continues until all the data in the transmission filling buffer has been sent.
[0065] In steps S405 to S406, the physical layer interface of the I3C HDR-DDR receives signals from the bus via the SDA / SCL INOUT pin. In HDR-DDR mode, the physical layer samples twice in each SCL clock cycle, receives 2 bytes of data every 16 clock cycles, and converts it into an internal half-word format.
[0066] In steps S407 to S408, the HDR receive reassembly unit performs the processing. The HDR receive reassembly unit splits the received half-word data into two independent bytes and stores them in the receive splicing buffer. The purpose of the receive splicing buffer is to accumulate sufficient data to trigger efficient DMA transfer.
[0067] In step S409, the concatenation buffer full status signal is used as a trigger condition to generate a DMA request. This DMA request instructs the DMA engine 240 to begin performing data transfer operations.
[0068] In step S410, the DMA engine 240 responds to the request and moves the data in the receive splicing buffer to the specified storage area in the system memory in one go.
[0069] The technical advantage of this embodiment is that, through the HDR_MODE flag, the hardware automatically adapts the DMA configuration parameters for HDR and SDR without the need for CPU intervention. At the same time, by adjusting the number of DMA requests in different modes, the DMA coordination efficiency in HDR mode is improved.
[0070] Figure 5 This diagram illustrates the processing flow for in-band interrupt-load zero-copy automatic reception. The flowchart shows how the I3C bus controller adaptively selects either the PIO or DMA path to receive variable-length IBI data based on historical statistics.
[0071] In step S501, the IBI buffer pool and DMA selector 217 detect the IBI request signal on the bus and perform bus arbitration to confirm that the master device has obtained bus control. During this process, the I3C protocol state machine 221 parses the target address and read / write bits of the IBI header to determine the identity of the slave device that initiated the interrupt. Subsequently, the system allocates a dedicated slot from the idle queue of the IBI buffer pool to temporarily store the IBI header information and initial payload data.
[0072] In steps S502 to S503, the internal IBI DMA waterline predictor makes a decision based on the adaptive threshold T1 provided by the historical statistics module and the estimated length of the current IBI load. If the current load length is determined to be less than or equal to the threshold T1, the process proceeds to the short load fast reception branch consisting of steps S504 to S505. If the load length is determined to be greater than the threshold T1, or if the amount of data exceeds the capacity of a single slot is found during reception, the process proceeds to the long load DMA cooperative reception branch consisting of steps S506 to S507.
[0073] In step S504, the IBI buffer pool and DMA selector 217 directly write the received complete payload data into the allocated slot X. Since the data volume is small and does not exceed the remaining capacity of the slot, no additional memory transfer operation is required.
[0074] In step S505, the hardware marks the slot as "ready" and sends an interrupt signal to the interrupt controller 245 to notify the CPU. After the CPU responds to the interrupt, it can directly read the data in the slot via PIO. This process achieves true zero-copy, with only a very short hardware delay required for data to travel from the bus to the CPU register, significantly reducing the CPU context switching burden when short interrupts are frequently triggered.
[0075] In step S506, when the IBI load length exceeds the remaining capacity of slot X, the hardware first stores the first part of the data into slot X, and simultaneously guides the overflowing data to the DMA buffer. At this time, the IBI buffer pool and DMA selector 217 start the DMA engine 240 and configure the corresponding transfer descriptor to move the overflowing data.
[0076] In step S507, the DMA engine 240 moves the overflow data from the internal buffer to the IBI overflow ring buffer 251 in the system memory 250 via the AXI host interface 246. After completing the data transfer, it sends a DMA completion signal. Upon receiving this signal, the IBI buffer pool and DMA selector 217 execute data merging logic, logically associating or physically concatenating the header data in slot X with the overflow data in the system memory 250 to form a complete IBI message structure. Finally, the hardware generates an interrupt signal to notify the processor that the data is ready. The IBI interface and format provided to the processor in the two branches shown in the diagram are unified.
[0077] Figure 6This diagram illustrates the process by which the mode adaptation layer automatically updates DMA parameters during bus mode switching. It details the complete processing logic of how the hardware automatically detects mode changes and notifies the mode adaptation layer to synchronously update DMA engine transfer parameters when the I3C bus controller executes an HDR entry or exit sequence.
[0078] In steps S601 to S602, the protocol phase parser 213 parses the mode hint information in the transport descriptor. Specifically, the descriptor prefetch unit 219 retrieves the transport descriptor containing the phase_type field from system memory and sends it to the protocol phase parser. The protocol phase parser 213 reads the mode_hint field and the phase_type field in the descriptor to identify the type of bus operation to be executed. If the phase_type is identified as HDR_ENTRY or HDR_EXIT, it is determined that a switch of the bus physical layer mode is about to occur. The logical transport parameters contained in the transport descriptor are: data_len (logical number of bytes, which is not affected by the physical mode), data_ptr (buffer address), and mode_hint (mode hint information).
[0079] In step S603, it is determined whether the current protocol phase is an HDR entry or exit phase. The protocol phase parser 213 performs a logical judgment on the parsed phase_type to confirm whether it corresponds to the entry sequence or exit sequence of the high data rate mode. If it is the HDR_ENTRY or HDR_EXIT phase, the process proceeds to step S604; if not, that is, the current phase is a regular SDR data transmission or other non-mode switching phase, the process proceeds to step S607.
[0080] In step S607, the I3C protocol state machine executes a mode transition sequence. When a mode switch is determined to be required, the I3C protocol state machine generates a corresponding bus signal sequence according to the I3C protocol specification. For example, in the HDR_ENTRY phase, the state machine generates a specific preamble and command sequence to switch the bus from SDR mode to HDR-DDR, HDR-BT, or HDR-TSP mode; in the HDR_EXIT phase, the state machine generates a termination sequence to restore the bus from HDR mode to SDR mode. During this process, after completing the remaining data transmission in the current mode, the I3C state machine strictly executes the mode switching instructions according to the timing requirements to ensure a smooth transition of the bus state.
[0081] In steps S604 and S605, the mode adaptation layer automatically updates the parameters and the current bus mode register (Current_Bus_Mode). A mode adaptation layer is added to the handshake interface between the I3C controller and the DMA engine. This layer maintains a current bus mode register. When the controller executes the HDR_ENTRY or HDR_EXIT descriptor, it automatically updates the current bus mode register and notifies the mode adaptation layer to update the transfer parameters required by the DMA engine. Upon receiving the notification, the mode adaptation layer immediately recalculates the transfer parameters required by the DMA engine (e.g., source / destination data width and burst size) according to a preset mapping relationship.
[0082] Table 1
[0083] In step S606, the DMA engine receives new parameters from the mode adaptation layer and uses these new parameters for data transmission. For example, when switching from SDR to HDR-DDR, the mode adaptation layer adjusts the DMA data width from 1 byte to 2 bytes and adjusts the burst length accordingly to match the data reassembly requirements of HDR mode. The DMA engine receives the new parameter configuration and interacts with the I3C controller's FIFO according to the new parameter configuration. At this point, the entire mode switching and parameter adaptation process ends, and the system enters a new stable transmission state.
[0084] This embodiment introduces a mode adaptation layer and an automatic DMA parameter update mechanism, enabling the CPU to switch I3C bus modes without reconfiguring DMA parameters, thus reducing the number of times the CPU is involved.
[0085] Figure 7 The flowchart illustrates the process of autonomous periodic acquisition of sensor data through hardware polling of a scheduling table combined with DMA double buffering.
[0086] In step S701, the hardware timer generates a periodic trigger signal based on a preset time base. This trigger signal directly acts on the polling scheduling engine, serving as the initial driving source for starting the sensor data acquisition task. When the hardware timer reaches the trigger time set in a specific table entry, the polling scheduling engine reads the corresponding configuration information from the sensor polling scheduling table 253.
[0087] In steps S702 to S703, the polling scheduling engine generates a descriptor chain based on the read configuration information and adds it to the command and response descriptor ring. The sensor polling scheduling table may include the following fields: enable (whether the polling item is enabled), period_us (polling period, microseconds), target_addr (target sensor dynamic address), reg_offset (register offset to be read), read_len (length of data to be read), priority (polling priority sorting), and timestamp_en (whether to append a timestamp).
[0088] In step S704, critical sensors are processed with high priority. Specifically, a fixed time slice is allocated to critical sensors (such as temperature sensors) in the scheduling table. When the bus is occupied by non-critical transactions, if the polling time of a critical sensor arrives and the bus is busy, the controller can wait for the current transaction to complete and immediately insert a high-priority poll. If the data delay of a critical sensor exceeds a threshold, the controller can forcibly abort the current non-critical transaction (by sending an HDR Exit or STOP message) and prioritize the execution of critical polling. This mechanism utilizes the I3C's IBI arbitration priority principle to treat the polling of critical sensors as the highest priority transaction (or high-priority queue).
[0089] In step S705, the descriptor prefetch unit loads the descriptor ring into the internal descriptor FIFO, and the protocol stage parser parses each descriptor one by one to obtain the protocol stage type field, driving the I3C protocol state machine to generate the corresponding bus signal sequence.
[0090] In step S706, a timestamp is automatically appended. Based on the sensor polling schedule table in the example above, if timestamp_en = 1, the controller automatically appends an I3C timestamp (utilizing the time-stamping feature of the I3C specification) to the transmission descriptor to record the precise time of data sampling. The timestamp is DMA'd to memory along with the sensor data, facilitating subsequent multi-sensor data fusion. In step S707, the DMA engine moves the data in the receive FIFO to buffer A or B in system memory according to the transmission descriptor. The buffer adopts a sensor dual-buffer architecture, containing two independent storage areas, buffer A and buffer B. The DMA channel arbitrator determines whether to write the data from this round of polling to buffer A or buffer B based on the current buffer selection flag.
[0091] In steps S708 to S710, it is determined whether the current buffer is A or B, and the processor decides to perform subsequent business logic processing on the buffer data A or B that has been filled based on the determination result.
[0092] This embodiment achieves automated scheduling of sensor acquisition tasks by combining a hardware timer with a polling scheduling engine. The introduction of a priority insertion mechanism ensures the real-time response capability of critical sensors, while the ping-pong double buffering technology completely decouples the time dependency between data acquisition and data processing.
[0093] Accordingly, this disclosure provides a cooperative data transmission method involving an I3C bus controller and a DMA engine. In this method, a transmission descriptor is obtained, the transmission descriptor is parsed to obtain a protocol stage type, and the I3C protocol state machine is driven to generate a bus signal sequence according to the protocol stage type. This allows each component to automatically execute the corresponding protocol stages in multiple I3C transactions in sequence based on the bus signal sequence, thereby realizing automatic hardware pipeline execution during the transmission of multiple I3C transactions.
[0094] It should be understood that the collaborative data transmission method described here corresponds to the collaborative data transmission device described in detail above, so it will not be described in detail here.
[0095] In this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, without necessarily requiring or implying any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0096] As described above, these embodiments of the present invention do not exhaustively cover all details, nor do they limit the invention to the specific embodiments described. Clearly, many modifications and variations can be made based on the above description. This specification selects and specifically describes these embodiments to better explain the principles and practical applications of the invention, thereby enabling those skilled in the art to effectively utilize the invention and its modifications. The invention is limited only by the claims and their full scope and equivalents.
Claims
1. A cooperative data transmission device, comprising an I3C bus controller and a DMA engine, wherein the I3C bus controller includes an I3C protocol controller and a protocol phase parser, wherein, The I3C protocol controller is used to implement the I3C protocol state machine; The DMA engine is used to move data between system memory and the I3C bus controller via the system bus; The protocol phase parser is used to obtain the transport descriptor from the descriptor ring in the system memory, parse the transport descriptor to obtain the protocol phase type, and drive the I3C protocol state machine to generate a bus signal sequence according to the protocol phase type, so that the DMA engine and the I3C bus controller can automatically execute the corresponding protocol phases in multiple I3C transactions in sequence.
2. The collaborative data transmission device according to claim 1, wherein the I3C bus controller further comprises: The descriptor prefetching unit is used to prefetch the transport descriptors in batches from the descriptor ring in the system memory via the system bus to the descriptor buffer inside the I3C bus controller; The protocol phase parser retrieves the transport descriptors one by one from the descriptor buffer.
3. The collaborative data transmission device according to claim 2, wherein, The multiple transport descriptors are used to describe a complete multi-segment I3C transaction or multiple independent transactions; the I3C protocol state machine only generates an interrupt signal to notify the central processing unit when the multiple transport descriptors have been executed or when an error occurs.
4. The collaborative data transmission device according to claim 1, wherein, The protocol phase types include start conditions, address transmission, common command code transmission, data transmission, stop conditions, high data rate entry sequence, and high data rate exit sequence; the protocol phase parser directly controls the I3C protocol state machine to generate corresponding serial clock line and serial data line signals according to the parsed protocol phase type.
5. The collaborative data transmission device according to claim 1, wherein the I3C bus controller further comprises: The HDR data reassembly unit is used to read data from the filling buffer in the transmission direction, reassemble it according to the bit order of the high data rate mode, and output it. In the receiving direction, it concatenates multiple bytes of data received by the I3C bus controller into a data unit that conforms to the burst transmission width of the DMA engine, and triggers a DMA request when the width condition is met.
6. The collaborative data transmission device according to claim 5, wherein, In the transmission direction, the HDR data reassembly unit maps two bytes to the rising and falling edges of the clock signal according to the high-order bit-first rule and sends them. In the reception direction, it concatenates data received in multiple clock signal cycles into half-words or words to match the burst transmission width of the DMA engine.
7. The collaborative data transmission apparatus according to claim 5, wherein the transmission descriptor further includes a high data rate mode flag, and the DMA engine adjusts the data width and burst size of the data source or data destination according to the high data rate mode flag; When the high data rate mode flag indicates single data rate mode, the DMA engine moves data in units of one byte. When the high data rate mode flag indicates high data rate-dual data rate mode, high data rate-bulk transfer mode, or high data rate-tri-state pulse mode, the DMA engine moves data in units of the data width reconstructed by the HDR data reconstruction unit.
8. The collaborative data transmission device according to claim 1, wherein the I3C bus controller further comprises a mode adaptation layer for maintaining a current bus mode register and updating the transmission parameters of the DMA engine according to the bus operating mode indicated by the current bus mode register.
9. In the collaborative data transmission device according to claim 8, when the I3C protocol controller executes the transmission descriptor corresponding to the high data rate entry sequence or the high data rate exit sequence, it updates the current bus mode register and sends a mode switching notification to the mode adaptation layer to trigger the automatic update of the transmission parameters of the DMA engine.
10. The cooperative data transmission device according to claim 1, wherein the I3C bus controller further comprises an IBI buffer pool and a DMA selector, the IBI buffer pool comprising multiple slots, each slot having a fixed storage capacity, and the DMA selector being used to dynamically select a receive path based on the length of the in-band interrupt load, including: When the load length is less than or equal to a preset threshold, data is written to the slot. When the load length is greater than the preset threshold or exceeds the slot capacity, the DMA engine is triggered to perform data transfer.
11. The collaborative data transmission device according to claim 10, wherein the I3C bus controller further includes an IBI DMA waterline predictor for recording the length distribution of interrupt loads within a historical band and adjusting a preset threshold for selecting a receive path or DMA receive path based on statistical results.
12. The collaborative data transmission device according to claim 1, wherein the I3C bus controller further comprises a polling scheduling engine for maintaining a sensor polling scheduling table; the polling scheduling engine further comprises a timer for inserting the corresponding transmission descriptor chain into the descriptor ring and starting transmission when the trigger time indicated by the table entry is reached.
13. The collaborative data transmission device according to claim 12, wherein the polling scheduling engine allocates a first buffer and a second buffer to each sensor, and the I3C protocol controller switches the target buffer through the buffer selection field in the transmission descriptor, so that when the polling result of the current round is written to the current buffer, the central processing unit can process the data stored in the other buffer in the previous round.
14. A controller integrating a collaborative data transmission device as described in any one of claims 1 to 13.
15. A collaborative data transmission method, comprising: Obtain a transport descriptor, which contains a field indicating the protocol stage type; Parse the transport descriptor to obtain the protocol stage type; The I3C protocol state machine is driven to generate a bus signal sequence according to the protocol phase type. Based on the bus signal sequence, each component is driven to automatically execute the corresponding protocol stages in multiple I3C transactions in sequence, so as to realize the automatic hardware pipeline execution during the transmission of the multiple I3C transactions.
