Data processing method, controller, electronic equipment and readable storage medium

By setting a pre-read signal in the first-in-first-out storage system, the data in the memory is transmitted to the output register in advance, and directly read when the read enable signal is valid, the problem of high data transmission delay in the prior art is solved. Improve data processing efficiency.

CN119003401APending Publication Date: 2024-11-22SHENZHEN PANGO MICROSYST CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410951224.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-16
Publication Date
2024-11-22

AI Technical Summary

Technical Problem

The existing first-in-first-out memory has high delays during data transmission, resulting in low data processing efficiency.

Method used

By obtaining the status of the memory and output registers and the status of the read enable signal, the pre-read signal is set. When the preset condition is met, the target data in the memory is transmitted to the output register in advance, and directly from the read enable signal when the read enable signal is valid. Read data from the output register.

Benefits of technology

It reduces the delay of data transmission, improves the efficiency of data processing, and meets the needs of high-speed design for throughput and data processing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119003401A_ABST
    Figure CN119003401A_ABST
Patent Text Reader

Abstract

The invention discloses a data processing method, a controller, electronic equipment and a readable storage medium, and belongs to the technical field of data processing.The method comprises the steps that the state of a storage, the state of an output register and the state of a read enable signal are obtained; if it is detected that the state of the memory, the state of the output register and the state of the read enable signal meet preset conditions, setting a pre-read signal to be valid; under the condition that the pre-read signal is valid, transmitting target data corresponding to a read address in the memory to the output register; and under the condition that the read enable signal is valid, reading the target data from the output register. Compared with the existing non-pre-read FI FO, the time waiting for reading the data from the first-in first-out storage system is shorter, and the time delay of data transmission is reduced, so that the data processing efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and more specifically, to a data processing method, a controller, an electronic device and a readable storage medium. Background Art

[0002] In the design of Field-Programmable Gate Array (FPGA), First In, First Out (FIFO) memory is a high-frequency functional module. FIFO memory is often used in the buffering link of system design. It can cache continuous data streams to avoid data loss during bus operation. At the same time, it can reduce the burden of bus data transmission and improve transmission efficiency. However, the existing FIFO memory has a high delay in data transmission and low data processing efficiency. Summary of the invention

[0003] The present application proposes a data processing method, a controller, an electronic device and a readable storage medium to improve the above-mentioned defects.

[0004] In a first aspect, an embodiment of the present application provides a data processing method, which is applied to a controller of a first-in-first-out storage system, wherein the first-in-first-out storage system also includes a memory and an output register, and the method includes: obtaining the state of the memory, the state of the output register, and the state of a read enable signal; if it is detected that the state of the memory, the state of the output register, and the state of the read enable signal meet a preset condition, setting a pre-read signal to be valid; when the pre-read signal is valid, transferring the target data corresponding to the read address in the memory to the output register; when the read enable signal is valid, reading the target data from the output register.

[0005] Optionally, for a possible implementation, when the read enable signal is valid, after reading the target data from the output register, it also includes: modifying the read address to increase by one, and returning to execute acquisition of the state of the memory, the state of the output register, the state of the read enable signal, and subsequent operations.

[0006] Optionally, for a possible implementation, the state of the memory includes empty, partially occupied and fully loaded, the state of the output register includes empty, partially occupied and fully loaded, and if it is detected that the state of the memory, the state of the output register and the state of the read enable signal meet a preset condition, before setting the pre-read signal valid, it also includes: if it is detected that the state of the memory is partially occupied or fully loaded, and the state of the output register is empty or partially occupied, then it is determined that the state of the memory, the state of the output register and the state of the read enable signal meet the preset condition.

[0007] Optionally, for a possible implementation, the state of the memory includes empty, partially occupied and fully loaded, the state of the output register includes empty, partially occupied and fully loaded, and if it is detected that the state of the memory, the state of the output register and the state of the read enable signal meet a preset condition, before setting the pre-read signal to be valid, it also includes: if it is detected that the state of the memory is partially occupied or fully loaded, the state of the output register is fully loaded and the read enable signal is valid, then it is determined that the state of the memory, the state of the output register and the state of the read enable signal meet the preset condition.

[0008] Optionally, for a possible implementation, the state of the memory includes empty, partially occupied and fully loaded, the state of the output register includes empty, partially occupied and fully loaded, and if it is detected that the state of the memory, the state of the output register and the state of the read enable signal meet a preset condition, before setting the pre-read signal valid, it also includes: if it is detected that the state of the output register is fully loaded and the read enable signal is invalid, or the state of the memory is empty, then it is determined that the state of the memory, the state of the output register and the state of the read enable signal do not meet the preset condition.

[0009] Optionally, for a possible implementation, the output register includes a second register and at least one first register, and when the pre-read signal is valid, the target data corresponding to the read address in the memory is transferred to the output register, including: determining the target register according to the read address within the first clock cycle when the pre-read signal is valid, the target register being a first register for storing target data; transferring the target data corresponding to the read address in the memory to the target register; transferring the target data stored in the target register to the second register within the second clock cycle when the pre-read signal is valid; and reading the target data from the output register when the read enable signal is valid, including: reading the target data from the second register when the read enable signal is valid.

[0010] Optionally, for a possible implementation, determining the target register according to the read address within the first clock cycle in which the pre-read signal is valid includes: determining the target register according to the read address and the address range corresponding to each of the first registers within the first clock cycle in which the pre-read signal is valid.

