Data transmission control method and application thereof

By dynamically adjusting the pointer stride and starting position of the FIFO cache module, the problem of lack of flexibility in data transmission bit width conversion of peripheral interfaces is solved, efficient data transmission management is realized, and the system adaptability and performance is improved.

CN119066005APending Publication Date: 2024-12-033PEAK (SHANGHAI) LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411201623.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-29
Publication Date
2024-12-03

AI Technical Summary

Technical Problem

In the prior art, the data transmission bit width conversion of peripheral interfaces can only be achieved through a fixed proportion, and the flexibility of dynamic adjustment is lacking, resulting in insufficient efficiency and resource utilization when the system faces diversified peripherals and dynamically changing transmission needs. .

Method used

By designing multiple sets of ordered FIFO cache modules, dynamically adjusting the pointer stride and starting position, flexible storage and transmission of data transmission are achieved, adapting to different bit width requirements, and ensuring the continuity and orderliness of data transmission.

Benefits of technology

It improves the adaptability and efficiency of data transmission, reduces bandwidth waste, significantly improves the overall performance of the system, and overcomes the limitations of fixed-scale bit width conversion.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119066005A_ABST
    Figure CN119066005A_ABST
Patent Text Reader

Abstract

The invention discloses a data transmission control method and application thereof. The method comprises the following steps: providing a plurality of groups of orderly arranged FIFO (First In First Out) cache modules; according to the required data bit width of the data transmission, determining the pointer stride of the FIFO cache module of the data transmission; according to the pointer stride and the starting FIFO position of the FIFO cache module of the data transmission, starting from the starting FIFO position, reading or writing data in the orderly arranged FIFO cache modules in sequence; and after the reading or writing operation of the data transmission is completed, updating the initial FIFO position of the next data transmission according to the pointer stride of the FIFO cache module of the operation. According to the data transmission control method and the application thereof provided by the invention, the use and bit width conversion of the FIFO cache module can be dynamically adjusted according to specific data transmission requirements, so that the system can better adapt to different peripheral interface and bus bit width requirements, and the adaptability of data transmission is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of computer communication technology, and in particular relates to a data transmission control method, system, peripheral interface, electronic device and readable medium. Background Art

[0002] In modern computer systems, controllers play a vital role as the key core component that manages and coordinates the work of various components. The controller controls and schedules data transmission, resource allocation, and task execution between various components to ensure the efficient operation of the entire system.

[0003] During data transmission, the controller transmits data through the bus, transmitting n bytes each time. Usually, the size of n is selectable, which enables the system to flexibly adjust the bandwidth of data transmission to adapt to different application scenarios and data processing requirements. For example, in the standard AMBA bus protocol, the PSTROB signal of APB and the TSIZE signal of AHB are used to control and indicate the number of bytes of data transmission, thereby realizing dynamic adjustment of data bandwidth.

[0004] However, as an external device connected to a computer system, the data processing capability of a peripheral is usually inconsistent with that of a controller. This inconsistency is not only reflected in the processing speed, but also in the bit width requirement for data transmission. In order to ensure normal communication between the peripheral and the system, the data transmission requirements of the peripheral interface are usually required to be configurable. When the peripheral interface in the prior art reads and writes data, the bit width conversion function can often only be implemented in a parameterized manner. These parameters are generally configured in a fixed ratio and lack the flexibility of dynamic adjustment.

[0005] Therefore, it is necessary to provide a new solution to the above technical problems. Summary of the invention

[0006] The object of the present invention is to provide a data transmission control method and application thereof, which can dynamically adjust the bit width conversion of a FIFO buffer module according to specific data transmission requirements.

[0007] To achieve the above purpose, the technical solution provided by the present invention is as follows:

[0008] In a first aspect, the present invention provides a data transmission control method, comprising: providing a plurality of groups of orderly arranged FIFO cache modules, each group of the FIFO cache modules comprising at least one FIFO cache unit; determining the FIFO cache module pointer stride of the current data transmission according to the required data bit width of the current data transmission; performing data read or write operations in the orderly arranged FIFO cache modules in sequence, starting from the starting FIFO position, according to the FIFO cache module pointer stride and the starting FIFO position of the current data transmission; after completing the read or write operation of the current data transmission, updating the starting FIFO position of the next data transmission according to the FIFO cache module pointer stride of the current operation.

[0009] In one or more embodiments, the control logic formula for performing data read or write operations in the ordered FIFO buffer modules sequentially includes:

[0010]

[0011] Among them, wr_ctrl[N-1:0] represents the read and write signal array used to control the FIFO cache module, N represents the number of FIFO cache modules, fifo_idx represents the position index of the starting FIFO, and fifo_point_inc represents the pointer stride of the FIFO cache module.

[0012] In one or more embodiments, the formula for updating the starting FIFO position of the next data transmission according to the FIFO buffer module pointer stride of the current operation includes:

[0013] fifo_idx=(fifo_idx+fifo_point_inc)%N

[0014] Wherein, fifo_idx indicates the position index of the starting FIFO, fifo_point_inc indicates the stride of the FIFO buffer module pointer, and % indicates a modulo operation.

[0015] In one or more implementations, according to the required data bit width of the current data transmission, the formula for determining the stride of the FIFO buffer module pointer for the current data transmission includes:

[0016]

[0017] Among them, fifo_point_inc represents the pointer stride of the FIFO cache module, data_width represents the required data bit width of data transmission, and fifo_width represents the storage bit width of a single FIFO cache unit.

[0018] In one or more embodiments, when the number of FIFO buffer modules arranged in order is 4 groups, the control logic formula for performing data read or write operations in the FIFO buffer modules arranged in order sequentially includes:

