FIFO storage system and FIFO memory control method

By introducing a read clock frequency circuit and controller into the FIFO memory, the frequency of the read clock signal is dynamically adjusted, which solves the problems of large capacity requirements and data discontinuity in data transmission across different clock domains, and achieves data continuity and memory optimization.

CN115686430BActive Publication Date: 2026-11-17BEIJING BOE TECH DEV CO LTD +1
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202110875163.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-07-30
Publication Date
2026-11-17
Estimated Expiration
2041-07-30

AI Technical Summary

Technical Problem

In FIFO memory, data transmission between different clock domains is prone to large capacity requirements or data discontinuity due to frequency differences, making it difficult to simultaneously ensure data continuity and optimize memory area.

Method used

By introducing a read clock frequency circuit and controller into the FIFO memory, the frequency of the read clock signal is dynamically adjusted. The first and second clock signal frequencies are switched within different ranges according to the amount of data, ensuring that the amount of data changes within a reasonable range and avoiding the memory from being too full or too empty.

Benefits of technology

It achieves data continuity and optimizes memory area and power consumption under different data volumes, and is suitable for data transmission in different clock domains.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115686430B_ABST
    Figure CN115686430B_ABST
Patent Text Reader

Abstract

This disclosure provides a FIFO storage system and a FIFO memory control method. The FIFO storage system includes: a FIFO memory; a read clock frequency circuit for providing at least two clock signals, the at least two clock signals including a first clock signal and a second clock signal, wherein the frequency of the first clock signal is greater than the frequency of the second clock signal; and a controller for determining the amount of data in the FIFO memory; controlling the read clock frequency circuit to output the first clock signal when the amount of data in the FIFO memory is within a first range, or controlling the read clock frequency circuit to output the second clock signal when the amount of data in the FIFO memory is within a second range; wherein the lower limit of the first range is not less than the upper limit of the second range.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to a FIFO storage system and a FIFO memory control method. Background Technology

[0002] First-In-First-Out (FIFO) memory is an important structure in System on Chip (SoC). FIFO memory is generally used for data transfer between different clock domains. Different clock domains mean that the write clock frequency and the read clock frequency of the FIFO memory are different. For example, the write clock frequency of the FIFO memory is 50MHz and the read clock frequency of the FIFO memory is 40MHz.

[0003] The capacity of a FIFO memory is related to the frequency of the write clock, the frequency of the read clock, and the length of each data write. When the length of each data write is large, if the frequency of the write clock is greater than the frequency of the read clock, the capacity of the FIFO memory needs to be designed to be large in order to prevent the FIFO memory from being filled quickly, resulting in a large area occupied. On the other hand, if the FIFO memory is paused in writing data, it is easy for the data in the FIFO memory to be read out. Since the frequency of the read clock is less than the frequency of the write clock, the FIFO memory can still be completely filled, making it difficult to guarantee the continuity of data. Summary of the Invention

[0004] This disclosure provides a FIFO storage system and a FIFO memory control method.

[0005] This disclosure provides at least one embodiment of a FIFO storage system, the FIFO storage system comprising:

[0006] FIFO memory;

[0007] A clock frequency reading circuit is used to provide at least two clock signals, the at least two clock signals including a first clock signal and a second clock signal, wherein the frequency of the first clock signal is greater than the frequency of the second clock signal;

[0008] The controller is used to determine the amount of data in the FIFO memory; when the amount of data in the FIFO memory is within a first range, it controls the read clock frequency circuit to output a first clock signal, or when the amount of data in the FIFO memory is within a second range, it controls the read clock frequency circuit to output a second clock signal.

[0009] Wherein, the lower limit of the first range is not less than the upper limit of the second range.

[0010] Optionally, the lower limit of the first range is a first threshold, the upper limit of the first range is the capacity of the FIFO memory, the lower limit of the second range is 0, the upper limit of the second range is a second threshold, and the first threshold is greater than the second threshold.

[0011] The controller is also configured to control the clock signal output by the read clock frequency circuit to remain unchanged when the amount of data in the FIFO memory is within a third range, wherein the lower limit of the third range is the second threshold and the upper limit of the third range is the first threshold.

[0012] Optionally, the ratio of the difference between the first threshold and the second threshold to the capacity of the FIFO memory is not less than 5% and not greater than 25%.

[0013] Optionally, the frequency of the first clock signal is greater than the frequency of the write clock of the FIFO memory, and the frequency of the second clock signal is less than the frequency of the write clock of the FIFO memory.

[0014] Optionally, the controller is configured to generate a control word based on the amount of data in the FIFO memory;

[0015] The clock frequency reading circuit is used to output the first clock signal or the second clock signal in response to the control word; both the first clock signal and the second clock signal include a first frequency signal and a second frequency signal, and the probability of the first frequency signal and the second frequency signal occurring is controlled by the control word.

[0016] Optionally, the controller is configured to control the generated control word change when the amount of data in the FIFO memory is in a second range and the effective signal of the FIFO memory is at a low level, so that the frequency of the second clock signal decreases according to a first rule.

[0017] Optionally, the clock frequency reading circuit includes:

[0018] A frequency synthesizer is used to generate a pulse signal in response to a reference pulse signal with uniformly spaced phases and the control word, wherein the pulse signal is either the first clock signal or the second clock signal;

[0019] The control word includes a first coefficient and a second coefficient;