[0011] In a second aspect, an embodiment of the present application further provides a controller, which is applied to a first-in-first-out storage system, wherein the first-in-first-out storage system also includes a memory and an output register, and the controller includes: an acquisition unit, which is used to obtain the state of the memory, the state of the output register and the state of a read enable signal; a detection unit, which is used to set a pre-read signal to be valid if it is detected that the state of the memory, the state of the output register and the state of the read enable signal meet a preset condition; a pre-read unit, which is used to transfer the target data corresponding to the read address in the memory to the output register when the pre-read signal is valid; and a reading unit, which is used to read the target data from the output register when the read enable signal is valid.

[0012] In a third aspect, an embodiment of the present application further provides an electronic device, comprising: one or more processors; a memory; and one or more applications, wherein the one or more applications are stored in the memory, the one or more applications are configured to be executed by the one or more processors, and the one or more applications are configured to execute the above method.

[0013] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, wherein the readable storage medium stores a program code executable by a processor, and when the program code is executed by the processor, the processor executes the above method.

[0014] The data processing method, controller, electronic device and readable storage medium provided by the present application first obtain the state of the memory, the state of the output register and the state of the read enable signal; if it is detected that the state of the memory, the state of the output register and the state of the read enable signal meet the preset conditions, set the pre-read signal to be valid; then, when the pre-read signal is valid, the target data corresponding to the read address in the memory is transferred to the output register; finally, when the read enable signal is valid, the target data is read from the output register.

[0015] A data processing method is provided in an embodiment of the present application. By setting a pre-read signal, target data is transferred from a memory to an output register in advance when the pre-read signal is valid. When a read enable signal is valid, the target data can be directly read from the output register. Compared with the existing non-pre-read FIFO, the present application has a shorter waiting time for reading data from a first-in, first-out storage system, reduces the delay of data transmission, and thus improves the efficiency of data processing.

[0016] Other features and advantages of the embodiments of the present application will be described in the subsequent description, and partly become apparent from the description, or can be understood by practicing the embodiments of the present application. The purpose and other advantages of the embodiments of the present application can be achieved and obtained by the structures specifically pointed out in the written description, claims, and drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.

[0018] Figure 1 A method flow chart of a data processing method provided by an embodiment of the present application is shown;

[0019] Figure 2 A method flow chart of a data processing method provided by another embodiment of the present application is shown;

[0020] Figure 3 A method flow chart of a data processing method provided by another embodiment of the present application is shown;

[0021] Figure 4 A method flow chart of a data processing method provided by another embodiment of the present application is shown;

[0022] Figure 5 A method flow chart of a data processing method provided by another embodiment of the present application is shown;

[0023] Figure 6 A method flow chart of a data processing method provided by another embodiment of the present application is shown;

[0024] Figure 7 The structure block diagram of the controller provided by the embodiment of the present application is shown;

[0025] Figure 8 A structural block diagram of an electronic device provided in an embodiment of the present application is shown;

[0026] Fig. 9 A structural block diagram of a first-in first-out storage system provided by an embodiment of the present application is shown;

[0027] Fig.10 A timing diagram of a first-in, first-out storage system provided by an embodiment of the present application is shown;

[0028] Fig.11 A structural block diagram of an output register provided in an embodiment of the present application is shown;

[0029] Fig.12 A structural block diagram of a computer-readable storage medium provided in an embodiment of the present application is shown. DETAILED DESCRIPTION

[0030] In order to make those skilled in the art better understand the present application scheme, the technical scheme in the present application embodiment will be clearly and completely described below in conjunction with the drawings in the present application embodiment. Obviously, the described embodiment is only a part of the present application embodiment, rather than all the embodiments. The components of the present application embodiment usually described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the present application for protection, but merely represents the selected embodiment of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.

[0031] It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings. At the same time, in the description of this application, the terms "first", "second", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.

[0032] In the design of Field-Programmable Gate Array (FPGA), First In, First Out (FIFO) memory is a high-frequency functional module. FIFO memory is often used in the buffering link of system design. It can cache continuous data streams to avoid data loss during bus operation, and at the same time reduce the burden of bus data transmission and improve transmission efficiency. However, the existing FIFO memory has a high delay in data transmission and low data processing efficiency.

[0033] Therefore, in an embodiment of the present application, a data processing method, a controller, an electronic device and a readable storage medium are provided to solve or partially solve the above-mentioned problems.

[0034] See also Figure 1 , which shows a method flow chart of a data processing method provided by an embodiment of the present application, wherein the method is applied to a controller of a first-in-first-out storage system, wherein the first-in-first-out storage system is used to cache data, wherein the first-in-first-out storage system also includes a memory and an output register, wherein the controller is connected to the memory and the output register respectively, wherein the memory is connected to the output register, and the controller can execute the following method to control the memory to transmit data to the output register, wherein the method specifically includes steps S110 to S140.

[0035] Step S110: Acquire the state of the memory, the state of the output register, and the state of the read enable signal.

[0036] It should be noted that the state of the memory is used to indicate the amount of data stored in the memory. The state of the memory may include empty, partially occupied, and fully loaded. The state of the memory may be obtained through methods such as a status register or a pointer.

[0037] In one implementation, the first-in-first-out storage system further includes a status register, and the status register can represent the status of the storage.

[0038] Exemplarily, the status register may include an idle flag and a full flag. An idle flag of 1 indicates that the memory is empty, and an idle flag of 0 indicates that the memory is not empty. A full flag of 1 indicates that the memory is full, and a full flag of 0 indicates that the memory is not full. The state of the memory may be obtained in combination with the idle flag and the full flag. For example, when the idle flag is detected to be 0 and the full flag is 1, the state of the memory is "full", when the idle flag is detected to be 1 and the full flag is 0, the state of the memory is "empty", and when the idle flag is detected to be 0 and the full flag is 0, the state of the memory is "partially occupied".