[0019]

[0020] fifo_idx[1:0]=fifo_idx[1:0]+fifo_point_inc

[0021] Among them, wr_ctrl[3:0] represents the read and write signal array used to control the FIFO cache module, fifo_idx[1:0] represents the position index of the starting FIFO, and fifo_point_inc represents the pointer stride of the FIFO cache module.

[0022] In a second aspect, the present invention provides a data transmission control system, comprising: a storage module, having a plurality of groups of FIFO cache modules arranged in order, each group of the FIFO cache modules comprising at least one FIFO cache unit; a determination module, for determining the FIFO cache module pointer stride of the current data transmission according to the required data bit width of the current data transmission; a read-write module, for performing data read or write operations in the ordered FIFO cache modules in sequence, starting from the starting FIFO position, according to the FIFO cache module pointer stride and the starting FIFO position of the current data transmission; an update module, for updating the starting FIFO position of the next data transmission according to the FIFO cache module pointer stride of the current operation after completing the read or write operation of the current data transmission.

[0023] In a third aspect, the present invention provides a peripheral interface, which includes multiple groups of orderly arranged TXFIFO cache modules; when a controller bus writes data to the peripheral interface, the write pointer stride of the TXFIFO cache module is determined according to the effective transmission bit width of the controller bus; according to the write pointer stride and the starting TXFIFO position of this write operation, starting from the starting TXFIFO position, data writing operations are performed in the orderly arranged TXFIFO cache modules in sequence; after completing this write operation, the starting TXFIFO position of the next write operation is updated according to the write pointer stride of this write operation.

[0024] In a fourth aspect, the present invention provides a peripheral interface, which includes multiple groups of orderly arranged RXFIFO cache modules; when a controller bus reads data from the peripheral interface, the read pointer stride of the RXFIFO cache module is determined according to the effective transmission bit width of the controller bus; according to the read pointer stride and the starting RXFIFO position of this read operation, starting from the starting RXFIFO position, data reading operations are performed from the orderly arranged RXFIFO cache modules in sequence; after completing this read operation, the starting RXFIFO position of the next read operation is updated according to the read pointer stride of this read operation.

[0025] In a fifth aspect, the present invention provides a peripheral interface, which includes multiple groups of orderly arranged RXFIFO cache modules; when the peripheral writes data to the peripheral interface, the write pointer stride of the RXFIFO cache module is determined according to the effective transmission bit width of the peripheral; according to the write pointer stride and the starting RXFIFO position of this write operation, starting from the starting RXFIFO position, the data writing operation is performed in the orderly arranged RXFIFO cache modules in sequence; after completing the current write operation, according to the write pointer stride of this write operation, the starting RXFIFO position of the next write operation is updated.

[0026] In a sixth aspect, the present invention provides a peripheral interface, which includes multiple groups of orderly arranged TXFIFO cache modules; when the peripheral reads data from the peripheral interface, the read pointer stride of the TXFIFO cache module is determined according to the effective transmission bit width of the peripheral; according to the read pointer stride and the starting TXFIFO position of this read operation, starting from the starting TXFIFO position, data read operations are performed in sequence from the orderly arranged TXFIFO cache modules; after completing this read operation, the starting TXFIFO position of the next read operation is updated according to the read pointer stride of this read operation.

[0027] In a seventh aspect, the present invention provides an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the data transmission control method as described above when executing the program.

[0028] In an eighth aspect, the present invention provides a computer-readable medium, wherein the computer-readable medium carries computer execution instructions, and the computer execution instructions, when executed by a processor, are used to implement the data transmission control method as described above.

[0029] Compared with the prior art, the data transmission control method and application thereof provided by the present invention can dynamically adjust the use of the FIFO cache module and the bit width conversion according to specific data transmission requirements, overcoming the limitation of the prior art that only fixed-ratio bit width conversion can be adopted, so that the system can better adapt to different peripheral interfaces and bus bit width requirements, and improve the adaptability of data transmission; the pointer stride of the FIFO cache module can be flexibly configured, the transmission capacity of the bus can be more efficiently utilized, bandwidth waste can be reduced, and data transmission efficiency can be significantly improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present invention, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0031] Figure 1 A schematic diagram of an application scenario of the present invention;

[0032] Figure 2 A flowchart of a data transmission control method in one embodiment of the present invention;

[0033] Figure 3 is a schematic diagram of a data transmission control device in one embodiment of the present invention;

[0034] Figure 4 A schematic diagram of a data interaction scenario in an embodiment of the present invention;

[0035] Figure 5 FIG. 4 is a schematic diagram of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0036] In order to enable those skilled in the art to better understand the technical solutions in the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0037] In modern computer systems, as the diversity and complexity of peripheral devices continue to increase, the data transmission requirements between controllers and peripheral interfaces are becoming increasingly complex. This complexity is mainly reflected in the significant differences in data processing capabilities and bit width requirements between different devices. For example, controllers are usually able to transmit data at a higher bandwidth, while the processing capabilities of peripherals are often limited, resulting in a mismatch in data transmission between the two. This mismatch may not only lead to a waste of bandwidth, but also affect the overall performance of the system, especially in multi-tasking parallel processing or high data throughput scenarios. This problem is particularly prominent.

[0038] In the prior art, data transmission of peripheral interfaces often relies on fixed-ratio bit width conversion. Although this method can meet the needs of certain specific applications, it lacks sufficient flexibility when facing diversified peripherals and dynamically changing transmission requirements. For example, when the peripheral interface needs to process data streams of different widths, the fixed bit width conversion ratio cannot fully utilize the transmission capacity of the bus, resulting in serious deficiencies in the efficiency and resource utilization of the system. In addition, the existing fixed-ratio bit width conversion method is prone to data transmission delays and system performance degradation when frequently switching between different devices.