[0020] The pulse signal includes a first frequency signal generated based on the reference pulse signal and a first coefficient, and a second frequency signal generated based on the reference pulse signal and the first coefficient. The proportion of the first frequency signal and the second frequency signal in the pulse signal is controlled by the second coefficient.

[0021] Optionally, the controller is configured to determine the amount of data in the FIFO memory based on the flag bit output by the FIFO memory.

[0022] This disclosure provides at least one embodiment of a FIFO memory control method, the method comprising:

[0023] Determine the amount of data in the FIFO memory;

[0024] When the amount of data in the FIFO memory is within a first range, the control read clock frequency circuit outputs a first clock signal as the read clock of the FIFO memory; when the amount of data in the FIFO memory is within a second range, the control read clock frequency circuit outputs a second clock signal as the read clock of the FIFO memory.

[0025] Wherein, the lower limit of the first range is not less than the upper limit of the second range.

[0026] Optionally, the lower limit of the first range is a first threshold, the upper limit of the first range is the capacity of the FIFO memory, the lower limit of the second range is 0, the upper limit of the second range is a second threshold, and the first threshold is greater than the second threshold; the method further includes:

[0027] When the amount of data in the FIFO memory is within a third range, the read clock of the FIFO memory is kept constant. The lower limit of the third range is the second threshold, and the upper limit of the third range is the first threshold.

[0028] Optionally, when the amount of data in the FIFO memory is within a first range, controlling the read clock frequency circuit to output a first clock signal as the read clock of the FIFO memory; and when the amount of data in the FIFO memory is within a second range, controlling the read clock frequency circuit to output a second clock signal as the read clock of the FIFO memory, includes:

[0029] A control word is generated based on the amount of data in the FIFO memory;

[0030] The control word is output to the read clock frequency circuit so that the read clock frequency circuit responds to the control word and outputs the first clock signal or the second clock signal; both the first clock signal and the second clock signal include a first frequency signal and a second frequency signal, and the probability of the first frequency signal and the second frequency signal occurring is controlled by the control word.

[0031] Optionally, generating the control word based on the amount of data in the FIFO memory includes:

[0032] When the amount of data in the FIFO memory is within the second range and the effective signal of the FIFO memory is at a low level, the control word generated is changed so that the frequency of the second clock signal decreases according to the first rule.

[0033] Optionally, determining the amount of data in the FIFO memory includes:

[0034] The amount of data in the FIFO memory is determined based on the flag bits output by the FIFO memory. Attached Figure Description

[0035] Figure 1 This is a schematic diagram of the structure of a FIFO storage system provided in an embodiment of this disclosure;

[0036] Figure 2 This diagram illustrates the change in the amount of data in a FIFO memory provided in an embodiment of the present disclosure.

[0037] Figure 3 This diagram illustrates the frequency variation of the read clock of a FIFO memory provided in an embodiment of the present disclosure.

[0038] Figure 4 This is a detailed structural diagram of the FIFO storage system provided in the embodiments of this disclosure;

[0039] Figure 5 A waveform diagram of an effective signal provided in an embodiment of this disclosure is shown;

[0040] Figure 6 This diagram illustrates the change in the amount of data in a FIFO memory provided in an embodiment of the present disclosure.

[0041] Figure 7 This diagram illustrates the frequency variation of the read clock of a FIFO memory provided in an embodiment of the present disclosure.

[0042] Figure 8 for Figure 4 A schematic diagram of the loop oscillator in the diagram;

[0043] Figure 9 To adopt Figure 4 Waveform diagram of K-channel uniformly spaced reference pulse signals generated by the signal generator in the image;

[0044] Figure 10 This is a schematic diagram illustrating the principle of pulse signal synthesis using a frequency synthesizer.

[0045] Figure 11 This is a schematic diagram of the structure of a frequency synthesizer provided in an embodiment of the present disclosure;

[0046] Figure 12 This is a schematic diagram illustrating the relationship between the frequency Fo of the pulse signal and the control word F provided in the embodiments of this disclosure;

[0047] Figure 13 A flowchart of a FIFO memory control method provided in an embodiment of this disclosure is shown. Detailed Implementation

[0048] To make the principles and advantages of this disclosure clearer, the embodiments of this disclosure will be described in further detail below with reference to the accompanying drawings.

[0049] Figure 1 This is a schematic diagram of the structure of a FIFO storage system provided in an embodiment of this disclosure. See also... Figure 1 The FIFO storage system includes a FIFO memory 10, a read clock frequency circuit 20, and a controller 30. The read clock frequency circuit 20 is connected to both the FIFO memory 10 and the controller 30, and the controller 30 is also connected to the FIFO memory 10.

[0050] The clock frequency reading circuit 20 is used to provide at least two clock signals, including a first clock signal and a second clock signal, wherein the frequency of the first clock signal is greater than the frequency of the second clock signal.

[0051] The controller 30 is used to determine the amount of data in the FIFO memory; when the amount of data in the FIFO memory is within a first range, it controls the read clock frequency circuit to output a first clock signal, or when the amount of data in the FIFO memory is within a second range, it controls the read clock frequency circuit to output a second clock signal; wherein, the lower limit of the first range is not less than the upper limit of the second range.