[0039] In one implementation, the state of the memory may be determined by monitoring the positions of the read pointer and the write pointer.

[0040] Specifically, the read pointer indicates the address bit of the next read operation, and the write pointer indicates the address bit of the next write operation. By comparing the address bits pointed to by the two pointers, the amount of data stored in the memory can be calculated, that is, the state of the memory can be obtained.

[0041] Exemplarily, the address bits of the memory include 2000 in total, indicating that 2000 data can be stored. It is detected that the address bit pointed to by the read pointer is 16, and the address bit pointed to by the write pointer is 116. It can be known that the address bits from 16 to 115 in the current memory store data. Therefore, the amount of data stored in the memory can be calculated as 100 by the address bits pointed to by the read pointer and the address bits pointed to by the write pointer. Then 100 is compared with 0 and 2000 respectively, and it is judged that the state of the memory is "partially occupied". If the data stored in the memory is 0, the state of the memory is represented as "empty". If the data stored in the memory is 2000, the state of the memory is represented as "full". Among them, the bit width of each data can be 1 bit, 4 bits, 10 bits, etc., and the bit width of each data can be selected according to the actual situation, and is not specifically limited here.

[0042] Furthermore, the memory may be a readable and writable memory, and exemplarily, the memory may be a random access memory (RAM).

[0043] It should be noted that the output register can be composed of at least one trigger, and the trigger temporarily stores data to achieve the effect of caching data. The trigger can be one or more of a D trigger, a JK trigger, a T trigger, and an SR trigger, and the type of the trigger is not specifically limited here.

[0044] Specifically, the status of the output register includes empty, partially occupied and fully loaded, and the status of the output register can be obtained through the status register, which is similar to the principle of obtaining the status of the memory through the status register mentioned above, and will not be repeated here.

[0045] It should be noted that the state of the read enable signal includes valid and invalid. If the controller detects that the read enable signal is valid, the process of reading data is entered. If the controller detects that the read enable signal is invalid, the process of reading data is not entered. Setting the validity or invalidity of the read enable signal can be triggered by the user or by other modules connected to the first-in-first-out storage system.

[0046] Step S120: If it is detected that the state of the memory, the state of the output register and the state of the read enable signal meet a preset condition, the pre-read signal is set to be valid.

[0047] After obtaining the state of the memory, the state of the output register, and the state of the read enable signal, it is necessary to determine whether the preset conditions are met based on the obtained data. If the preset conditions are met, it means that the pre-reading conditions are currently met and pre-reading can be performed, and the pre-reading signal is set to be valid. If the preset conditions are not met, it means that the pre-reading conditions are not currently met and pre-reading cannot be performed, and the pre-reading signal is set to be invalid.

[0048] Determine whether the state of the memory, the state of the output register, and the state of the read enable signal meet the preset conditions. Specifically, when the memory is empty, no data can be transferred from the memory to the output register at this time, and the preset conditions are not met; when the output register is fully loaded and the read enable signal is invalid, it means that the output register is already full of data and can no longer accept data transmitted from the memory, and the preset conditions are not met. When the memory is not empty, the output register is not full, and data can be transferred from the memory to the output register, the preset conditions are met; when the memory is not empty, the output register bit is full and the read enable signal is valid, and data can be transferred from the memory to the output register, and the preset conditions are met. For details, please refer to the subsequent embodiments.

[0049] Step S130: when the pre-read signal is valid, the target data corresponding to the read address in the memory is transferred to the output register.

[0050] When it is detected that the pre-read signal is valid, the target data corresponding to the read address in the memory can be transferred to the output register in the current clock cycle when the pre-read signal is valid, that is, the pre-reading of data is realized.

[0051] It should be noted that edge detection or threshold detection may be used to detect whether the pre-read signal is valid.

[0052] In an optional embodiment, edge detection may be used to determine whether the pre-read signal is valid. Edge detection includes rising edge detection and falling edge detection. The logic of rising edge detection and falling edge detection are similar.

[0053] Exemplarily, the rising edge is used to detect whether the pre-read signal is valid. When the pre-read signal is detected as a high level at the rising edge, it indicates that the pre-read signal is valid in the current clock cycle. When the pre-read signal is detected as a low level at the rising edge, it indicates that the pre-read signal is invalid in the current clock cycle.

[0054] In an optional embodiment, a threshold value may be used to detect whether the pre-read signal is valid, and whether the pre-read signal is valid is determined by comparing the voltage value of the pre-read signal with a preset threshold value.

[0055] Exemplarily, the voltage signal value of the current pre-read signal is obtained as A, and the threshold signal is B. When A exceeds B, it indicates that the current pre-read signal is valid, otherwise it indicates that the pre-read signal is invalid.

[0056] It should be noted that the target data can be transferred to the output register by memory mapping, port mapping, direct memory access or interrupt driven transmission. Existing technology is used here, and the method of transferring the target data to the output register is not specifically limited.

[0057] The target data is the data that needs to be read. Since the present application is applied to a first-in-first-out storage system, the read address can be obtained according to the read pointer. The bit width of the target data can be 1 bit, 2 bits or 4 bits, etc. Different bit widths can be selected according to actual conditions, and no specific limitation is made here.