[0039] Based on the above-mentioned deficiencies of the prior art, the present invention is proposed to solve these key problems existing in data transmission between the controller and the peripheral interface. The technical implementation idea of ​​the present invention can be summarized as: by designing a FIFO (First Input First Output) cache module management mechanism that can be adjusted according to actual transmission requirements, efficient adaptation to multiple data bit widths and different peripheral processing capabilities can be achieved.

[0040] The core idea of ​​the present invention is to realize flexible storage and transmission of data through multiple orderly arranged FIFO buffer modules. The system dynamically determines the pointer stride of each data transmission, so that the data transmission operation can not only adapt to different bit width requirements, but also automatically update the starting position of the next operation after completing each operation, thereby ensuring the continuity and orderliness of data transmission. This design concept enables the system to efficiently and seamlessly exchange data between different peripheral interfaces and controllers, greatly improving the adaptability and overall performance of the system.

[0041] Through the method of the present invention, the system can overcome the limitations of traditional fixed-ratio bit width conversion and achieve more efficient data transmission management. The present invention not only solves the bottleneck problem in the current technology, but also provides a basis for possible future expansion and application, so that the system can cope with more complex and changeable application scenarios.

[0042] Please refer to Figure 1, which is a schematic diagram of an application scenario of the present invention. In this application scenario, the system is composed of a controller 101 and a peripheral 102, and a peripheral interface 103 (which can be a logic module) is integrated on the controller. The method of the present invention implements data transmission control between the controller 101 and the peripheral 102 through the peripheral interface 103.

[0043] Specifically, the controller 101 is connected to the peripheral 102 through the peripheral interface 103. The peripheral interface 103 serves as a bridge between the controller 101 and the peripheral 102, and is responsible for managing and coordinating the transmission of data between the two. The peripheral interface 103 can be a logic module in the controller, which has the ability to dynamically manage the FIFO cache module to achieve flexible control of data transmission.

[0044] A plurality of orderly arranged FIFO buffer modules are configured in the peripheral interface 103. These FIFO buffer modules are respectively used to process data read and write operations between the controller 101 and the peripheral 102. Each group of FIFO buffer modules includes at least one FIFO buffer unit, and the number and arrangement order of the FIFO buffer modules can be configured according to system requirements to adapt to different data transmission requirements.

[0045] When the controller 101 needs to send data to the peripheral 102 through the peripheral interface 103 , the system first analyzes the required data bit width of this data transmission. The required data bit width may be determined by the bus width of the controller 101 or by the processing capability of the peripheral 102 .

[0046] According to the analysis results, the peripheral interface 103 dynamically determines the pointer stride of the FIFO buffer module for this data transmission. The pointer stride determines the number of FIFO buffer modules that will be used in this data transmission operation. For example, if the required data bit width is 16 bits, and the storage bit width of each FIFO buffer unit is 8 bits, the pointer stride will be set to 2, indicating that the operation needs to be performed across two FIFO buffer modules.

[0047] After determining the pointer stride and the starting FIFO position, the peripheral interface 103 starts to read or write data from the starting FIFO position (the first FIFO buffer module of this operation) in sequence. Since the FIFO buffer modules are arranged in order, the peripheral interface 103 will transfer data from the controller 101 to the peripheral 102 one by one according to the order of the FIFO buffer modules, or read data from the peripheral 102 and transmit it back to the controller 101. This operation ensures the orderliness of the data during the transmission process and avoids confusion of data between different FIFO buffer modules. By performing read and write operations in sequence, the system can effectively manage the data flow and ensure the integrity and consistency of the data.

[0048] After completing the read or write operation of this data transmission, the peripheral interface 103 will update the starting FIFO position of the next data transmission according to the FIFO buffer module pointer stride of this operation. The updated starting position will be used as the starting point of the next data operation, so that the system can continuously and seamlessly perform multiple data transmission operations.

[0049] The peripheral interface 103 can not only process the data transmission between the controller 101 and the peripheral 102, but also adapt to the requirements of different data bit widths. When the data processing capability or required data bit width of the peripheral 102 changes, the peripheral interface 103 can dynamically adjust the usage and pointer stride of the FIFO buffer module to ensure the flexibility and adaptability of data transmission.

[0050] Please refer to Figure 2 FIG. 1 is a flow chart of a data transmission control method in an embodiment of the present invention. The data transmission control method specifically includes the following steps:

[0051] S201: providing a plurality of groups of orderly arranged FIFO buffer modules, each group of the FIFO buffer modules comprising at least one FIFO buffer unit.

[0052] It should be noted that the FIFO cache module is an intermediary and buffer for data transmission between the controller and peripherals. It is used to adapt to scenarios with different data bit widths and transmission requirements, so that the system can flexibly adjust data storage and transmission methods when facing a variety of peripheral interfaces.

[0053] Multiple FIFO buffer modules can be constructed by hardware or software. Each group of FIFO buffer modules consists of at least one FIFO buffer unit, which are arranged in a specific order to form an ordered storage structure. Specifically, these FIFO buffer modules can be designed as parallel or cascaded storage units to meet different data processing requirements.