[0052] This embodiment of the disclosure controls the read clock frequency of the FIFO memory through the aforementioned system. When the amount of data in the FIFO memory is large, a higher frequency first clock signal is used as the read clock for the FIFO memory, enabling data to be read out quickly, thereby reducing the amount of data in the FIFO memory and preventing it from becoming full. When the amount of data in the FIFO memory is small, a lower frequency second clock signal is used as the read clock for the FIFO memory, preventing data from being read out too quickly and causing read interruptions, thus ensuring the continuity of read data. Furthermore, by employing the above method, the FIFO memory can be prevented from becoming full, therefore, a smaller capacity FIFO memory can be used, thereby saving FIFO memory area and power.

[0053] Data continuity is crucial for some systems. For example, a Universal Serial Bus (USB) speaker reads data from a FIFO memory to play music. If the data is discontinuous, playback will be interrupted, resulting in noise. Furthermore, data continuity requires a smooth data readout speed to ensure optimal playback quality from the USB speaker.

[0054] In one possible implementation, the first range and the second range are two consecutive ranges, that is, the lower limit of the first range and the upper limit of the second range are the same. The upper limit of the first range is the capacity of the FIFO memory, and the lower limit of the second range is 0.

[0055] In another possible implementation, the first and second ranges are two discontinuous ranges.

[0056] For example, the lower limit of the first range is a first threshold, the upper limit of the first range is the capacity of the FIFO memory, the lower limit of the second range is 0, the upper limit of the second range is a second threshold, and the first threshold is greater than the second threshold. Between the first and second ranges, there exists a third range, the lower limit of which is the second threshold, and the upper limit of which is the first threshold.

[0057] It is worth noting that since the endpoints of the first, second, and third ranges overlap, for example, the upper limit of the third range is the first threshold, while the lower limit of the first range is the first threshold, in this case, one of the first and third ranges includes the endpoint value (first threshold), while the other does not. For example, the first range is (first threshold, capacity of FIFO memory)[0, second threshold], the second range is [0, second threshold], and the third range is [second threshold, first threshold].

[0058] The controller 30 is also configured to control the clock signal output by the read clock frequency circuit to remain unchanged when the amount of data in the FIFO memory is within a third range.

[0059] In this embodiment of the disclosure, the controller 30 periodically determines the amount of data in the FIFO memory and controls the clock signal output by the read clock frequency circuit. If the amount of data in the FIFO memory is within a third range in the current cycle, the clock signal output by the read clock frequency circuit remains unchanged compared to the previous cycle.

[0060] For example, if the amount of data in the FIFO memory is within the third range in the current cycle, and if the clock signal output by the read clock frequency circuit controlled by the controller 30 in the previous cycle is the first clock signal, then the read clock frequency circuit is controlled to continue outputting the first clock signal in this cycle. If the clock signal output by the read clock frequency circuit controlled by the controller 30 in the previous cycle is the second clock signal, then the read clock frequency circuit is controlled to continue outputting the second clock signal in this cycle.

[0061] In this embodiment, the design of the first and second thresholds relates to the frequency at which the controller controls the read clock frequency circuit to change the output clock signal. For example, the smaller the difference between the first and second thresholds, the easier it is for the amount of data in the FIFO memory to change between the first and second ranges. Correspondingly, the higher the frequency at which the controller controls the read clock frequency circuit to change the output clock signal, the higher the control precision. Conversely, the larger the difference between the first and second thresholds, the less likely the amount of data in the FIFO memory is to change between the first and second ranges. Correspondingly, the lower the frequency at which the controller controls the read clock frequency circuit to change the output clock signal, the lower the hardware requirements of the controller, and the lower the power consumption required by the controller.

[0062] For example, the ratio of the difference between the first threshold and the second threshold to the capacity of the FIFO memory is not less than 5% and not greater than 25%.

[0063] For example, the FIFO memory has a capacity of 200, a first threshold of 100, and a second threshold of 50. Another example: the FIFO memory has a capacity of 200, a first threshold of 60, and a second threshold of 50.

[0064] In this embodiment, the first threshold cannot be set too high, for example, it cannot exceed 75% of the FIFO memory capacity; the second threshold cannot be set too low, for example, it cannot be less than 25% of the FIFO memory capacity. This ensures sufficient space in the first and second ranges, preventing the FIFO memory from easily reaching its maximum capacity after reaching the first range, or preventing the FIFO memory from being easily read out after reaching the second range.

[0065] In the embodiments of this disclosure, the capacity of the FIFO memory is typically designed to be small, such as several hundred or one thousand, and is independent of the length of data written each time (i.e., decoupled from the length of data written each time). The FIFO memory design is simpler and more robust. The unit of data volume or capacity referred to in this disclosure can be several bits or bytes, for example, each unit is 32 or 64 bits. For example, if the capacity of the FIFO memory mentioned in this disclosure is 200, then its capacity is 200 × 32 bits.

[0066] In related technologies, the capacity of a FIFO memory (FIFO SIZE) and the frequency of the write clock (f) are... w The frequency f of the read clock r And the length of each piece of data written. data_i For example, if the length of data written at one time is 100,000, the write clock frequency is 50MHz, and the read clock frequency is 40MHz, then the capacity of the FIFO memory is calculated as follows:

[0067]

[0068] In this embodiment of the disclosure, some of the values ​​in the above example are used for illustration, namely, the length of the data written at one time is 100,000, the frequency of the write clock is 50MHz, and the frequency of the read clock will change with the switching of the first clock signal and the second clock signal. By controlling the frequency of the read clock, the capacity of the FIFO memory can be designed to be 200.