[0058] It should be noted that after the target data corresponding to the read address in the memory is transferred to the output register, the state of the memory, the state of the output register and the state of the read enable signal will continue to be detected to see whether they meet the preset conditions. If the preset conditions are not met, the pre-read signal is set from valid to invalid. If the preset conditions are met, the pre-read signal is set to remain valid.

[0059] Step S140: when the read enable signal is valid, reading the target data from the output register.

[0060] Since the target data has been stored in the output register, when it is detected that the read enable signal is valid, the target data can be directly read from the output register in the current clock cycle in which the read enable signal is valid.

[0061] It should be noted that edge detection or threshold detection can be used to detect whether the read enable signal is valid. The principle of detecting the read enable signal is similar to the principle of detecting the pre-read signal. Please refer to the above content for details.

[0062] Exemplarily, the controller first obtains the state of the memory, the state of the output register, and the state of the read enable signal, and then determines whether the preset conditions are met based on the obtained data. If the preset conditions are met, the pre-read signal is set to be valid. Then, when the pre-read signal is valid, the target data corresponding to the read address in the memory is transferred to the output register. When the read enable signal is valid, the target data can be read directly from the output register.

[0063] It should be noted that the present application can be used in FPGA systems as well as in other computer systems.

[0064] For the existing non-pre-read FIFO, the non-pre-read FIFO needs to transfer the target data from the memory to the output register in the current clock cycle when the read enable signal is valid, and the data can be read from the output register after the next clock cycle or even more clock cycles when the read enable signal is valid.

[0065] A data processing method is provided in an embodiment of the present application. By setting a pre-read signal, data is transmitted from the memory to the output register in advance through the effective pre-read signal trigger. When the read enable signal is valid, data can be read from the output register in the current clock cycle when the read enable signal is valid. Compared with the existing non-pre-read FIFO, the present application has a shorter waiting time for reading data from the first-in-first-out storage system, reduces the delay of data transmission, thereby improving the efficiency of data processing and meeting the requirements of high-speed design for throughput and data processing efficiency.

[0066] See also Figure 2 , which shows a method flow chart of a data processing method provided in an embodiment of the present application, the method is applied to a controller of a first-in-first-out storage system, the first-in-first-out storage system also includes a memory and an output register, the controller can execute the following method to control the memory to transmit data to the output register, the method specifically includes steps S210 to S250.

[0067] Step S210: Acquire the state of the memory, the state of the output register, and the state of the read enable signal.

[0068] Step S220: If it is detected that the state of the memory, the state of the output register, and the state of the read enable signal meet a preset condition, the pre-read signal is set to be valid.

[0069] Step S230: when the pre-read signal is valid, the target data corresponding to the read address in the memory is transferred to the output register.

[0070] Step S240: when the read enable signal is valid, read the target data from the output register.

[0071] Among them, step S210 and step S240 have been introduced in detail in the above embodiments and will not be repeated here.

[0072] Step S250: modify the read address to increase by one, and return to execute acquisition of the state of the memory, the state of the output register, the state of the read enable signal, and subsequent operations.

[0073] It should be noted that after the target data in the memory is transferred to the output register, the read address is modified to increase by one, that is, the read address is updated. The data corresponding to the updated read address is the next target data that needs to be transferred to the output register. For this reason, the read address is modified to increase by one after step S230.

[0074] Exemplarily, the read address is 201 , and the updated read address is 202 .

[0075] After the target data is read from the output register, the state of the memory, the state of the output register, the state of the read enable signal and subsequent operations are returned to be executed. If the pre-read signal is detected to be valid, the target data corresponding to the updated read address in the memory is continuously transferred to the output register. If the pre-read signal is detected to be invalid, the state of the memory, the state of the output register and the state of the read enable signal are continuously acquired.

[0076] An exemplary method is to first obtain the state of the memory, the state of the output register, and the state of the read enable signal. If it is detected that the obtained data meets the preset conditions, the pre-read signal is set to be valid. When the pre-read signal is valid, after the first target data in the memory is transferred to the output register, the first target data stored in the output register is read out in the first clock cycle when the read enable signal is valid, and then the read address is modified to increase by one, and the execution of obtaining the state of the memory, the state of the output register, and the state of the read enable signal is returned. The second target data in the memory is transferred to the output register in the current clock cycle when the pre-read signal is valid, that is, the first target data can be read from the output register in the first clock cycle when the read enable signal is valid, and then the second target data can be transferred from the memory to the output register. If the read enable signal is still valid in the second clock cycle, the second target data can be read from the output register in the second clock cycle, so that the function of continuous pre-reading can be realized.

[0077] For the existing pre-reading FIFO method, although the pre-reading FIFO can also realize the pre-reading function, this method does not rely on the clock signal, and the logic of pre-reading data from the memory is relatively complex and time-consuming. The critical path of outputting data to the subsequent combinational logic of this method is long and the delay is long. In an environment with a high clock frequency, it often faces the problem of difficult timing convergence, which increases the uncertainty of the system.

[0078] The present application provides a data processing method, which can interrupt the critical path from the output of a first-in-first-out storage system to the subsequent combinational logic through an output register. That is, the timing of the output data of the first-in-first-out storage system is known, which can reduce the timing delay on the path, improve the determinism of the system, and meet the timing requirements when the system clock frequency is high and the subsequent combinational logic is more complex.

[0079] See also Figure 3 , which shows a method flow chart of a data processing method provided in an embodiment of the present application, the method is applied to a controller of a first-in-first-out storage system, the first-in-first-out storage system also includes a memory and an output register, the controller can execute the following method to control the memory to transmit data to the output register, the method specifically includes steps S310 to S350.

