Asynchronous fifo for displaying data storage amount and method for displaying data storage amount

CN114741267BActive Publication Date: 2026-09-11PEKING UNIV
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210195670.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-01
Publication Date
2026-09-11
Estimated Expiration
2042-03-01

AI Technical Summary

Technical Problem

[0004]本发明提供一种显示数据存储量的异步FIFO及数据存储量显示方法,用以解决现有技术中现有的异步FIFO在显示空满标志时留有余量导致虚空虚满的缺陷

Benefits of technology

[0025]本发明提供的显示数据存储量的异步FIFO及数据存储量显示方法,读写控制模块基于当前存储状态生成读状态信号和/或写状态信号,存储模块基于读状态信号和/或写状态信号,更新当前读地址值和/或当前写地址值,从而存储量控制模块能够基于当前读地址值和当前写地址值,更新并显示当前数据存储量,避免传统方法中异步FIFO在显示空满标志时留有余量导致虚空虚满,进而降低读写可操作空间的问题。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114741267B_ABST
    Figure CN114741267B_ABST
Patent Text Reader

Abstract

The application provides an asynchronous FIFO for displaying data storage capacity and a data storage capacity display method. The asynchronous FIFO comprises a storage module, a read-write control module and a storage capacity control module. The read-write control module is used for determining a current storage state based on a current data storage capacity when a read enable signal and / or a write enable signal is detected, and generating a read state signal and / or a write state signal based on the current storage state. The storage module is used for updating a current read address value and / or a current write address value based on the read state signal and / or the write state signal. The storage capacity control module is used for updating and displaying the current data storage capacity based on the current read address value and the current write address value. The application can display the current data storage capacity of the FIFO in real time, avoid the problem of virtual empty and full caused by the remaining capacity of the asynchronous FIFO in the display of the empty-full flag in the traditional method, and further reduce the read-write operation space.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data processing technology, and in particular to an asynchronous FIFO for displaying data storage volume and a method for displaying data storage volume. Background Technology

[0002] When transferring data across clock domains, direct data transmission can lead to metastability and data transmission errors. Currently, asynchronous FIFO (first in first out) is often used to transfer data across clock domains.

[0003] Current asynchronous FIFOs only display empty / full flags on top of normal read / write functions. However, in certain continuous read or write operations, the empty / full flags displayed by the asynchronous FIFO have a certain margin, resulting in a virtual empty or virtual full phenomenon, which reduces the space available for read and write operations. Summary of the Invention

[0004] This invention provides an asynchronous FIFO for displaying data storage volume and a method for displaying data storage volume, in order to solve the defect in the prior art where existing asynchronous FIFOs leave a margin when displaying empty or full indicators, resulting in inaccurate or inaccurate displays.

[0005] This invention provides an asynchronous FIFO for displaying data storage volume, comprising:

[0006] Storage module, read / write control module, and storage capacity control module;

[0007] The read / write control module is used to determine the current storage state based on the current data storage volume when a read enable signal and / or a write enable signal are detected, and to generate a read state signal and / or a write state signal based on the current storage state.

[0008] The storage module is used to update the current read address value and / or the current write address value based on the read status signal and / or the write status signal;

[0009] The storage control module is used to update and display the current data storage volume based on the current read address value and the current write address value.

[0010] According to the present invention, an asynchronous FIFO for displaying data storage volume is provided, wherein the current storage state is any one of an empty state, a full state, or a state that is neither empty nor full.

[0011] According to the present invention, an asynchronous FIFO for displaying data storage capacity is provided. The read / write control module is configured to generate a read status signal if the current storage state is full or neither empty nor full when a read enable signal is detected, and to generate a write status signal if the current storage state is empty or neither empty nor full when a write enable signal is detected.

[0012] According to the present invention, an asynchronous FIFO for displaying data storage volume is provided, wherein the storage module includes a static random access memory, the static random access memory includes a read address and a write address, the current read address value is incremented by 1 after the static random access memory receives the read status signal, and the current write address value is incremented by 1 after the static random access memory receives the write status signal.

[0013] According to an asynchronous FIFO for displaying data storage volume provided by the present invention, the storage volume control module is used to keep the current data storage volume unchanged when the current read state value is 1 and the current write state value is 1; the current read state value is determined based on the current read address value, and the current write state value is determined based on the current write address value.