[0054] Assume that multiple data streams of different widths need to be processed, which may include 16-bit, 32-bit or higher bit-width data. In this case, each group of FIFO buffer modules can contain one or more 8-bit wide FIFO buffer units. These FIFO buffer modules can be arranged in a certain order, so that when the system needs to process 16-bit data, an 8-bit wide FIFO buffer unit can be called from two groups of consecutively arranged FIFO buffer modules for data storage and transmission. If 32-bit data needs to be processed, an 8-bit wide FIFO buffer unit can be called from four groups of consecutively arranged FIFO buffer modules for data storage and transmission. Through this arrangement, the number of FIFO buffer modules used can be flexibly adjusted to ensure the effectiveness and flexibility of data transmission.

[0055] S202: Determine the FIFO buffer module pointer stride for the current data transmission according to the required data bit width for the current data transmission.

[0056] It should be noted that the FIFO buffer module pointer stride determines how many consecutive FIFO buffer modules need to be crossed to complete the data storage or reading operation in one data transmission operation.

[0057] In actual implementation, we first need to analyze the current data transmission task and determine the data width required for the task. For example, in an embedded system, the controller may need to communicate with multiple peripherals, and the data width of each peripheral may be different. Some peripherals may only require 8 bits of data width, while other peripherals may require 16 bits, 32 bits or even higher data width. According to these different requirements, the system needs to dynamically adjust the pointer stride of the FIFO cache module to effectively utilize the cache resources.

[0058] One of the specific implementation methods is to calculate the pointer stride through hardware logic or software configuration. Assuming that each FIFO cache unit of the system is 8 bits wide, if the required data bit width of this data transmission is 16 bits, the pointer stride should be set to 2. That is, the system will span two consecutive FIFO cache modules in this operation, and call an 8-bit wide FIFO cache unit from each FIFO cache module to process 16-bit data. Similarly, if the data bit width is 32 bits, the pointer stride will be set to 4, and the system will span four consecutive FIFO cache modules in the operation.

[0059] This dynamic adjustment of the pointer stride not only ensures that the system can handle different data widths, but also avoids wasting resources. For example, if the data width is 16 bits and the pointer stride is incorrectly set to 1, the system will only use an 8-bit wide FIFO buffer unit in one operation, resulting in two operations to complete a full 16-bit data transfer. This situation will significantly reduce the transmission efficiency and increase the processing burden of the system. By calculating and setting the pointer stride, the system can fully process the data in one operation, thereby improving the transmission efficiency.

[0060] In addition, the adjustment of the pointer stride can also optimize the response speed of the system. In a multi-tasking scenario, different tasks may require different data bit widths. By dynamically adjusting the pointer stride, the system can quickly switch and adapt to the needs of different tasks, reducing the delay between tasks. For example, when the system needs to process an 8-bit wide data task immediately after processing a 16-bit wide data task, by adjusting the pointer stride, the system can quickly complete the switch and ensure that each task can be performed efficiently at the required bit width.

[0061] Step S202 can also be implemented by software, so that the system can adjust according to real-time needs during operation. For example, during operation, the system can dynamically calculate and update the pointer stride by monitoring the current data flow and peripheral requirements. This adaptive capability enables the system to maintain efficient operation in various complex application scenarios.

[0062] S203: According to the FIFO buffer module pointer stride and the starting FIFO position of the current data transmission, starting from the starting FIFO position, data reading or writing operations are performed in the orderly arranged FIFO buffer modules in sequence.

[0063] In practical applications, first, the scope of this operation is determined according to the pointer stride (i.e., the number of FIFO buffer modules required for this data transmission) determined in the previous step S202 and the current starting FIFO position (i.e., the first FIFO buffer module in this data transmission). The starting FIFO position is usually determined by the result of the previous data operation or the set value during initialization. Starting from the starting FIFO position, according to the size of the pointer stride, the specified number of continuous FIFO buffer modules are read or written in sequence.

[0064] Assume that the pointer stride is determined to be 3 in step S202, that is, this operation needs to use 3 consecutive FIFO buffer modules. If the starting FIFO position is 2 (indicating the 3rd FIFO buffer unit, 0 indicates the 1st FIFO buffer unit), then the data read or write operation will be performed in the 3rd, 4th, and 5th FIFO buffer modules in sequence. Specifically, if this is a write operation, the data will be written into the FIFO buffer units of the 3 FIFO buffer modules in sequence according to the order of the data; if it is a read operation, the data will be read from the FIFO buffer units of the 3 FIFO buffer modules in sequence.

[0065] This orderly operation ensures that the data remains coherent and consistent during transmission, avoiding data loss or errors due to position confusion. By operating sequentially from the starting FIFO position, the data flow can be efficiently managed so that data can flow smoothly through multiple FIFO buffer modules. In addition, this design also supports the processing of large data blocks, so that even data flows that need to cross multiple FIFO buffer modules can be seamlessly processed by the system.

[0066] In a specific implementation, the above operations can be automatically implemented by hardware circuits or dynamically controlled by software instructions. For example, in hardware implementation, a read / write controller can be designed, which automatically generates read / write signals according to the pointer stride and the starting position, thereby controlling the flow of data in the FIFO cache module. For software implementation, a pointer can be used to mark the current FIFO position, and the position of the pointer can be adjusted according to the stride to ensure the order of data operations.

[0067] In addition, this operation process also needs to deal with the relationship between the pointer stride and the FIFO buffer module boundary. If the operation crosses the end of the FIFO buffer module (that is, the FIFO buffer modules that need to be used exceed the number of modules), a wraparound mechanism can be set so that the operation can start again from the first FIFO buffer module. For example, if the system has 8 FIFO buffer modules, and the operation starts at position 6 and the stride is 3, the system will use the 6th, 7th, and 8th FIFO buffer modules, and then wrap around to the first FIFO buffer module to continue subsequent read and write operations.