[0080] Step S310: Acquire the state of the memory, the state of the output register, and the state of the read enable signal.

[0081] Furthermore, the state of the memory includes empty, partially occupied and fully loaded, and the state of the output register includes empty, partially occupied and fully loaded.

[0082] Step S320: If it is detected that the state of the memory is partially occupied or fully loaded, and the state of the output register is empty or partially occupied, it is determined that the state of the memory, the state of the output register and the state of the read enable signal meet a preset condition.

[0083] If the memory status is partially occupied or fully loaded, it means that the memory is not empty, and the output register status is empty or partially occupied, which means that the output register is not fully loaded. When the memory is not empty and the output register is not fully loaded, it means that data can be read from the memory and transferred to the output register, and the preset condition is met. The pre-read signal can be set to be valid.

[0084] Step S330: If it is detected that the state of the memory, the state of the output register and the state of the read enable signal meet a preset condition, the pre-read signal is set to be valid.

[0085] Step S340: when the pre-read signal is valid, the target data corresponding to the read address in the memory is transferred to the output register.

[0086] Step S350: when the read enable signal is valid, read the target data from the output register.

[0087] Among them, step S330 and step S350 have been introduced in detail in the above embodiments and will not be repeated here.

[0088] See also Figure 4 , which shows a method flow chart of a data processing method provided in an embodiment of the present application, the method is applied to a controller of a first-in-first-out storage system, the first-in-first-out storage system also includes a memory and an output register, the controller can execute the following method to control the memory to transmit data to the output register, the method specifically includes steps S410 to S450.

[0089] Step S410: Acquire the state of the memory, the state of the output register, and the state of the read enable signal.

[0090] Furthermore, the state of the memory includes empty, partially occupied and fully loaded, and the state of the output register includes empty, partially occupied and fully loaded.

[0091] Step S420: If it is detected that the state of the memory is partially occupied or fully loaded, the state of the output register is fully loaded and the read enable signal is valid, it is determined that the state of the memory, the state of the output register and the state of the read enable signal meet preset conditions.

[0092] If the memory status is partially occupied or fully loaded, it means that the memory is not empty, and the output register status is fully loaded, which means that there is no remaining space in the output register to store new data. The read enable signal is valid, which means that data will be read from the output register in the current clock cycle. Therefore, when the memory is not empty, the output register is fully loaded, and the read enable signal is valid, it means that data can be read from the memory and transferred to the output register, then the preset conditions are met, and the pre-read signal can be set to be valid.

[0093] Step S430: If it is detected that the state of the memory, the state of the output register and the state of the read enable signal meet a preset condition, the pre-read signal is set to be valid.

[0094] Step S440: when the pre-read signal is valid, the target data corresponding to the read address in the memory is transferred to the output register.

[0095] Step S450: when the read enable signal is valid, read the target data from the output register.

[0096] Among them, step S430 and step S450 have been introduced in detail in the above embodiments and will not be repeated here.

[0097] See also Figure 5, which shows a method flow chart of a data processing method provided in an embodiment of the present application, the method is applied to a controller of a first-in-first-out storage system, the first-in-first-out storage system also includes a memory and an output register, the controller can execute the following method to control the memory to transmit data to the output register, the method specifically includes steps S510 to S550.

[0098] Step S510: Acquire the state of the memory, the state of the output register, and the state of the read enable signal.

[0099] Furthermore, the state of the memory includes empty, partially occupied and fully loaded, and the state of the output register includes empty, partially occupied and fully loaded.

[0100] Step S520: If it is detected that the state of the output register is fully loaded and the read enable signal is invalid, or the state of the memory is empty, it is determined that the state of the memory, the state of the output register and the state of the read enable signal do not meet a preset condition.

[0101] If the output register is fully loaded, it means that there is no remaining space in the output register to store new data, and the read enable signal is invalid, which means that data will not be read from the output register in the current clock cycle. Therefore, when the output register is fully loaded and the read enable signal is invalid, data cannot be read from the memory and transferred to the output register, and the preset condition is not met.

[0102] If the state of the memory is empty, it means that there is no data stored in the memory, which means that the data cannot be read from the memory and transmitted to the output register, and the preset condition is not met.

[0103] Step S530: If it is detected that the state of the memory, the state of the output register and the state of the read enable signal meet a preset condition, the pre-read signal is set to be valid.

[0104] Step S540: when the pre-read signal is valid, the target data corresponding to the read address in the memory is transferred to the output register.

[0105] Step S550: when the read enable signal is valid, read the target data from the output register.

[0106] Among them, step S530 and step S550 have been introduced in detail in the above embodiments and will not be repeated here.

[0107] In an exemplary embodiment, two target data are stored in the memory, and the state of the memory, the state of the output register, and the state of the read enable signal are first obtained. If the detection result is that the state of the memory is partially occupied and the state of the output register is empty, it is determined that the state of the memory, the state of the output register, and the state of the read enable signal meet the preset conditions. The pre-read signal is set to be valid. When the pre-read signal is valid, the first target data corresponding to the read address in the memory is transferred to the output register. At this time, the detection result is that the state of the memory is partially occupied, and the state of the output register is fully loaded.

[0108] If the read enable signal is detected to be invalid, the first target data is not read from the output register, and the data status on the memory and the output register will not change.

[0109] If the read enable signal is detected to be valid, the first target data is read from the output register. At this time, if the state of the memory is detected to be partially occupied and the state of the output register is empty, it is determined that the state of the memory, the state of the output register and the state of the read enable signal meet the preset conditions. The pre-read signal is set to be valid. When the pre-read signal is valid, the second target data corresponding to the read address in the memory is transferred to the output register.