[0014] According to an asynchronous FIFO for displaying data storage volume provided by the present invention, the storage volume control module is used to increment the current data storage volume by 1 when the current read state value is 1 and the current write state value is 0; the current read state value is determined based on the current read address value, and the current write state value is determined based on the current write address value.

[0015] According to an asynchronous FIFO for displaying data storage volume provided by the present invention, the storage volume control module is used to decrement the current data storage volume by 1 when the current read state value is 0 and the current write state value is 1; the current read state value is determined based on the current read address value, and the current write state value is determined based on the current write address value.

[0016] According to an asynchronous FIFO for displaying data storage provided by the present invention, the current read status value is 1 when the current read address value is not equal to the address value in the read address register, and is 0 when the current read address value is equal to the address value in the read address register.

[0017] According to an asynchronous FIFO for displaying data storage provided by the present invention, the current write status value is 1 when the current write address value is not equal to the address value in the write address register, and is 0 when the current write address value is equal to the address value in the write address register.

[0018] The present invention also provides a method for displaying data storage volume, comprising:

[0019] Upon detecting a read enable signal and / or a write enable signal, the current storage state is determined based on the current data storage volume, and a read state signal and / or a write state signal are generated based on the current storage state.

[0020] Update the current read address value and / or the current write address value based on the read status signal and / or the write status signal;

[0021] Based on the current read address value and the current write address value, update and display the current data storage volume.

[0022] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the data storage quantity display method as described above.

[0023] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the data storage quantity display method as described above.

[0024] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the data storage quantity display method as described above.

[0025] The asynchronous FIFO and data storage display method provided by this invention involve a read / write control module generating read and / or write status signals based on the current storage state, and a storage module updating the current read and / or write address values ​​based on the read and / or write status signals. This allows the storage control module to update and display the current data storage volume based on the current read and write address values, avoiding the problem in traditional methods where asynchronous FIFOs leave margin when displaying empty / full flags, leading to inaccurate or falsely full flags and thus reducing the operable space for read and write operations. Attached Figure Description

[0026] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0027] Figure 1 This is a schematic diagram of the asynchronous FIFO for displaying data storage provided by the present invention;

[0028] Figure 2 This is a schematic diagram of the read / write control module port provided by the present invention;

[0029] Figure 3 This is a schematic diagram of the storage module port provided by the present invention;

[0030] Figure 4 This is a schematic diagram of the storage control module port provided by the present invention;

[0031] Figure 5 This is a flowchart illustrating the data storage quantity display method provided by the present invention;

[0032] Figure 6 This is a schematic diagram of the structure of the electronic device provided by the present invention. Detailed Implementation

[0033] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.

[0034] Current asynchronous FIFOs only display empty / full flags on top of normal read / write functions. However, in certain continuous read or write operations, the empty / full flags displayed by the asynchronous FIFO have a certain margin, resulting in a virtual empty or virtual full phenomenon, which reduces the space available for read and write operations.

[0035] In response, the present invention provides an asynchronous FIFO that displays the amount of data stored. Figure 1 This is a schematic diagram of the asynchronous FIFO structure for displaying data storage provided by the present invention, as shown below. Figure 1 As shown, the asynchronous FIFO includes a storage module 130, a read / write control module 120, and a storage capacity control module 110.

[0036] The read / write control module 120 is used to determine the current storage state based on the current data storage amount when a read enable signal and / or a write enable signal are detected, and to generate a read status signal and / or a write status signal based on the current storage state.

[0037] Storage module 130 is used to update the current read address value and / or the current write address value based on the read status signal and / or the write status signal;

[0038] The storage control module 110 is used to update and display the current data storage volume based on the current read address value and the current write address value.

[0039] Here, the current storage state is used to characterize the empty / full state of the asynchronous FIFO, which can include an empty state, a full state, and a state that is neither empty nor full. When the current data storage volume is 0, it indicates that the current storage state is empty; when the current data storage volume is equal to the maximum storage volume that can be accommodated, it indicates that the current storage state is full; when the current data storage volume is greater than 0 and less than the maximum storage volume that can be accommodated, it indicates that the current storage state is neither empty nor full.