[0068] This wraparound mechanism not only ensures the flexibility of the system when processing continuous large data blocks, but also prevents system errors caused by out-of-bounds operations. In addition, this mechanism enables the system to efficiently utilize all available FIFO buffer modules and avoid resource waste.

[0069] In an exemplary embodiment, the control logic formula for performing data read or write operations in the ordered FIFO buffer modules sequentially includes:

[0070]

[0071] Among them, wr_ctrl[N-1:0] represents the read and write signal array used to control the FIFO cache module, N represents the number of FIFO cache modules, fifo_idx represents the position index of the starting FIFO, and fifo_point_inc represents the pointer stride of the FIFO cache module.

[0072] wr_ctrl[N-1:0] represents an array of read / write signals used to control the FIFO buffer module. It is an N-bit binary number, with each bit corresponding to a read / write operation control bit of a FIFO buffer module. The value of each bit depends on whether the corresponding FIFO buffer single module is activated for read / write operations. If a certain bit is 1, it means the corresponding FIFO buffer module is activated; if it is 0, it means it is not activated. Here, N is the number of groups of FIFO buffer modules. This array controls whether each FIFO buffer module participates in the current read / write operation. By activating specific FIFO buffer modules, it is possible to selectively perform data operations on multiple FIFO buffer modules as needed, ensuring that when facing different data bit-width requirements, the FIFO buffer modules can be flexibly allocated and utilized.

[0073] fifo_idx represents the position index of the starting FIFO, that is, which FIFO buffer module the current operation should start from. This index indicates the starting point of the current read / write operation, ensuring that the operation starts from the correct position in the ordered FIFO buffer modules and avoiding data operation confusion or duplication.

[0074] fifo_point_inc represents the pointer stride of the FIFO buffer module, that is, the number of FIFO buffer modules that the system spans in this operation. The pointer stride determines the number of FIFO buffer modules that need to be activated in the current operation. fifo_point_inc can be dynamically adjusted according to the data bit-width requirements, so as to adapt to different data transmission requirements. By setting the pointer stride, multiple FIFO buffer modules can be efficiently managed and resource waste can be avoided.

[0075] When fifo_point_inc = 1, that is, when the pointer stride is 1, only one FIFO buffer module at the starting position needs to be activated for data operation. 1<<fifo_idx means shifting the value 1 to the left by fifo_idx bits, that is, only activating the FIFO buffer module at the starting FIFO position.

[0076] When fifo_point_inc > 1, that is, when the pointer stride is greater than 1, multiple consecutive FIFO buffer modules need to be activated for data operation. It means that starting from the starting position fifo_idx, consecutively activate fifo_point_inc (fifo_point_inc is a positive integer) FIFO buffer modules.

[0077] Specifically, the formula for determining the pointer stride of the FIFO buffer module for this data transmission according to the data bit-width requirements of this data transmission includes:

[0078]

[0079] Among them, fifo_point_inc represents the pointer stride of the FIFO cache module, data_width represents the required data bit width of data transmission, and fifo_width represents the storage bit width of a single FIFO cache unit.

[0080] For example, assuming there are 4 FIFO buffer modules (N=4), wr_ctrl[3:0] is a 4-bit binary number, and the bit width of each FIFO buffer module is 8 bits. Assume that the required bit width of data transmission is 24 bits, that is, data_width=24bits, and the bit width of each FIFO buffer unit is 8 bits, that is, fifo_width=8bits. According to the formula, fifo_point_inc=3 is calculated, indicating that this data transmission needs to cross 3 FIFO buffer modules.

[0081] Assuming that the FIFO starting position of this operation is fifo_idx=1 (operation starts from the second FIFO buffer unit), the control signal wr_ctrl is generated using the following formula:

[0082]

[0083] The calculation process is as follows:

[0084] ①1<<1=0010 (activate the second FIFO);

[0085] ②1<<2=0100 (activate the third FIFO);

[0086] ③1<<3=1000 (activate the fourth FIFO);

[0087] Adding them together yields wr_ctrl[3:0]=0010+0100+1000=1110, indicating that the second, third, and fourth FIFO buffer units are to be activated for data transmission operations.

[0088] S204: After completing the read or write operation of the current data transmission, the starting FIFO position of the next data transmission is updated according to the FIFO buffer module pointer stride of the current operation.

[0089] In a specific implementation, step S204 first needs to record the current FIFO starting position and the pointer stride of this operation. The pointer stride is determined by step S202, which determines how many FIFO buffer modules the system crosses in this operation. After this operation is completed, the current starting FIFO position is updated according to the pointer stride to determine the starting FIFO position of the next data operation.

[0090] In an exemplary embodiment, according to the FIFO buffer module pointer stride of the current operation, the formula for updating the starting FIFO position of the next data transmission includes:

[0091] fifo_idx=(fifo_idx+fifo_point_inc)%N

[0092] Among them, fifo_idx represents the position index of the starting FIFO, fifo_point_inc represents the FIFO buffer module pointer stride, % represents the modulo operation, and N represents the number of FIFO buffer modules. The purpose of the modulo operation is to ensure that fifo_point_inc can correctly wrap around to the previous FIFO buffer module when crossing the last FIFO buffer module.

[0093] For example, suppose a pointer with a stride of 3 is used in this operation, and the starting FIFO position is 2 (indicating the 3rd FIFO buffer unit). After the data transfer is completed, the system updates the starting position from 2 to (2+3)%N, where N represents the total number of FIFO buffer modules. If the system has 8 FIFO buffer modules, the starting FIFO position of the next data operation will be 5 (indicating the 6th FIFO buffer module). This update mechanism ensures that the next data operation starts from the correct position and avoids data overlap or blank areas.