[0069] For example, this disclosure can use the write clock frequency as a reference when switching the read clock frequency. For instance, the frequency of the first clock signal is greater than the write clock frequency of the FIFO memory, and the frequency of the second clock signal is less than the write clock frequency of the FIFO memory. With this design, when using the first clock signal as the read clock, the FIFO memory reads at a faster frequency than it writes, causing the data in the FIFO memory to continuously decrease; conversely, when using the second clock signal as the read clock, the FIFO memory writes at a faster frequency than it reads, causing the data in the FIFO memory to continuously increase.

[0070] The following example uses a write clock frequency of 50MHz, combined with... Figure 2 and Figure 3 The solution provided in this public disclosure is explained.

[0071] Figure 2 The diagram illustrates the change in the amount of data in the FIFO memory in the example above. Figure 3 This diagram illustrates the frequency variation of the read clock for the FIFO memory in the example above. Combined with... Figure 2 and Figure 3 It can be seen that if the amount of data in the FIFO memory is greater than 100, then f r Switch to 66.7MHz (50MHz higher than the write clock frequency). Figure 3 (Dash line); If the amount of data in the FIFO memory is less than 50, then f r Switching to 40MHz (less than the write clock frequency of 50MHz) causes the amount of data in the FIFO memory to vary between 50 and 100 most of the time.

[0072] In one possible implementation of this disclosure, the controller 30 is configured to generate a control word based on the amount of data in the FIFO memory;

[0073] The clock frequency reading circuit 20 is used to output the first clock signal or the second clock signal in response to the control word; both the first clock signal and the second clock signal include a first frequency signal and a second frequency signal, and the probability of the first frequency signal and the second frequency signal occurring is controlled by the control word.

[0074] For example, the controller 30 is configured to generate a first control word when the amount of data in the FIFO memory is within a first range, the first control word being configured to cause the read clock frequency circuit to output the first clock signal, and to generate a second control word when the amount of data in the FIFO memory is within a second range, the second control word being configured to cause the read clock frequency circuit to output the second clock signal.

[0075] For example, the controller 30 is configured to determine the amount of data in the FIFO memory based on the flag bit output by the FIFO memory.

[0076] For example, the controller (control block) is implemented using a programmable chip or other chip.

[0077] Figure 4 A detailed structural diagram of the FIFO storage system provided in an embodiment of this disclosure is shown. See also... Figure 4 The FIFO memory 10 takes Data_i as input and Data_o as output. Its write clock is CLKW, and its read clock is CLKR. The FIFO memory 10 is configured with write and read pointers. The write pointer counts based on the rising edge of the write clock CLKW, and the read pointer counts based on the rising edge of the read clock CLKR. Based on the write and read pointers, the FIFO memory 10 can determine the amount of data in the FIFO memory and output this information to the controller 30 as a flag.

[0078] The FIFO memory 10 is also controlled by a valid signal (Data_valid). For example, when the valid signal is low, the input data is invalid or paused, and no data is written to the FIFO memory. However, since data reading is still in progress, it is easy for the data in the FIFO memory to be read out, causing data discontinuity. To avoid this situation and ensure data continuity even when the valid signal is low, the controller 30 controls the generated control word to change when the amount of data in the FIFO memory is within a second range and the valid signal of the FIFO memory is low, so that the frequency of the second clock signal decreases according to a first rule. That is, in this embodiment, the second control word can be variable. In this embodiment, the controller 30 can obtain the valid signal through the FIFO memory to achieve the above control.

[0079] The phrase "decreasing according to the first law" can refer to a gradual decrease over time, such as a linear decrease or a decrease following a smooth curve.

[0080] In this embodiment of the disclosure, the size of the control word provided by the controller 30 is inversely proportional to the frequency of the second clock signal. That is, to control the frequency of the second clock signal to gradually decrease, the output control word needs to gradually increase.

[0081] The above embodiments will now be described with reference to the accompanying drawings. Figure 5 A waveform diagram of the valid signal is shown. Figure 6 This diagram illustrates the changes in the amount of data in the FIFO memory. Figure 7 A schematic diagram illustrating the frequency variation of the read clock of a FIFO memory is shown. (Combined with...) Figures 5 to 7 It can be seen that because the effective signal is often at a low level (0), the amount of data written is small, and the amount of data in the FIFO memory is always in the second range (0 to 1000 bits). The clock signal output by the read clock frequency circuit 20 is the second clock signal. When the effective signal is at a high level (1), the frequency of the second clock signal is maintained at 40MHz. When the effective signal is at a low level (0), the frequency of the second clock signal continues to decrease. This ensures that when the effective signal is at a low level, that is, when there is no data input into the FIFO, the data change inside the FIFO remains smooth and the amount of data will not decrease to 0. This ensures that the output port always has data output and guarantees the continuity of data.

[0082] In other implementations, the frequency of the second clock signal can remain constant, regardless of whether the active clock is at a high or low level.

[0083] See Figure 4The read clock frequency circuit 20 includes a frequency synthesizer 200, which is connected to the FIFO memory 10 and the controller 30 respectively.

[0084] The frequency synthesizer 200 is used to generate a pulse signal in response to a reference pulse signal with uniformly spaced phases and the control word, wherein the pulse signal is either the first clock signal or the second clock signal;

[0085] The control word includes a first coefficient and a second coefficient;

[0086] The pulse signal includes a first frequency signal generated based on the reference pulse signal and a first coefficient, and a second frequency signal generated based on the reference pulse signal and the first coefficient. The proportion of the first frequency signal and the second frequency signal in the pulse signal is controlled by the second coefficient.