[0110] It should be noted that, in the same clock cycle, when the read enable signal and the pre-read signal are valid, the memory is partially occupied, and the output register is fully loaded, two actions, namely, reading the first target data from the output register and transferring the second target data in the memory to the output register, can be performed in the clock cycle.

[0111] When the read enable signal is detected to be valid, the second target data is read from the output register.

[0112] At this time, there is no target data in the memory, and it is detected that the state of the memory is empty, and the state of the output register is empty, then it is determined that the state of the memory, the state of the output register, and the state of the read enable signal do not meet the preset conditions. The pre-read signal is set to be invalid, and the target data corresponding to the read address in the memory is transferred to the output register until the pre-read signal is valid.

[0113] See also Figure 6, which shows a method flow chart of a data processing method provided by an embodiment of the present application, the method is applied to a controller of a first-in-first-out storage system, the first-in-first-out storage system also includes a memory and an output register, the output register includes a second register and at least one first register, each memory is connected to a corresponding first register, and each first register is connected to a second register, the controller can execute the following method to control the memory to transmit data to the output register, the method specifically includes steps S610 to S660.

[0114] Step S610: Acquire the state of the memory, the state of the output register, and the state of the read enable signal.

[0115] Step S620: If it is detected that the state of the memory, the state of the output register and the state of the read enable signal meet a preset condition, set the pre-read signal to be valid.

[0116] Among them, step S610 and step S620 have been introduced in detail in the above embodiments and will not be repeated here.

[0117] Step S630: determining a target register according to a read address within a first clock cycle in which the pre-read signal is valid, wherein the target register is a first register for storing target data.

[0118] In the first clock cycle when the pre-read signal is valid, a target register is determined according to the read address, and the target register is a first register for storing target data.

[0119] Furthermore, the target register may be determined according to the read address and the address range corresponding to each of the first registers.

[0120] In an exemplary embodiment, when too much data needs to be stored, multiple memories are used to store the data together, each memory stores a portion of the data, the read addresses of the multiple memories are continuous, and each memory is connected to its corresponding first register. When data needs to be pre-read, the target register is determined based on the read address and the address range corresponding to each of the first registers.

[0121] Step S640: transferring the target data corresponding to the read address in the memory to the target register.

[0122] After the target register is determined, it is determined to transfer the target data in the memory to the target register.

[0123] Step S650: transferring the target data stored in the target register to the second register in the second clock cycle when the pre-read signal is valid.

[0124] In the second clock cycle when the pre-read signal is valid, the target data stored in the target register is transferred to the second register, so that the target data can be directly read from the second register.

[0125] Step S660: when the read enable signal is valid, read the target data from the second register.

[0126] After the target data has been transferred to the second register, when the read enable signal is valid, the target data is read directly from the second register without reading the data from the memory. The present application can realize pre-reading of the target data, reduce the delay of data output, and improve the efficiency of data processing.

[0127] See also Figure 7 , which shows a structural block diagram of a controller 600 provided in an embodiment of the present application. The controller 600 includes: a collection unit 610, a detection unit 620, a pre-reading unit 630 and a reading unit 640.

[0128] The acquisition unit 610 is used to obtain the state of the memory, the state of the output register and the state of the read enable signal.

[0129] The detection unit 620 is used to set the pre-read signal to be valid if it is detected that the state of the memory, the state of the output register and the state of the read enable signal meet a preset condition.

[0130] Optionally, for a possible implementation, the detection unit 620 can also be used to determine whether the state of the memory, the state of the output register, and the state of the read enable signal meet preset conditions if it is detected that the state of the memory is partially occupied or fully loaded, and the state of the output register is empty or partially occupied.

[0131] Optionally, for a possible implementation, the detection unit 620 can also be used to determine that the state of the memory, the state of the output register, and the state of the read enable signal meet preset conditions if it is detected that the state of the memory is partially occupied or fully loaded, the state of the output register is fully loaded, and the read enable signal is valid.

[0132] Optionally, for a possible implementation, the detection unit 620 can also be used to determine that the state of the memory, the state of the output register, and the state of the read enable signal do not meet preset conditions if it is detected that the state of the output register is fully loaded and the read enable signal is invalid, or the state of the memory is empty.

[0133] The pre-reading unit 630 is used to transfer the target data corresponding to the read address in the memory to the output register when the pre-reading signal is valid.

[0134] Optionally, for a possible implementation, the pre-read unit 630 can also be used to determine a target register according to a read address within a first clock cycle in which the pre-read signal is valid, the target register being a first register for storing target data; transferring the target data corresponding to the read address in the memory to the target register; and transferring the target data stored in the target register to a second register within a second clock cycle in which the pre-read signal is valid.

[0135] Optionally, for a possible implementation, the pre-read unit 630 may also be configured to determine a target register according to a read address and an address range corresponding to each of the first registers within a first clock cycle in which the pre-read signal is valid.

[0136] The reading unit 640 is configured to read the target data from the output register when the read enable signal is valid.

[0137] Optionally, for a possible implementation, the read unit 640 may also be used to modify the read address to increase by one, and return to execute acquisition of the state of the memory, the state of the output register, and the state of the read enable signal and subsequent operations.

[0138] Optionally, in a possible implementation manner, the reading unit 640 may also be configured to read the target data from the second register when the read enable signal is valid.

[0139] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described devices and units can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here.