[0094] By automatically adjusting the starting FIFO position, multiple data blocks can be processed continuously and efficiently without manual intervention. This automatic update mechanism can significantly improve the system's response speed and data transmission efficiency, especially when processing large data streams or high-frequency data transmission. In addition, it also avoids data loss or erroneous transmission that may be caused by manual adjustment errors.

[0095] In a specific implementation, this update step can be implemented by hardware or software. For example, the hardware implementation can design a special counter that automatically adjusts the FIFO starting position according to the pointer stride and triggers the wrap mechanism at the end of the operation. If the operation crosses the end of the FIFO buffer module (the last FIFO buffer module), the counter will automatically wrap back to the first FIFO unit to ensure that the next operation starts from the correct position. The software implementation can update the FIFO pointer variable by calculating the new starting position and recording the value in the memory for the next operation.

[0096] This automatic start position update enables efficient management of FIFO buffer units during multi-task parallel processing. For example, in a system that needs to process multiple data streams simultaneously, different data streams may use different FIFO units. When the operation of a data stream is completed, the system can quickly update the start position of the stream so that it is ready to receive or send the next batch of data. This mechanism ensures that the system can maintain the coherence and consistency of data processing while efficiently utilizing resources.

[0097] In addition, step S204 is also flexible. No matter how the length or frequency of the data stream changes, the system can dynamically adjust the starting position according to the actual operation situation to ensure seamless data transmission. This is of great significance for application scenarios that require real-time data processing, such as audio and video stream processing or high-speed data transmission. Through this step, the system can maximize the efficiency and reliability of data transmission and reduce bottlenecks and delays in data processing.

[0098] In an exemplary embodiment, when the number of FIFO buffer modules arranged in order is 4 groups, the control logic formula for performing data read or write operations in the FIFO buffer modules arranged in order sequentially includes:

[0099]

[0100] fifo_idx[1:0]=fifo_idx[1:0]+fifo_point_inc

[0101] Among them, wr_ctrl[3:0] represents the read and write signal array used to control the FIFO cache module, fifo_idx[1:0] represents the position index of the starting FIFO, and fifo_point_inc represents the pointer stride of the FIFO cache module.

[0102] Please refer to Figure 3 As shown, based on the same inventive concept as the aforementioned data transmission control method, the present invention provides a data transmission control device 300 , which includes: a storage module 301 , a determination module 302 , a read-write module 303 and an update module 304 .

[0103] Among them, the storage module 301 has multiple groups of FIFO cache modules arranged in order, and each group of the FIFO cache modules includes at least one FIFO cache unit. The determination module 302 is used to determine the FIFO cache module pointer stride of this data transmission according to the required data bit width of this data transmission. The read-write module 303 is used to perform data read or write operations in the orderly arranged FIFO cache modules in sequence, starting from the starting FIFO position, according to the FIFO cache module pointer stride and the starting FIFO position of this data transmission. The update module 304 is used to update the starting FIFO position of the next data transmission according to the FIFO cache module pointer stride of this operation after completing the read or write operation of this data transmission.

[0104] Please refer to Figure 4 As shown, based on the same inventive concept as the aforementioned data transmission control method, the present invention provides a peripheral interface, which includes a plurality of groups of orderly arranged TXFIFO (data transmission FIFO) cache modules; when the controller bus writes data to the peripheral interface, the write pointer stride of the TXFIFO cache module is determined according to the effective transmission bit width of the controller bus; according to the write pointer stride and the starting TXFIFO position of this write operation, starting from the starting TXFIFO position, the data write operation is performed in the orderly arranged TXFIFO cache modules in sequence; after completing this write operation, according to the write pointer stride of this write operation, the starting TXFIFO position of the next write operation is updated.

[0105] When the controller bus is ready to write data to the peripheral interface, the system first determines the write pointer stride fifo_point_inc of the TXFIFO buffer module for this write operation based on the effective transmission bit width of the controller bus. The transmission bit width determines how many FIFO buffer modules the system needs to cross in each data write operation.

[0106] After determining the write pointer stride and the starting TXFIFO position, the system starts to perform data writing operations. The system starts from the starting TXFIFO position fifo_idx and writes the data into the corresponding number of FIFO units in the order of the FIFO buffer modules.

[0107] After completing the current data write operation, the system needs to update the starting TXFIFO position for the next write operation. Based on the write pointer stride fifo_point_inc of this operation, the system calculates the new starting position fifo_idx so that the next data write operation can start from the correct position.

[0108] Please refer to Figure 4As shown, based on the same inventive concept as the aforementioned data transmission control method, the present invention provides a peripheral interface, which includes a plurality of groups of orderly arranged RXFIFO (data receive FIFO) cache modules; when the controller bus reads data from the peripheral interface, the read pointer stride of the RXFIFO cache module is determined according to the effective transmission bit width of the controller bus; according to the read pointer stride and the starting RXFIFO position of this read operation, starting from the starting RXFIFO position, the data read operation is performed from the orderly arranged RXFIFO cache modules in sequence; after completing this read operation, according to the read pointer stride of this read operation, the starting RXFIFO position of the next read operation is updated.