[0040] like Figure 2 As shown, when the read / write control module 120 detects the read enable signal rd_en, if the current storage state is full or neither empty nor full, it indicates that the external controller can read data from the asynchronous FIFO, and a read status signal read_flag is generated. When the read / write control module 120 detects the write enable signal wt_en, if the current storage state is empty or neither empty nor full, it indicates that the external controller can store data into the asynchronous FIFO, and a write status signal write_flag is generated.

[0041] like Figure 3 As shown, after the read / write control module 120 generates a read status signal, the storage module 130 updates the current read address by incrementing it by 1. Similarly, after the read / write control module 120 generates a write status signal, the storage module 130 updates the current write address by incrementing it by 1.

[0042] Furthermore, the current read status value can be determined based on the current read address value, and the current write status value can be determined based on the current write address value. Therefore, the storage capacity control module 110 can determine and display the current data storage capacity based on the current read status value and the current write status value. For example... Figure 4 As shown, the storage control module 110 determines the current data storage volume based on the read status signal read_flag and the write status signal write_flag.

[0043] For example, if the current read status value is 1 and the current write status value is 0, it means that there is only reading and no writing, so the current data storage amount is incremented by 1; if the current read status value is 0 and the current write status value is 1, it means that there is only writing and no reading, so the current data storage amount is decremented by 1; if the current read status value is 1 and the current write status value is 1, it means that there is both reading and writing, so the current data storage amount remains unchanged.

[0044] Understandably, after the storage control module 110 displays the current data storage volume, the external controller can determine whether to read data from the asynchronous FIFO based on the displayed current data storage volume. If so, it can further determine the amount of data to read based on the current data storage volume, and / or determine whether to write data to the asynchronous FIFO. If so, it can further determine the amount of data to write based on the current data storage volume.

[0045] The asynchronous FIFO for displaying data storage capacity provided in this embodiment of the invention has a read / write control module that generates read status signals and / or write status signals based on the current storage state. The storage module updates the current read address value and / or the current write address value based on the read status signals and / or write status signals. Thus, the storage capacity control module can update and display the current data storage capacity based on the current read address value and the current write address value, avoiding the problem in traditional methods where asynchronous FIFOs leave a margin when displaying empty / full flags, leading to virtual empty or virtual full flags and thus reducing the operable space for reading and writing.

[0046] Based on the above embodiments, the current storage state is any one of empty, full, or neither empty nor full.

[0047] Specifically, when the current data storage volume is 0, it indicates that the current storage state is empty; when the current data storage volume is equal to the maximum storage volume that can be accommodated, it indicates that the current storage state is full; when the current data storage volume is greater than 0 and less than the maximum storage volume that can be accommodated, it indicates that the current storage state is neither empty nor full.

[0048] Furthermore, when the current storage state is empty or neither empty nor full, it indicates that the external controller can store data into the asynchronous FIFO; when the current storage state is full or neither empty nor full, it indicates that the external controller can read data from the asynchronous FIFO.

[0049] Based on any of the above embodiments, the read / write control module 120 is used to generate a read status signal if the current storage state is full or neither empty nor full when a read enable signal is detected, and to generate a write status signal if the current storage state is empty or neither empty nor full when a write enable signal is detected.

[0050] Specifically, when the read / write control module 120 detects a read enable signal, if the current storage state is full or neither empty nor full, it indicates that the external controller can read data from the asynchronous FIFO, and a read status signal is generated at this time. When the read / write control module 120 detects a write enable signal, if the current storage state is empty or neither empty nor full, it indicates that the external controller can store data into the asynchronous FIFO, and a write status signal is generated at this time.

[0051] Based on any of the above embodiments, the storage module 130 includes a static random access memory (SRAM), which includes a read address and a write address. The current read address value is incremented by 1 after the SRAM receives a read status signal, and the current write address value is incremented by 1 after the SRAM receives a write status signal.

[0052] Specifically, the storage module 130 includes a static random-access memory (SRAM) for storage, the depth of which can be set according to actual needs. If the SRAM receives a read status signal, it indicates that the read / write control module has received a read enable signal in a full state or a non-empty / non-full state. In this case, data can be read from the SRAM, and the current read address is incremented by 1. If the SRAM receives a write status signal, it indicates that the read / write control module has received a write enable signal in an empty state or a non-empty / non-full state. In this case, data can be written to the SRAM, and the current write address is incremented by 1.