[0140] In several embodiments provided in the present application, the coupling between the units may be electrical, mechanical or other forms of coupling. In addition, each functional unit in each embodiment of the present application may be integrated into a processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0141] See also Figure 8, which shows a structural block diagram of an electronic device 700 provided in an embodiment of the present application. The electronic device 700 may be a storage system, which may be set in a PFGA. The electronic device 700 in the present application may include one or more of the following components: a processor 711, a memory 712, and one or more application programs, wherein the processor 711 is electrically connected to the memory 712, and the one or more program configurations are used to execute the methods described in the various embodiments of the aforementioned test method.

[0142] The processor 711 may include one or more processing cores. The processor 711 uses various interfaces and lines to connect various parts of the entire electronic device 700, and executes various functions and processes data of the electronic device 700 by running or executing instructions, programs, code sets or instruction sets stored in the memory 712, and calling data stored in the memory 712. Optionally, the processor 711 can be implemented in at least one hardware form of digital signal processing (DSP), field programmable gate array (FPGA), and programmable logic array (PLA). The processor 711 can integrate one or a combination of a central processing unit (CPU), a graphics processor (GPU), and a modem. Among them, the CPU mainly processes the operating system, user interface, and computer programs; the GPU is responsible for rendering and drawing display content; and the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor 711, but may be implemented separately through a communication chip. Specifically, the method described in the above embodiments may be executed by one or more processors 711 .

[0143] For some embodiments, the memory 712 may include a random access memory (RAM) or a read-only memory (ROM). The memory 712 may be used to store instructions, programs, codes, code sets, or instruction sets. The memory 712 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for implementing at least one function, instructions for implementing the following various method embodiments, etc. The data storage area may also store data created by the electronic device 700 during use, etc.

[0144] See also Fig. 9, which shows a structural block diagram of a first-in-first-out storage system 800 provided by an embodiment of the present application. It includes a controller 710, an input register 720, a memory 730, a shift register 740, a first-level output register 750 and a second-level output register 760. The controller 710 is respectively connected to the input register 720, the memory 730, the shift register 740, the first-level output register 750 and the second-level output register 760. The shift register 740 is respectively connected to the memory 730, the first-level output register 750 and the second-level output register 760. The memory 730 is respectively connected to the input register 720 and the first-level output register 750. The first-level output register 750 is connected to the second-level output register 760.

[0145] When the controller receives the write enable signal wr_en and the write data wr_data, the controller 710 transmits the write address wr_addr to the memory 730 through the input register 720, and writes the write data wr_data into the location pointed to by the write address wr_addr in the memory.

[0146] The controller 710 can send the empty signal empty and the full signal full of the memory 730 to the external device, detect the pre-read signal rd_en_preout by the method of the present application, and transmit the pre-read signal rd_en_preout to the memory 730 through the input register 720. When the pre-read signal is valid, the controller 740 transmits the read address rd_addr to the memory 730 through the input register 720, reads the target data from the memory 730 according to the read address rd_addr and sends it to the first-level output register 750, and then when the secondary transfer signal outreg sent by the shift register 740 is valid, the target data stored in the first-level output register 750 is transmitted to the second-level output register 760. At this time, the preparation of the target data is completed, and the valid flag signal data_valid is pulled high.

[0147] When the shift register 740 receives the read enable signal rd_en, the target data rd_data can be directly read from the second-stage output register 760 .

[0148] See also Fig.10 , which shows the timing diagram of the first-in first-out storage system 800 proposed in this embodiment. Specifically, using the rising edge timing clk detection, the bit width of the state value shift_reg of the shift register 740 is 3, and the initial value of the shift register 740 is set to 3'b001. When the write enable signal wr_en is valid, the controller 710 stores the write data wr_data in the memory 730, and pulls down the empty signal empty at the same time, indicating that the memory 730 has stored data at this time.

[0149] When empty is low and the high bit of the shift register 740 is 0, a pre-read signal rd_en_preout is generated. When the pre-read signal rd_en_preout is valid, the data stored in the memory 730 is output to the first-stage output register 750, and the shift register is shifted left by one bit. At this time, the value of the shift register is 3'b010. In the next clock cycle when rd_en_preout is valid, if the value of the shift register is equal to 3'b010, the shift register 740 generates a secondary transfer signal outreg. When the secondary transfer signal outreg is valid, the data on the first-stage output register 750 is output to the second-stage output register 760, and the output data valid signal data_val id is pulled high, indicating that there is valid data on the bus at this time, thus completing the pre-reading of the first data stored in the memory 730.

[0150] If empty is still low after the first data in memory 730 is pre-read (there is still remaining data in memory 730), rd_en_preout is still valid, and the second data in memory 730 is output to the first-level output register, and the shift register is shifted left by one bit. At this time, the value of the shift register is 3'b100, indicating that there is valid data in both levels of output registers. When the high bit of shift register 740 is 1, pre-reading is no longer continued.

[0151] When the external read enable signal rd_en is valid, the data on the bus can be read in the current clock cycle. If the high bit of the shift register 740 is 1 at this time, outreg will be generated, and the next data will be output from the first-level output register to the second-level output register in the next clock cycle; if empty is low, rd_en_preout will be generated, and the next data will be output from the memory 730 to the first-level output register in the next clock cycle.

[0152] If empty is high when the external read enable signal rd_en is valid, it means that there is no remaining data in the memory 730, and only the two-stage output register has remaining data. At this time, rd_en_preout will not be generated, and the shift register will be shifted right by one bit. At this time, the value of the shift register is 3'b010.