[0109] Please refer to Figure 4 As shown, based on the same inventive concept as the aforementioned data transmission control method, the present invention provides a peripheral interface, which includes a plurality of groups of orderly arranged RXFIFO cache modules; when the peripheral writes data to the peripheral interface, the write pointer stride of the RXFIFO cache module is determined according to the effective transmission bit width of the peripheral; according to the write pointer stride and the starting RXFIFO position of this write operation, starting from the starting RXFIFO position, the data write operation is performed in the orderly arranged RXFIFO cache modules in sequence; after completing this write operation, according to the write pointer stride of this write operation, the starting RXFIFO position of the next write operation is updated.

[0110] Please refer to Figure 4 As shown, based on the same inventive concept as the aforementioned data transmission control method, the present invention provides a peripheral interface, which includes a plurality of groups of orderly arranged TXFIFO cache modules; when the peripheral reads data from the peripheral interface, the read pointer stride of the TXFIFO cache module is determined according to the effective transmission bit width of the peripheral; according to the read pointer stride and the starting TXFIFO position of this read operation, starting from the starting TXFIFO position, the data read operation is performed from the orderly arranged TXFIFO cache modules in sequence; after completing the current read operation, the starting TXFIFO position of the next read operation is updated according to the read pointer stride of this read operation.

[0111] Please refer to Figure 4 FIG. 1 is a schematic diagram of a data interaction scenario between a peripheral device and a controller in an embodiment of the present invention. Figure 4 In the scenario shown, the peripheral interface includes four TXFIFO (data transmission FIFO) buffer modules and four RXFIFO (data reception FIFO) buffer modules, as well as an SPI (serial interface) module. The controller exchanges data with the peripherals through the peripheral interface.

[0112] The controller generates the data to be transmitted and prepares it in byte or word order. Figure 4 The four data units (D3, D2, D1, D0) prepared by the controller are shown. The controller sends data to the peripheral through the TXFIFO buffer module. The controller writes the prepared data to the TXFIFO buffer module in sequence, starting from the first TXFIFO buffer module (the starting TXFIFO position is determined by the write fifo_idx of the TXFIFO), and automatically increments according to the write pointer. For example, D0 is first written to the first TXFIFO buffer module, and after the write pointer is incremented, D1 is written to the next TXFIFO buffer module, and so on.

[0113] Data is transferred from the TXFIFO to the SPI interface, which is responsible for sending the data to the peripheral according to the serial protocol. Data is read and sent by the SPI interface in the order written, starting from the first TXFIFO buffer module (the starting TXFIFO position is determined by the read fifo_idx of the TXFIFO). The peripheral can receive data through the SPI interface and use it to perform corresponding tasks or store it in internal memory.

[0114] The peripheral generates the data to be sent back to the controller and prepares it. The peripheral sends the data to the controller through the SPI interface, and the data first enters the RXFIFO buffer module. The data sent by the peripheral is written into the RXFIFO buffer module in sequence. The writing process is similar to the TXFIFO, starting from the first FIFO unit (the starting RXFIFO position is determined by the write fifo_idx of the RXFIFO) and automatically incremented according to the write pointer.

[0115] The controller reads data from the RXFIFO buffer module. The reading process starts from the first FIFO unit (the starting RXFIFO position is determined by the read fifo_idx of the RXFIFO), reads data in sequence according to the reading order, and increments according to the read pointer. For example, D0 is first read from the first RXFIFO unit, and after the read pointer is incremented, D1 is read from the next RXFIFO unit, and so on. The controller processes or stores the data received from the peripheral and performs subsequent operations as needed.

[0116] Please refer to Figure 5As shown, an embodiment of the present invention further provides an electronic device 500, which includes at least one processor 501, a memory 502 (for example, a non-volatile memory), a memory 503, and a communication interface 504, and the at least one processor 501, the memory 502, the memory 503, and the communication interface 504 are connected together via a bus 505. The at least one processor 501 is used to call at least one program instruction stored or encoded in the memory 502, so that the at least one processor 501 performs various operations and functions of the data transmission control method described in various embodiments of this specification.

[0117] In the embodiments of the present specification, the electronic device 500 may include, but is not limited to, personal computers, server computers, workstations, desktop computers, laptop computers, notebook computers, mobile electronic devices, smart phones, tablet computers, cellular phones, personal digital assistants (PDAs), handheld devices, messaging devices, wearable electronic devices, consumer electronic devices, and the like.

[0118] An embodiment of the present invention further provides a computer-readable medium carrying computer-executable instructions. When the computer-executable instructions are executed by a processor, they can be used to implement various operations and functions of the data transmission control method described in various embodiments of this specification.

[0119] The computer-readable medium in the present invention can be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium can be, for example, but not limited to, a system, device or component of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination of the above. More specific examples of computer-readable storage media can include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, a computer-readable storage medium can be any tangible medium containing or storing a program, which can be used by an instruction execution system, device or device or used in combination with it.

[0120] In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, device, or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.

[0121] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0122] The present invention is described with reference to flowcharts and / or block diagrams of methods, apparatuses, systems, and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as a combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the process in the flowchart. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0123] It will be apparent to those skilled in the art that the invention is not limited to the details of the exemplary embodiments described above and that the invention can be implemented in other specific forms without departing from the spirit or essential features of the invention. Therefore, the embodiments should be considered exemplary and non-limiting in all respects, and the scope of the invention is defined by the appended claims rather than the foregoing description, and it is intended that all variations falling within the meaning and scope of the equivalent elements of the claims be included in the invention. Any reference numeral in a claim should not be considered as limiting the claim to which it relates.

[0124] In addition, it should be understood that although the present specification is described according to implementation modes, not every implementation mode contains only one independent technical solution. This description of the specification is only for the sake of clarity. Those skilled in the art should regard the specification as a whole. The technical solutions in each embodiment may also be appropriately combined to form other implementation modes that can be understood by those skilled in the art.