[0087] For example, the relationship between the first coefficient and the second coefficient can be as follows: the sum of the first coefficient and the second coefficient is the control word, for example, the first coefficient is the integer part of the control word, and the second coefficient is the fractional part of the control word.

[0088] See Figure 4 The FIFO storage system also includes a signal generator 40, which is connected to the read clock frequency circuit 20 to generate multiple reference pulse signals with uniform phase intervals.

[0089] For example, the signal generator 40 can be a ring oscillator (RO). Figure 8 A schematic diagram of the loop oscillator is shown below. Figure 8 The loop oscillator includes multiple NAND gates, which are connected to form a loop. The loop oscillator has multiple pins P0-P15. One of the pins can be used as an input terminal to input an initial pulse signal. The initial pulse signal is delayed by the NAND gate, and the other pins are used as output terminals to output multiple reference pulse signals. The multiple reference pulse signals are reference pulse signals with uniform phase spacing.

[0090] A reference pulse signal with uniform phase spacing refers to a multi-channel pulse signal generated by the signal generator 40 where the phase changes are the same and the initial phase spacing of the multi-channel pulse signal is equal.

[0091] Figure 9 To adopt Figure 4 The waveform diagram shows the K-channel, uniformly spaced reference pulse signals generated by the signal generator in the image. (See also...) Figure 9Any two signals have the same waveform (i.e., the same period and amplitude), and the waveforms of the K signals are evenly distributed, meaning they are spaced at the same intervals. The phase difference between any two adjacent signals is a basic time unit Δ, and the frequency of each of the K signals is f. i K is an integer greater than 2.

[0092] In one implementation of this disclosure, the frequency synthesizer 200 is configured to generate a pulse signal according to the following formula:

[0093] T TAF = (1-r)*T A +r*T B T A =I*Δ,T B = (I+1)*Δ(1)

[0094] That is, T TAF =(1-r)*I*Δ+r*(I+1)*Δ=(I+r)*Δ, control word F=I+r.

[0095] Among them, T TAF T is the period of the pulse signal. A The first frequency signal (or the first period signal), T B Here, is the second frequency signal (or second periodic signal); I is the aforementioned first coefficient, used to select from K reference pulse signals for frequency signal synthesis; r is the aforementioned second coefficient, used to control the probability of the first and second frequency signals occurring, where r controls T B The probability of occurrence, 1-r controls T A The probability of occurrence.

[0096] For example, if the control word I is 3 and r is 0.5, then in the first cycle, two reference pulse signals with a phase difference of 3Δ are selected from the K reference pulse signals, and then synthesized and output T. A =3Δ, in the second cycle, two reference pulse signals with a phase difference of 4Δ are selected, and then synthesized and output as T. B =4Δ, where Δ is the phase difference between any two adjacent signals in the K-channel reference pulse signals with uniform phase spacing.

[0097] In this embodiment, the control words can be either integers or decimals. Each control word can be divided into an integer part and a decimal part. The integer part can be used as the aforementioned first coefficient, and the decimal part as the aforementioned second coefficient to synthesize the pulse rate signal. For example, if the control word is 5.4, then the integer part is 5 and the decimal part is 0.4. As another example, if the control word is 6, then the integer part is 6 and the decimal part is 0.

[0098] Figure 10This is a schematic diagram illustrating the principle of pulse signal synthesis using a frequency synthesizer. (See also...) Figure 10 This frequency synthesizer uses the concept of time-averaged frequency to synthesize the output pulse signal. The following explanation uses the synthesis of the first frequency signal as an example: The frequency synthesizer receives a control word and K uniformly spaced reference pulse signals. The control word F = I + r, where I is the integer part and r is the fractional part; the phase difference between any two adjacent signals in the K uniformly spaced reference pulse signals is the basic time unit Δ. The frequency synthesizer first constructs two different clock periods T based on the basic time unit Δ and the integer part I in the control word F. A and T B T A =I·Δ,T B = (I+1)·Δ, T B Compared to T A The cycle is longer, in Figure 10 The middle is manifested as T B The length of the high level (or low level) is greater than T. A Long. Then, the frequency synthesizer controls T based on the fractional part r in the control word F. A and T B The probability of occurrence, that is, the ratio of the first frequency signal and the second frequency signal mentioned above, generates a pulse signal.

[0099] The decimal part of the control word affects T A and T B The probability of occurrence, when the decimal part is 0.5, is T. A and T B The probability of occurrence is equal, see Figure 10 The pulse signal shown, where T A and T B Alternating occurrences. When the decimal part is less than 0.5, T A The probability of occurrence is greater than T B A special case is when the decimal part is 0, the pulse signal only has T. A One component; when the decimal part is greater than 0.5, T B The probability of occurrence is greater than T A .

[0100] Figure 11 This is a schematic diagram of a frequency synthesizer provided in this disclosure. See also... Figure 11 The frequency synthesizer may include a first processing unit 21, a second processing unit 22, and an output unit 23.

[0101] The first processing unit 21 is connected to the controller 30 and generates a first control signal and a second control signal based on the control word. The second processing unit 22 is connected to the first processing unit 21 and selects a first pulse signal from a reference pulse signal with uniform phase intervals based on the first control signal, and selects a second pulse signal from the reference pulse signal based on the second control signal, and selects one of the first pulse signal and the second pulse signal as an output signal.

[0102] The output unit 23 is connected to the second processing unit 22 and generates the pulse signal based on the output signal of the second processing unit 22.