[0053] The current storage state can be determined by a multi-bit combinational logic counter. When the counter is 0, it indicates that the current storage state is empty. When the counter is equal to the maximum depth that the SRAM can accommodate, it indicates that the current storage state is full. Otherwise, it is a non-empty and non-full state.

[0054] Based on any of the above embodiments, the storage capacity control module 110 is used to keep the current data storage capacity unchanged when the current read status value is 1 and the current write status value is 1; the current read status value is determined based on the current read address value, and the current write status value is determined based on the current write address value.

[0055] Specifically, when the current read status value is 1 and the current write status value is 1, it indicates that there is simultaneous reading and writing of data, so the current data storage volume remains unchanged.

[0056] This can be understood as the above counter being triggered by the read status signal and / or the write status signal, i.e., always@(write_flag or read_flag);

[0057] When triggered, if write_flag == 1 & read_flag == 1, then the counter, read address register, and write address register will be assigned values ​​according to the following formulas:

[0058] wt_reg<=wt_reg; rd_reg<=rd_reg; cnt<=cnt;

[0059] Here, write_flag and read_flag are the current read status value and the current write status value, respectively; wt_reg and rd_reg are the address values ​​in the read address register and the write address register, respectively; and cnt is the counter value, which is the current data storage amount.

[0060] Based on any of the above embodiments, the storage control module 110 is used to increment the current data storage by 1 when the current read status value is 1 and the current write status value is 0; the current read status value is determined based on the current read address value, and the current write status value is determined based on the current write address value.

[0061] Specifically, when the current read status value is 1 and the current write status value is 0, it indicates that there is only a read data operation and no write data operation, so the current data storage amount is incremented by 1.

[0062] When triggered, if write_flag == 1 & read_flag == 0, then the counter, read address register, and write address register will be assigned values ​​according to the following formulas:

[0063] wt_reg<=addr_w[0]; rd_reg<=addr_r[0]; cnt<=cnt+1;

[0064] Where wt_reg and rd_reg are the address values ​​in the read address register and the write address register, respectively; addr_w and addr_r are the read address value and write address value of the SRAM, respectively; and cnt is the counter value, which is the current amount of data stored.

[0065] Based on any of the above embodiments, the storage control module 110 is used to decrement the current data storage by 1 when the current read status value is 0 and the current write status value is 1; the current read status value is determined based on the current read address value, and the current write status value is determined based on the current write address value.

[0066] Specifically, when the current read status value is 0 and the current write status value is 1, it indicates that there is only a write data operation and no read data operation, so the current data storage amount is reduced by 1.

[0067] When triggered, if write_flag == 0 & read_flag == 1, then the counter, read address register, and write address register will be assigned values ​​according to the following formulas:

[0068] wt_reg<=addr_w[0]; rd_reg<=addr_r[0]; cnt<=cnt-1;

[0069] Where wt_reg and rd_reg are the address values ​​in the read address register and the write address register, respectively; addr_w and addr_r are the read address value and write address value of the SRAM, respectively; and cnt is the counter value, which is the current amount of data stored.

[0070] Based on any of the above embodiments, the current read status value is 1 when the current read address value is not equal to the address value in the read address register, and is 0 when the current read address value is equal to the address value in the read address register, that is, assign write_flag = (wt_reg != addr_w[0]).

[0071] Based on any of the above embodiments, the current write status value is 1 when the current write address value is not equal to the address value in the write address register, and is 0 when the current write address value is equal to the address value in the write address register, that is, assign read_flag = (rd_reg != addr_r[0]).

[0072] Table 1 is the signal list for the asynchronous FIFO. The process of displaying data volume for the asynchronous FIFO is explained below with reference to Table 1:

[0073] When the reset signal rst goes low, the system generates a reset. After the reset, the cnt signal becomes 0, the full signal becomes 0, and the empty signal becomes 1, indicating that the FIFO is empty. When the write enable signal wt_en is detected to be high on the rising edge of the write data clock clk_w, the read / write control module determines whether data can be written to the storage module based on the value of cnt. If cnt is not at its maximum value (i.e., not full), the write_flag signal is generated, and the write address addr_w is incremented by 1, waiting for the next write operation. When the read enable signal rd_en is detected to be high on the rising edge of the read clock clk_r, the read / write control module determines whether data can be read from the storage module based on the value of cnt. If cnt is not 0 (i.e., not empty), the read_flag signal is generated, and the read address is incremented by 1, waiting for the next read operation.