[0153] If the high bit of the shift register is 0 when the external read enable signal rd_en is valid, it means that there is no remaining data on the first-level output register and the second-level output register has the last data. At this time, outreg will not be generated, and the shift register will be shifted right by one bit to restore the value of the shift register to the initial value 3'b001.

[0154] When there is too much data to be stored, multiple memories are used to store the data together, each memory stores a portion of the data, the read addresses of the multiple memories are continuous, and each memory is connected to its corresponding first register. When data needs to be pre-read, the target register is determined based on the read address and the address range corresponding to each of the first registers.

[0155] See also Fig.11 , which shows a schematic diagram of the structure of the output register 900 proposed in this embodiment, wherein data is read from two RAMs, at least one of the first-level output registers is selected as the target register according to the read address, and then the target data in the target register is transferred to the second-level output register.

[0156] See also Fig.12 , which shows a structural block diagram of a computer-readable storage medium provided in an embodiment of the present application. The computer-readable medium 1000 stores program codes, which can be called by a processor to execute the method described in the above method embodiment.

[0157] The computer readable storage medium 1000 can be an electronic memory such as a flash memory, an EEPROM (electrically erasable programmable read-only memory), an EPROM, a hard disk, or a ROM. Optionally, the computer readable storage medium 1000 includes a non-transitory computer-readable storage medium. The computer readable storage medium 1000 has storage space for program code 1010 that executes any method step in the above method. These program codes can be read from or written to one or more computer program products. The program code 1010 can be compressed, for example, in an appropriate form.

[0158] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A data processing method, characterized in that: The method is applied to a controller of a first-in-first-out storage system, wherein the first-in-first-out storage system further includes a memory and an output register, and the method includes: Acquire the state of the memory, the state of the output register, and the state of a read enable signal; If it is detected that the state of the memory, the state of the output register and the state of the read enable signal meet a preset condition, setting the pre-read signal to be valid; When the pre-read signal is valid, the target data corresponding to the read address in the memory is transferred to the output register; When the read enable signal is valid, the target data is read from the output register.

2. The method according to claim 1, characterized in that In the case where the read enable signal is valid, after reading the target data from the output register, the method further includes: The read address is modified to increase by one, and the state of the memory, the state of the output register, and the state of the read enable signal and subsequent operations are obtained by returning.

3. The method according to claim 1, characterized in that: The state of the memory includes empty, partially occupied and fully loaded, the state of the output register includes empty, partially occupied and fully loaded, and if it is detected that the state of the memory, the state of the output register and the state of the read enable signal meet a preset condition, before setting the pre-read signal valid, the method further includes: If it is detected that the state of the memory is partially occupied or fully loaded, and the state of the output register is empty or partially occupied, it is determined that the state of the memory, the state of the output register and the state of the read enable signal meet a preset condition.

4. The method according to claim 1, characterized in that The state of the memory includes empty, partially occupied and fully loaded, the state of the output register includes empty, partially occupied and fully loaded, and if it is detected that the state of the memory, the state of the output register and the state of the read enable signal meet a preset condition, before setting the pre-read signal valid, the method further includes: If it is detected that the state of the memory is partially occupied or fully loaded, the state of the output register is fully loaded and the read enable signal is valid, it is determined that the state of the memory, the state of the output register and the state of the read enable signal meet preset conditions.

5. The method according to claim 1, characterized in that The state of the memory includes empty, partially occupied and fully loaded, the state of the output register includes empty, partially occupied and fully loaded, and if it is detected that the state of the memory, the state of the output register and the state of the read enable signal meet a preset condition, before setting the pre-read signal valid, the method further includes: If it is detected that the state of the output register is full and the read enable signal is invalid, or the state of the memory is empty, it is determined that the state of the memory, the state of the output register and the state of the read enable signal do not meet a preset condition.

6. The method according to claim 1, characterized in that The output register includes a second register and at least one first register, and when the pre-read signal is valid, the target data corresponding to the read address in the memory is transferred to the output register, including: Determine a target register according to a read address in a first clock cycle in which the pre-read signal is valid, wherein the target register is a first register for storing target data; Transferring the target data corresponding to the read address in the memory to the target register; Transferring the target data stored in the target register to a second register in a second clock cycle in which the pre-read signal is valid; The step of reading the target data from the output register when the read enable signal is valid includes: When the read enable signal is valid, the target data is read from the second register.

7. The method according to claim 6, characterized in that Determining the target register according to the read address in the first clock cycle in which the pre-read signal is valid includes: In the first clock cycle in which the pre-read signal is valid, a target register is determined according to a read address and an address range corresponding to each of the first registers.

8. A controller, characterized in that: The controller is applied to a first-in first-out storage system, the first-in first-out storage system further includes a memory and an output register, and the controller includes: A collection unit, used to obtain the state of the memory, the state of the output register and the state of the read enable signal; a detection unit, configured to set a pre-read signal to be valid if it is detected that the state of the memory, the state of the output register, and the state of the read enable signal meet a preset condition; A pre-reading unit, configured to transfer target data corresponding to a read address in the memory to the output register when the pre-reading signal is valid; A reading unit is used to read the target data from the output register when the read enable signal is valid.

9. An electronic device, characterized in that: include: one or more processors; Memory; One or more applications, wherein the one or more applications are stored in the memory, the one or more applications are configured to be executed by the one or more processors, and the one or more applications are configured to execute the method according to any one of claims 1-7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores program codes, which can be called by a processor to execute the method according to any one of claims 1 to 7.