[0103] The following is combined with Figure 11 The detailed working process of the first processing unit 21, the second processing unit 22, and the output unit 23 is explained below:

[0104] The first processing unit 21 includes a first logic controller 211 and a second logic controller 212.

[0105] refer to Figure 11 The first logic controller 211 includes a first adder 2111, a first register 2112, and a second register 2113. The first register 2112 is connected to both the first adder 2111 and the second register 2113. The function of the first logic controller 211 is to generate a first control signal.

[0106] The first adder 2111 adds the control word F and the most significant bits (e.g., 5 bits) stored in the first register 2112, and then saves the sum to the first register 2112 at the rising edge of the second clock frequency CLK2; alternatively, the first adder 2111 can add the control word F and all bits stored in the first register 2112, and then save the sum to the first register 2112 at the rising edge of the second clock frequency CLK2. At the next rising edge of the second clock frequency CLK2, the most significant bit stored in the first register 2112 will be stored in the second register 2113 as the selection signal of the first K→1 multiplexer 221, i.e., the aforementioned first control signal, used to select one signal from the K uniformly spaced reference pulse signals as the first pulse signal.

[0107] When adding the control word F and the most significant bit stored in the first register 2112, assuming the value in the first register 2112 is less than 1, if there is a carry-over in the fractional part of the addition result, the most significant bit stored in the second register 2113 is I+1. If no carry-over occurs in the control word during addition, the most significant bit stored in the second register 2113 is I. When the value in the second register 2113 is I+1, the corresponding output of the frequency synthesizer is T.B = (I+1)·Δ, when the value in the second register 2113 is I, the corresponding output of the frequency synthesizer is T. A =I·Δ, which shows that the output T A Or T B The value is related to the size of the fractional part of the control word. The smaller the fractional part of the control word, the less likely a carry will occur, and the output will be T. A The higher the probability, the better; otherwise, output T. B The probability is high.

[0108] Here, the first register 2112 may include a first part for storing integers and a second part for storing decimals. During addition, the integer part of the control word F is added to the contents of the first part, and the decimal part of the control word F is added to the contents of the second part. The addition is a binary addition, implemented by an adder.

[0109] The second logic controller 212 includes a second adder 2121, a third register 2122, and a fourth register 2123. The third register 2122 is connected to both the second adder 2121 and the fourth register 2123. The function of the second logic controller 212 is to generate a second control signal.

[0110] The second adder 2121 adds half of the control word F / 2 to the most significant bit stored in the first register 2112, and then saves the sum to the third register 2122 at the rising edge of the second clock frequency CLK2. After saving the sum to the third register 2122, at the rising edge of the first clock frequency CLK1, the information stored in the third register 2122 is stored in the fourth register 2123 and used as the selection signal for the second K→1 multiplexer 222, i.e., the aforementioned second control signal, to select one signal from the K multi-phase input signals as the second pulse signal. The second clock frequency CLK2 is the signal obtained by passing the first clock frequency CLK1 through an NOT gate.

[0111] refer to Figure 11The second processing unit 22 includes a first K→1 multiplexer 221, a second K→1 multiplexer 222, and a 2→1 multiplexer 223. The first K→1 multiplexer 221 and the second K→1 multiplexer 222 each include multiple input terminals, control input terminals, and output terminals. The 2→1 multiplexer 223 includes a control input terminal, an output terminal, a first input terminal, and a second input terminal. The output of the first K→1 multiplexer 221 is connected to the first input of the 2→1 multiplexer 223, and the output of the second K→1 multiplexer 222 is connected to the second input of the 2→1 multiplexer 223. Multiple inputs of the first K→1 multiplexer 221 and multiple inputs of the second K→1 multiplexer 222 are connected to a signal generator. The control input of the first K→1 multiplexer 221 is connected to the second register 2113, and the control input of the second K→1 multiplexer 222 is connected to the fourth register 2123.

[0112] The control input terminal of the first K→1 multiplexer 221, under the control of the first control signal generated by the first logic controller 211, selects one signal from the K-channel reference pulse signals with uniformly spaced phases as the output signal, i.e., the first pulse signal; the control input terminal of the second K→1 multiplexer 222, under the control of the second control signal generated by the second logic controller 212, selects one signal from the K-channel reference pulse signals with uniformly spaced phases as the output signal, i.e., the second pulse signal.

[0113] Taking the first K→1 multiplexer as an example, when selecting the output signal, it can be selected according to the value stored in the second register 2113, that is, the value of the first control signal. For example, if the first control signal is 3, then the third path of the K-path reference pulse signals with uniform phase intervals is selected as the output.

[0114] The 2→1 multiplexer 223 can select one of the first pulse signal output from the first K→1 multiplexer 221 and the second pulse signal output from the second K→1 multiplexer 222 as the output signal of the 2→1 multiplexer 223 at the rising edge of the first clock frequency CLK1. For example, the selection of the first pulse signal can begin at the first rising edge and continue until the second rising edge, the selection of the second pulse signal can begin at the second rising edge and continue until the third rising edge, and so on.

[0115] Since the 2→1 multiplexer selects from the outputs of two K→1 multiplexers, and the outputs of the two K→1 multiplexers are combined to form a new cycle, and because the first and second pulse signals from the outputs of the two K→1 multiplexers differ by an integer number of Δ, with two possible cases of a difference of I Δ and a difference of I+1 Δ, the final pulse signal output by the frequency synthesizer contains T. A and TB Two different cycles.