[0074] In addition, the storage control module calculates cnt based on the read status signal read_flag and the write status signal write_flag; changes in read_flag and write_flag will cause the counter to jump; when read_flag jumps from 0 to 1, cnt is decremented by 1; when write_flag jumps from 0 to 1, cnt is incremented by 1.

[0075] Table 1

[0076] Signal Input / output description clk_r input Read data clock clk_w input Write data clock rst input Reset signal, active low rd_en input Read enable signal, active high. wt_en input Write enable signal, active high. data_w input Write data data_r output Read data cnt output Data volume empty output null flag signal full output Full mark signal

[0077] The data storage quantity display method provided by the present invention is described below. The data storage quantity display method described below can be referred to in correspondence with the asynchronous FIFO for displaying data storage quantity described above.

[0078] Based on any of the above embodiments, the present invention also provides a method for displaying data storage volume based on an asynchronous FIFO for displaying data storage volume as described in any of the above embodiments, such as... Figure 5 As shown, the method includes:

[0079] Step 510: Upon detecting a read enable signal and / or a write enable signal, determine the current storage state based on the current data storage amount, and generate a read status signal and / or a write status signal based on the current storage state.

[0080] Step 520: Update the current read address value and / or the current write address value based on the read status signal and / or write status signal;

[0081] Step 530: Update and display the current data storage volume based on the current read address value and the current write address value.

[0082] Here, the current storage state is used to characterize the empty / full state of the asynchronous FIFO, which can include an empty state, a full state, and a state that is neither empty nor full. When the current data storage volume is 0, it indicates that the current storage state is empty; when the current data storage volume is equal to the maximum storage volume that can be accommodated, it indicates that the current storage state is full; when the current data storage volume is greater than 0 and less than the maximum storage volume that can be accommodated, it indicates that the current storage state is neither empty nor full.

[0083] When the read enable signal rd_en is detected, if the current storage state is full or neither empty nor full, it indicates that the external controller can read data from the asynchronous FIFO, and a read status signal read_flag is generated. When the write enable signal wt_en is detected, if the current storage state is empty or neither empty nor full, it indicates that the external controller can store data into the asynchronous FIFO, and a write status signal write_flag is generated.

[0084] After generating the read status signal, the current read address is updated by incrementing it by 1. Similarly, after generating the write status signal, the current write address is updated by incrementing it by 1. Furthermore, the current read status value and the current write status value can be determined based on the current read address value and the current write status value, respectively. Therefore, the current data storage volume can be determined and displayed based on these two status values. The current data storage volume is determined based on the read status signal `read_flag` and the write status signal `write_flag`.

[0085] The data storage quantity display method provided in this invention generates a read status signal and / or a write status signal based on the current storage state, and updates the current read address value and / or the current write address value based on the read status signal and / or the write status signal. This enables the current data storage quantity to be updated and displayed based on the current read address value and the current write address value, avoiding the problem in traditional methods where asynchronous FIFOs leave a margin when displaying empty or full flags, resulting in virtual empty or full flags and thus reducing the operable space for reading and writing.

[0086] Figure 6 This is a schematic diagram of the structure of the electronic device provided by the present invention, such as... Figure 6 As shown, the electronic device may include a processor 610, a memory 620, a communications interface 630, and a communications bus 640, wherein the processor 610, the memory 620, and the communications interface 630 communicate with each other through the communications bus 640. The processor 610 can invoke logical instructions in the memory 620 to execute a data storage quantity display method. This method includes: upon detecting a read enable signal and / or a write enable signal, determining the current storage state based on the current data storage quantity, and generating a read status signal and / or a write status signal based on the current storage state; updating the current read address value and / or the current write address value based on the read status signal and / or the write status signal; and updating and displaying the current data storage quantity based on the current read address value and the current write address value.

[0087] Furthermore, the logical instructions in the aforementioned memory 620 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, essentially, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0088] On the other hand, the present invention also provides a computer program product, the computer program product comprising a computer program stored on a non-transitory computer-readable storage medium, the computer program comprising program instructions, wherein when the program instructions are executed by a computer, the computer is capable of executing the data storage quantity display method provided by the above methods, the method comprising: upon detecting a read enable signal and / or a write enable signal, determining a current storage state based on the current data storage quantity, and generating a read state signal and / or a write state signal based on the current storage state; updating a current read address value and / or a current write address value based on the read state signal and / or the write state signal; and updating and displaying the current data storage quantity based on the current read address value and the current write address value.