Claims

1. A data transmission control method, characterized in that: include: Providing a plurality of groups of orderly arranged FIFO buffer modules, each group of the FIFO buffer modules comprising at least one FIFO buffer unit; According to the required data bit width of this data transmission, determine the pointer stride of the FIFO buffer module of this data transmission; According to the FIFO buffer module pointer stride and the starting FIFO position of the current data transmission, starting from the starting FIFO position, the data reading or writing operation is performed in the orderly arranged FIFO buffer modules in sequence; After completing the read or write operation of the current data transmission, the starting FIFO position of the next data transmission is updated according to the FIFO buffer module pointer stride of the current operation.

2. The data transmission control method according to claim 1, characterized in that: The control logic formula for performing data read or write operations in the orderly arranged FIFO buffer modules includes: Among them, wr_ctrl[N-1:0] represents the read and write signal array used to control the FIFO cache module, N represents the number of FIFO cache modules, fifo_idx represents the position index of the starting FIFO, and fifo_point_inc represents the pointer stride of the FIFO cache module.

3. The data transmission control method according to claim 1, characterized in that: According to the FIFO buffer module pointer stride of this operation, the formula for updating the starting FIFO position of the next data transmission includes: fifo_idx=(fifo_idx+fifo_point_inc)%N Wherein, fifo_idx represents the position index of the starting FIFO, fifo_point_inc represents the FIFO buffer module pointer stride, % represents the modulo operation, and N represents the number of FIFO buffer modules.

4. The data transmission control method according to claim 1, characterized in that: According to the required data bit width of this data transmission, the formula for determining the pointer stride of the FIFO buffer module for this data transmission includes: Among them, fifo_point_inc represents the pointer stride of the FIFO cache module, data_width represents the required data bit width of data transmission, and fifo_width represents the storage bit width of a single FIFO cache unit.

5. The data transmission control method according to claim 1, characterized in that: When the number of the orderly arranged FIFO buffer modules is 4 groups, the control logic formula for performing the data reading or writing operation in the orderly arranged FIFO buffer modules in sequence includes: fifo_idx[1:0]=fifo_idx[1:0]+fifo_point_inc Among them, wr_ctrl[3:0] represents the read and write signal array used to control the FIFO cache module, fifo_idx[1:0] represents the position index of the starting FIFO, and fifo_point_inc represents the pointer stride of the FIFO cache module.

6. A data transmission control system, characterized in that: include: A storage module, comprising a plurality of groups of FIFO cache modules arranged in order, each group of the FIFO cache modules comprising at least one FIFO cache unit; A determination module is used to determine the pointer stride of the FIFO buffer module of this data transmission according to the required data bit width of this data transmission; A read / write module, configured to perform a read or write operation on data in the orderly arranged FIFO buffer modules starting from the starting FIFO position according to the FIFO buffer module pointer stride and the starting FIFO position of the data transmission; The update module is used to update the starting FIFO position of the next data transmission according to the FIFO cache module pointer stride of this operation after completing the read or write operation of this data transmission.

7. A peripheral interface, characterized in that: It includes multiple groups of orderly arranged TXFIFO buffer modules; When the controller bus writes data to the peripheral interface, determining the write pointer stride of the TXFIFO buffer module according to the effective transmission bit width of the controller bus; According to the write pointer stride and the starting TXFIFO position of this write operation, starting from the starting TXFIFO position, the data write operation is performed in the orderly arranged TXFIFO buffer modules in sequence; After completing the current write operation, update the starting TXFIFO position of the next write operation according to the write pointer stride of the current write operation; and / or The peripheral interface includes a plurality of groups of orderly arranged RXFIFO buffer modules; When the controller bus reads data from the peripheral interface, determining the read pointer stride of the RXFIFO buffer module according to the effective transmission bit width of the controller bus; According to the read pointer stride and the starting RXFIFO position of this read operation, starting from the starting RXFIFO position, the data read operation is performed from the orderly arranged RXFIFO buffer modules in sequence; After completing this read operation, the starting RXFIFO position of the next read operation is updated according to the read pointer stride of this read operation.

8. A peripheral interface, characterized in that: It includes multiple groups of orderly arranged RXFIFO buffer modules; When the peripheral device writes data to the peripheral device interface, determining the write pointer stride of the RXFIFO buffer module according to the effective transmission bit width of the peripheral device; According to the write pointer stride and the starting RXFIFO position of this write operation, starting from the starting RXFIFO position, the write operation of data is performed in the orderly arranged RXFIFO buffer modules in sequence; After completing the current write operation, update the starting RXFIFO position of the next write operation according to the write pointer stride of the current write operation; and / or The peripheral interface includes a plurality of groups of orderly arranged TXFIFO buffer modules; When the peripheral device reads data from the peripheral device interface, determining the read pointer stride of the TXFIFO buffer module according to the effective transmission bit width of the peripheral device; According to the read pointer stride and the starting TXFIFO position of this read operation, starting from the starting TXFIFO position, sequentially performing a data read operation from the orderly arranged TXFIFO buffer modules; After completing this read operation, the starting TXFIFO position of the next read operation is updated according to the read pointer stride of this read operation.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the data transmission control method according to any one of claims 1 to 5 is implemented.

10. A computer-readable medium, characterized in that The computer-readable medium carries computer-executable instructions, and when the computer-executable instructions are executed by a processor, they are used to implement the data transmission control method according to any one of claims 1 to 5.

Citation Information

Cited By

  • Data processing system, method and device, electronic equipment and storage medium

    CN121301241A