[0116] refer to Figure 11 The output unit 23 includes a trigger circuit. The trigger circuit generates a pulse train. The trigger circuit includes a D flip-flop 231, a first inverter 232, and a second inverter 233. The D flip-flop 231 includes a data input terminal, a clock input terminal, and an output terminal. The first inverter 232 includes an input terminal and an output terminal. The second inverter 233 includes an input terminal and an output terminal. The clock input terminal of the D flip-flop 231 is connected to a 2→1 multiplexer 223, the data input terminal of the D flip-flop 231 is connected to the output terminal of the first inverter 232, and the output terminal of the D flip-flop 231 is connected to the input terminals of both the first inverter 232 and the second inverter 233. The output terminal of the D flip-flop 231 or the output terminal of the second inverter 233 can serve as the output terminal of a frequency synthesizer, i.e., one end that generates the pulse signal. Therefore, the pulse signal output by the frequency synthesizer is... Figure 11 The first clock frequency CLK1 or the second clock frequency CLK2.

[0117] In this embodiment of the disclosure, the first clock signal and the second clock signal are the first clock frequency CLK1 output by the frequency synthesizer when different control words are input. Alternatively, the first clock signal and the second clock signal are the second clock frequency CLK2 output by the frequency synthesizer when different control words are input.

[0118] The clock input of the D flip-flop 231 receives the output from the output of the 2→1 multiplexer 223 and outputs the first clock frequency CLK1 through the output terminal; the input of the first inverter 232 receives the first clock frequency CLK1 and outputs the output signal to the data input of the D flip-flop 231; the input of the second inverter 233 receives the first clock frequency CLK1 and outputs the second clock frequency CLK2 through the output terminal.

[0119] The relationship between the frequency Fo of the pulse signal output by the frequency synthesizer and the control word F is as follows: Figure 12 As shown, the relationship between the two is Fo = 1 / (F·Δ). It can be seen that when the phase difference Δ is constant, the frequency Fo is inversely proportional to the control word F, that is, the larger the control word, the smaller the frequency.

[0120] See you again Figure 4 The signal generator 40 is also connected to the controller 30;

[0121] The controller 30 is used to send an initial phase control command to the signal generator 40. The initial phase control command is used to control the initial phase of the reference pulse signal generated by the signal generator 40. The pulse signal output by the frequency synthesizer is different depending on the initial phase of the reference pulse signal.

[0122] The FIFO memory system provided in this disclosure can be integrated into a large number of chips as a digital intellectual property core (IPcore), thereby reducing the power consumption, area, and cost of the FIFO memory in the chip.

[0123] Figure 13 A flowchart of a FIFO memory control method provided in an embodiment of this disclosure is shown. See also... Figure 13 The method is executed by the aforementioned FIFO memory system, and the method includes:

[0124] Step 501: Determine the amount of data in the FIFO memory.

[0125] This step can be performed by Figure 1 The controller in the process executes.

[0126] For example, the controller is implemented using a programmable chip or other chip. The controller may include one or more computer-readable storage media, which may be non-transitory. The computer-readable storage media stores at least one line of program code, which is loaded and executed by the controller to implement the FIFO memory control method.

[0127] Step 502: When the amount of data in the FIFO memory is within a first range, control the read clock frequency circuit to output a first clock signal as the read clock of the FIFO memory; when the amount of data in the FIFO memory is within a second range, control the read clock frequency circuit to output a second clock signal as the read clock of the FIFO memory.

[0128] This step can be performed by Figure 1 The controller in the process executes.

[0129] Optionally, the lower limit of the first range is a first threshold, the upper limit of the first range is the capacity of the FIFO memory, the lower limit of the second range is 0, the upper limit of the second range is a second threshold, and the first threshold is greater than the second threshold; the method further includes:

[0130] When the amount of data in the FIFO memory is within a third range, the read clock of the FIFO memory is kept constant. The lower limit of the third range is the second threshold, and the upper limit of the third range is the first threshold.

[0131] Optionally, the ratio of the difference between the first threshold and the second threshold to the capacity of the FIFO memory is not less than 5% and not greater than 25%.

[0132] Optionally, the frequency of the first clock signal is greater than the frequency of the write clock of the FIFO memory, and the frequency of the second clock signal is less than the frequency of the write clock of the FIFO memory.

[0133] Optionally, when the amount of data in the FIFO memory is within a first range, controlling the read clock frequency circuit to output a first clock signal as the read clock of the FIFO memory; and when the amount of data in the FIFO memory is within a second range, controlling the read clock frequency circuit to output a second clock signal as the read clock of the FIFO memory, includes:

[0134] A control word is generated based on the amount of data in the FIFO memory;

[0135] The control word is output to the read clock frequency circuit so that the read clock frequency circuit responds to the control word and outputs the first clock signal or the second clock signal; both the first clock signal and the second clock signal include a first frequency signal and a second frequency signal, and the probability of the first frequency signal and the second frequency signal occurring is controlled by the control word.

[0136] Optionally, generating the control word based on the amount of data in the FIFO memory includes:

[0137] When the amount of data in the FIFO memory is within a first range, a first control word is generated, which is used to output the first clock signal. When the amount of data in the FIFO memory is within a second range, a second control word is generated, which is used to output the second clock signal.

[0138] Optionally, when the amount of data in the FIFO memory is within a second range, a second control word is generated, including:

[0139] When the amount of data in the FIFO memory is within a second range and the valid signal of the FIFO memory is at a low level, the generated control word is changed to reduce the frequency of the second clock signal according to a first rule. That is, in this embodiment of the disclosure, the second control word can be variable.

[0140] In this embodiment, the size of the control word is inversely proportional to the frequency of the second clock signal. That is, to control the frequency of the second clock signal to gradually decrease, the output control word needs to gradually increase.

[0141] Optionally, after receiving the control word, the clock frequency reading circuit generates a pulse signal in response to the reference pulse signal with uniformly spaced phases and the control word, wherein the pulse signal is either the first clock signal or the second clock signal;

[0142] The control word includes a first coefficient and a second coefficient;

[0143] The pulse signal includes a first frequency signal generated based on the reference pulse signal and a first coefficient, and a second frequency signal generated based on the reference pulse signal and the first coefficient. The proportion of the first frequency signal and the second frequency signal in the pulse signal is controlled by the second coefficient.

[0144] Optionally, determining the amount of data in the FIFO memory includes:

[0145] The amount of data in the FIFO memory is determined based on the flag bits output by the FIFO memory.

[0146] The above are merely exemplary embodiments of this disclosure and are not intended to limit this disclosure. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this disclosure shall be included within the scope of protection defined by the appended claims.

Claims

1. A first-in-first-out (FIFO) memory system, comprising: The FIFO storage system includes: FIFO memory; A clock frequency reading circuit is used to provide at least two clock signals, the at least two clock signals including a first clock signal and a second clock signal, wherein the frequency of the first clock signal is greater than the frequency of the second clock signal; A controller is configured to determine the amount of data in the FIFO memory; generate a control word based on the amount of data in the FIFO memory; when the amount of data in the FIFO memory is within a first range, control the read clock frequency circuit to output a first clock signal in response to the control word; or, when the amount of data in the FIFO memory is within a second range, control the read clock frequency circuit to output a second clock signal in response to the control word; both the first clock signal and the second clock signal include a first frequency signal and a second frequency signal, and the probability of the first frequency signal and the second frequency signal occurring is controlled by the control word; Wherein, the lower limit of the first range is not less than the upper limit of the second range; The clock frequency reading circuit includes: A frequency synthesizer is used to generate a pulse signal in response to a reference pulse signal with uniformly spaced phases and the control word, wherein the pulse signal is either the first clock signal or the second clock signal; The control word includes a first coefficient and a second coefficient; The pulse signal includes a first frequency signal generated based on the reference pulse signal and a first coefficient, and a second frequency signal generated based on the reference pulse signal and the first coefficient. The proportion of the first frequency signal and the second frequency signal in the pulse signal is controlled by the second coefficient.

2. The FIFO memory system of claim 1, wherein, The lower limit of the first range is a first threshold, the upper limit of the first range is the capacity of the FIFO memory, the lower limit of the second range is 0, the upper limit of the second range is a second threshold, and the first threshold is greater than the second threshold. The controller is also configured to control the clock signal output by the read clock frequency circuit to remain unchanged when the amount of data in the FIFO memory is within a third range, wherein the lower limit of the third range is the second threshold and the upper limit of the third range is the first threshold.

3. The FIFO memory system of claim 2, wherein, The ratio of the difference between the first threshold and the second threshold to the capacity of the FIFO memory is not less than 5% and not greater than 25%.

4. The FIFO memory system of claim 3, wherein, The frequency of the first clock signal is greater than the frequency of the write clock of the FIFO memory, and the frequency of the second clock signal is less than the frequency of the write clock of the FIFO memory.

5. The FIFO storage system of any one of claims 1 to 4, wherein, The controller is configured to control the generated control word change when the amount of data in the FIFO memory is within a second range and the effective signal of the FIFO memory is at a low level, so that the frequency of the second clock signal decreases according to a first rule.

6. The FIFO storage system of any one of claims 1 to 4, wherein, The controller is used to determine the amount of data in the FIFO memory based on the flag bit output by the FIFO memory.

7. A FIFO memory control method characterized by, The method is performed by the FIFO storage system of claim 1, and the method includes: Determine the amount of data in the FIFO memory; When the amount of data in the FIFO memory is within a first range, the read clock frequency circuit is controlled to output a first clock signal as the read clock of the FIFO memory; or, when the amount of data in the FIFO memory is within a second range, the read clock frequency circuit is controlled to output a second clock signal as the read clock of the FIFO memory. Wherein, the lower limit of the first range is not less than the upper limit of the second range.

8. The method of claim 7, wherein, The lower limit of the first range is a first threshold, the upper limit of the first range is the capacity of the FIFO memory, the lower limit of the second range is 0, the upper limit of the second range is a second threshold, and the first threshold is greater than the second threshold; the method further includes: When the amount of data in the FIFO memory is within a third range, the read clock of the FIFO memory is kept constant. The lower limit of the third range is the second threshold, and the upper limit of the third range is the first threshold.

9. The method according to claim 7 or 8, characterized in that, The step of generating a control word based on the amount of data in the FIFO memory includes: When the amount of data in the FIFO memory is within the second range and the effective signal of the FIFO memory is at a low level, the control word generated is changed so that the frequency of the second clock signal decreases according to the first rule.

10. The method according to claim 7 or 8, characterized in that, Determining the amount of data in the FIFO memory includes: The amount of data in the FIFO memory is determined based on the flag bits output by the FIFO memory.

Citation Information

Patent Citations

  • Transmission device and method for controlling FIFO circuit

    US20160202722A1