[0089] In another aspect, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon. When executed by a processor, the computer program is implemented to perform the data storage quantity display methods provided above. The method includes: upon detecting a read enable signal and / or a write enable signal, determining a current storage state based on the current data storage quantity, and generating a read state signal and / or a write state signal based on the current storage state; updating a current read address value and / or a current write address value based on the read state signal and / or the write state signal; and updating and displaying the current data storage quantity based on the current read address value and the current write address value.

[0090] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0091] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.

[0092] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions 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 invention.

Claims

1. An asynchronous FIFO for displaying data storage volume, characterized in that, include: Storage module, read / write control module, and storage capacity control module; The read / write control module is used to determine the current storage state based on the current data storage volume when a read enable signal and / or a write enable signal are detected, and to generate a read state signal and / or a write state signal based on the current storage state; the current storage state is used to characterize the empty / full state of the asynchronous FIFO; The storage module is used to update the current read address value and / or the current write address value based on the read status signal and / or the write status signal; The storage capacity control module is used to update and display the current data storage capacity based on the current read address value and the current write address value; The read / write control module is used to generate the read status signal when the current storage state is full or neither empty nor full if a read enable signal is detected, and to generate the write status signal when the current storage state is empty or neither empty nor full if a write enable signal is detected. The storage control module calculates the current data storage amount based on the read status signal and the write status signal. Changes in the read status signal and the write status signal will cause the current data storage amount to change. When the read status signal changes from 0 to 1, the current data storage amount is decreased by 1; when the write status signal changes from 0 to 1, the current data storage amount is increased by 1. When the current data storage amount is incremented or decremented by 1, the address value in the write address register is updated to the write address value of the SRAM, and the address value in the read address register is updated to the read address value of the SRAM; when the current data storage amount remains unchanged, the address values ​​in the write address register and the read address register remain unchanged.

2. The asynchronous FIFO for displaying data storage capacity according to claim 1, characterized in that, The current storage state is any one of empty, full, or neither empty nor full.

3. The asynchronous FIFO for displaying data storage capacity according to claim 1, characterized in that, The storage module includes a static random access memory (SRAM), which includes a read address and a write address. The current read address value is incremented by 1 after the SRAM receives the read status signal, and the current write address value is incremented by 1 after the SRAM receives the write status signal.

4. The asynchronous FIFO for displaying data storage capacity according to claim 1, characterized in that, The storage capacity control module is used to keep the current data storage capacity unchanged when the current read status value is 1 and the current write status value is 1; the current read status value is determined based on the current read address value, and the current write status value is determined based on the current write address value.

5. The asynchronous FIFO for displaying data storage volume according to claim 1, characterized in that, The storage capacity control module is used to increment the current data storage capacity by 1 when the current read status value is 1 and the current write status value is 0; the current read status value is determined based on the current read address value, and the current write status value is determined based on the current write address value.

6. The asynchronous FIFO for displaying data storage volume according to claim 1, characterized in that, The storage control module is used to decrement the current data storage by 1 when the current read status value is 0 and the current write status value is 1; the current read status value is determined based on the current read address value, and the current write status value is determined based on the current write address value.

7. The asynchronous FIFO for displaying data storage according to any one of claims 4 to 6, characterized in that, The current read status value is 1 when the current read address value is not equal to the address value in the read address register, and is 0 when the current read address value is equal to the address value in the read address register.

8. The asynchronous FIFO for displaying data storage according to any one of claims 4 to 6, characterized in that, The current write status value is 1 when the current write address value is not equal to the address value in the write address register, and is 0 when the current write address value is equal to the address value in the write address register.

9. A method for displaying data storage volume based on an asynchronous FIFO for displaying data storage volume according to any one of claims 1 to 8, characterized in that, include: Upon detecting a read enable signal and / or a write enable signal, the current storage state is determined based on the current data storage volume, and a read state signal and / or a write state signal are generated based on the current storage state. Update the current read address value and / or the current write address value based on the read status signal and / or the write status signal; Based on the current read address value and the current write address value, update and display the current data storage volume.

Citation Information

Patent Citations

  • Asynchronous signal input device and sampling frequency conversion device

    CN1625052A