A method and system for reducing FIFO delay under the same source PLL clock

By calculating the read waiting time and optimizing the cross-clock domain logic, we ensure that the read and write address differences of the asynchronous FIFO are at the target depth, solving the problem of increased delay of the traditional asynchronous FIFO at high-speed clock frequencies and achieving controllability of the read and write depth. and system stability.

CN118567605BActive Publication Date: 2024-10-15SHANGHAI TAUREN SEMICON CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411044784.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-01
Publication Date
2024-10-15
Estimated Expiration
2044-08-01

AI Technical Summary

Technical Problem

Traditional asynchronous FIFO leads to increased data delay at high-speed clock frequencies, resulting in a decrease in system delay performance, and the read and write depth is uncontrollable, prone to depth waste.

Method used

By calculating the read and write clock frequency in the actual usage scenario of FIFO, calculating the read waiting time, and triggering the read enable control signal during the read waiting time, the cross-clock domain logic is optimized to ensure that the difference between the write address and the read address is maintained at the target depth. , reducing the delay of asynchronous logic, and handling empty and full alarms through static timing constraints and switching logic.

Benefits of technology

It achieves flexible control of read delays in different application scenarios, improves the timeliness of data transmission, ensures controllability of FIFO depth, and ensures stability and correctness in high-speed chip design.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118567605B_ABST
    Figure CN118567605B_ABST
Patent Text Reader

Abstract

The present invention discloses a method and system for reducing FIFO delay under a homologous PLL clock, including: calculating the read waiting time according to the read and write clock frequency under the actual scenario of FIFO; starting FIFO, triggering a read enable control signal after completing the write operation within the read waiting time; the read enable control signal passes through a routing delay, completes the cross-clock domain logic and the read address generation logic, and then starts the FIFO read operation; when the read clock is faster than the write clock, the write address is kept at a target depth after increasing the first count and the actual difference from the read address; when the read clock is approximately equal to or slower than the write clock, the FIFO is flipped after a depth overflow, and the write address and the read address difference are kept at the target depth. The embodiment of the present invention realizes the problem of different read delays in different application scenarios by controlling the read delay, so that when the FIFO system of the embodiment of the present invention is applied to data transmission, the user perception is significantly improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of read-write control of a FIFO memory, and in particular to a method and system for reducing FIFO delay under a homologous PLL clock. Background Art

[0002] As the chip area increases, the difficulty of making fully synchronous chips increases, and data transmission across clock domains becomes one of the essential key parts. Asynchronous FIFO ensures stable transmission of large-bit-width data across clock domains, making asynchronous FIFOs extremely widely used. Therefore, the application of cross-asynchronous FIFOs with the same source clock becomes a necessary method to solve chip synchronization.

[0003] The same source clock refers to different clocks generated by the same or different phase-locked loops. If the phase-locked loop works properly, the clocks on both sides are relatively stable and will not produce clock frequency deviation for a long time. At this time, the FIFO has a relatively stable working environment.

[0004] Due to the relative maturity of FIFO design, the traditional asynchronous FIFO will generate a certain delay for data. This delay is limited by the FIFO empty and full conditions, and is generally greater than 3 FIFO depths, thus introducing a fixed 3 data delay. If FIFOs are cascaded on the same path, the depth of the data delay is added, which reduces the timeliness of the transmitted data.

[0005] The design of traditional asynchronous FIFO consists of the following parts: data storage, implemented using registers or storage MEM; read address generation logic and generation of read empty alarm; write address generation logic and generation of write full alarm; asynchronous conversion logic from read address to write address; asynchronous conversion logic from write address to read address. As the clock frequency increases, the asynchronous conversion logic needs to be completed using more register cascade beats. For example, when the clock frequency is less than 300M, 2 registers are used to perform the asynchronous Gray code read and write signals, and when the clock frequency is greater than 300M, 3 or more registers are needed to perform the asynchronous Gray code read and write signals. In higher-speed logic, in order to ensure that no metastable problems occur after asynchronous operation, 4 or more registers need to be cascaded to perform the asynchronous Gray code read and write signals.

[0006] Among them, when the read empty alarm is generated, the current read address is compared with the write address after the asynchronous operation. If the write address after the asynchronous operation lags behind the real value, the read empty alarm will be generated earlier than the real empty alarm; when the full alarm is generated, the current write address is compared with the read address after the asynchronous operation. If the read address after the asynchronous operation lags behind the real value, the write full alarm will be generated earlier than the real full alarm. For example, the write address is generally larger than the read address, so when writing to address 3, address 0 is being read. However, when the write address 3 is propagated to the read clock domain, the read address 3 may have been read. Although the write address 6 is being written at this time, the address 3 propagated to the read side is used for comparison. Therefore, the read address catches up with the write address and reports empty.

[0007] The problems with traditional asynchronous FIFO design are:

[0008] If the number of over-asynchronous beats is too large, it is necessary to reserve a larger read and write address interval, that is, to stay away from the read empty and write full positions, resulting in a longer actual time from data writing to reading. However, if the number of over-asynchronous beats is reduced to reduce the read delay, the FIFO read empty or write full alarm will be triggered by mistake. In actual use, the read empty or write full alarm is needed as a system abnormality indication, which will cause system errors.

[0009] In addition, the prior art opens the read function at a fixed time after opening the write function. The complexity of different read and write clock frequency scenarios in actual scenarios leads to poor controllability of the read and write depth, and the read and write depth of the FIFO cannot be adjusted according to actual conditions. At the same time, there is no constraint on the delay of the asynchronous logic, which may lead to depth waste. Summary of the invention

[0010] One of the purposes of the present invention is to overcome the deficiencies in the prior art and to provide a method and system for reducing FIFO delay under a homologous PLL clock, making full use of the characteristics of the homologous clock to solve the problem that the data delay of the asynchronous FIFO in the prior art increases with the increase of the system clock frequency, further leading to a decrease in the system delay performance, and ensuring the stability and correctness of the system operation.

[0011] In order to solve the above technical problems, in a first aspect, an embodiment of the present invention provides a method for reducing FIFO delay under a homologous PLL clock, the method comprising:

[0012] S1. Calculate the read waiting time according to the read and write clock frequency in the actual use scenario of FIFO;

[0013] S2, start the FIFO, and after completing the write operation within the read waiting time, trigger the read enable control signal;

[0014] S3, the read enable control signal starts the FIFO read operation after the routing delay, the cross-clock domain logic and the read address generation logic are completed;

[0015] S4. When the read clock is faster than the write clock, the actual difference between the write address and the read address after the first count is increased remains at the target depth; when the read clock is slower than the write clock, the FIFO undergoes a depth overflow flip so that the difference between the write address and the read address remains at the target depth.

[0016] Preferably, the calculation of the read waiting time according to the read and write clock frequencies in the actual use scenario of the FIFO includes:

[0017] Tdata represents the time required for FIFO to read or write a data, Trclk represents the read clock cycle, Twclk represents the write clock cycle, and Tdata>=Trclk and Tdata>=Twclk. Assume that the FIFO target depth is aimDepth, and the read wait time is rd_dly.

[0018] When the write operation completes the read wait time value of the write data, the address comparator determines that the start condition of the read operation is met, and the read enable control signal under the write clock domain is pulled high. The read enable control signal passes through the routing delay and the clock domain synchronization logic 4~5 Trclk to start the read operation, that is, the read delay satisfies (rd_dly *Tdata + 4~5Trclk) / Tdata=target depth aimDepth+fifo storage depth*N, where N is 0 or 1, and converted into an inequality to obtain the following calculation formula:

[0019] When aimDepth-(5*Trclk) / Tdata<= rd_dly<= aimDepth-(4*Trclk) / Tdata and aimDepth=preset target depth is set, the inequality is solved to obtain rd_dly.

[0020] Furthermore, the method further comprises:

[0021] Static timing constraints are performed on the asynchronous processing from the Gray code write address to the read clock domain, and the static timing constraints are set to be less than or equal to the maximum routing delay.

[0022] Furthermore, the method further comprises:

[0023] When an empty or full alarm occurs in the FIFO, the empty or full alarm is transmitted to the back end by setting the switch logic, so that the system controls to lock the data or initiate an interrupt event.

[0024] In a second aspect, an embodiment of the present invention further provides a system for reducing FIFO delay under a homologous PLL clock, the system comprising:

[0025] A FIFO storage unit, a FIFO write address and full signal generating logic, a FIFO read address and empty signal generating logic, wherein the FIFO read address and empty signal generating logic includes a delay matching logic and a read accurate start logic, wherein the read accurate start logic includes: an address comparison logic and a cross-clock domain synchronization logic, wherein one end of the address comparison logic is connected to a FIFO write address pointer interface, and the other end is connected to a level conversion circuit, and when the address comparison logic determines that a write operation completes a read wait time value write operation, the level conversion circuit generates a read enable control signal in the write clock domain, and the read enable control signal is synchronized through a routing delay and a cross-domain read clock domain to generate a read operation signal.

[0026] Preferably, the calculation of the read waiting time includes:

[0027] Tdata represents the time required for FIFO to read or write a data, Trclk represents the read clock cycle, Twclk represents the write clock cycle, and Tdata>=Trclk and Tdata>=Twclk. Assume that the FIFO target depth is aimDepth, and the read wait time is rd_dly.

[0028] When the write operation completes the read wait time value of the write data, the address comparator determines that the start condition of the read operation is met, and the read enable control signal under the write clock domain is pulled high. The read enable control signal passes through the routing delay and the clock domain synchronization logic 4~5 Trclk to start the read operation, that is, the read delay satisfies (rd_dly*Tdata + 4~5Trclk) / Tdata=target depth aimDepth+fifo storage depth*N, where N is 0 or 1, and converted into an inequality to obtain the following calculation formula:

[0029] When aimDepth-(5*Trclk) / Tdata<= rd_dly<= aimDepth- (4*Trclk) / Tdata and aimDepth=preset target depth is set, the inequality is solved to obtain rd_dly.

[0030] Furthermore, the system also includes cross-clock domain synchronization logic, which performs static timing constraints on asynchronous processing of Gray code write addresses to read clock domains, and sets the static timing constraints to be less than or equal to the maximum routing delay.

[0031] Furthermore, the system also includes a switch logic, and when the FIFO has an empty or full alarm, the empty or full alarm is transmitted to the back end through the switch logic, so that the system controls the locking of data or initiates an interrupt event. In a third aspect, an embodiment of the present invention also provides an electronic device, including a processor and a memory, the memory is used to store a computer program, the computer program includes program instructions, and the processor is configured to call the program instructions to execute the above-mentioned method for reducing FIFO delay under the same source PLL clock.

[0032] In a fourth aspect, an embodiment of the present invention further provides a digital-analog hybrid chip, including an implementation system for reducing FIFO delay under the same source PLL clock as described above.

[0033] Compared with the prior art, the embodiments of the present invention have at least the following beneficial effects:

[0034] The embodiment of the present invention solves the problem of different read delays in different application scenarios by controlling the read delay, so that when the FIFO system of the embodiment of the present invention is applied to data transmission, the user perception is significantly improved, and the transmission of images and sounds is reflected in a more timely response, and what you see is what you get. In addition, when the read and write clocks are of the same source but different frequencies, the FIFO depth becomes controllable. At the same time, the embodiment of the present invention adds constraints to the design of asynchronous circuits, supplements the asynchronous uncontrollable problem of the original design, and ensures stability in high-speed, ultra-large-scale chip design. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] The preferred implementation modes will be described below in a clear and understandable manner with reference to the accompanying drawings to further illustrate the above-mentioned characteristics, technical features, advantages and implementation methods of the present invention.

[0036] Figure 1 It is a flow chart of a method for reducing FIFO delay under a homologous PLL clock according to an embodiment of the present invention;

[0037] Figure 2 It is a structural schematic diagram of a system for reducing FIFO delay under a homologous PLL clock according to an embodiment of the present invention;

[0038] Figure 3 It is a structural schematic diagram of the read delay and read empty signal logic generation according to another embodiment of the present invention;

[0039] Figure 4a 1 is a schematic diagram of FIFO depth under different read and write clocks of the FIFO system according to an embodiment of the present invention;

[0040] Figure 4b 1 is a schematic diagram of the read and write timing after the delay is added to the FIFO system of an embodiment of the present invention;

[0041] Figure 5a, Figure 5b They are respectively a timing diagram of the FIFO empty reading of the prior art and the FIFO empty reading of the embodiment of the present invention;

[0042] Figure 6 Schematic diagram of back-end control signals generated by empty and full alarms of a FIFO system according to an embodiment of the present invention;

[0043] Figure 7 It is a schematic diagram of the implementation of the FIFO system of an embodiment of the present invention. DETAILED DESCRIPTION

[0044] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the specific implementation methods of the present invention will be described below with reference to the accompanying drawings. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings and other implementation methods can be obtained based on these drawings without creative work.

[0045] In order to simplify the drawings, only the parts related to the invention are schematically shown in each figure, and they do not represent the actual structure of the product. In addition, in order to simplify the drawings and facilitate understanding, in some figures, only one of the parts with the same structure or function is schematically drawn or marked. In this article, "one" not only means "only one", but also means "more than one".

[0046] The following mainly takes some specific embodiments as examples to describe in detail the implementation of the technical solution of the present invention.

[0047] like Figure 1 As shown, a method for reducing FIFO delay under a homologous PLL clock in an embodiment of the present invention comprises:

[0048] S1. Calculate the read waiting time according to the read and write clock frequency in the actual use scenario of FIFO;

[0049] S2, start the FIFO, and after completing the write operation within the read waiting time, trigger the read enable control signal;

[0050] S3, after the read enable control signal passes through the routing delay and completes the cross-clock domain logic to the read address generation logic, the FIFO read operation is started;

[0051] S4. When the read clock is faster than the write clock, the actual difference between the write address and the read address after the first count is increased remains at the target depth; when the read clock is slower than the write clock, the FIFO undergoes a depth overflow flip so that the difference between the write address and the read address remains at the target depth.

[0052] The first count may be configured according to the relationship between the read clock frequency and the write clock frequency.

[0053] The embodiment of the present invention calculates the read start read wait time (rd_dly) according to the read clock and write clock frequencies in the actual use scenario of the FIFO;

[0054] Here, Tdata represents the time required for FIFO to write a data or read a data, Trclk represents the read clock cycle, and Twclk refers to the write clock cycle. Generally speaking, the time required to read and write data is greater than or equal to a read clock cycle and greater than or equal to a write clock cycle, that is, Tdata>=Trclk and Tdata>=Twclk.

[0055] Assume that in one case, the data reading and writing time is equal to one read clock cycle, that is, Tdata=Trclk, and the read clock is 3 write clock cycles, that is, Twclk=1 / 3*Trclk, then one data is written in three write clock cycles Twclk, and one data is read out in each read clock cycle Trclk.

[0056] like Figure 4b When the write operation completes rd_dly value (rd_dly) Tdata, the address comparator determines that the conditions for starting the read operation are met, and the read enable control signal under the write clock domain is pulled high (1 write clock). After the routing delay and the clock domain synchronization logic 4~5 Trclk, the read address operation is started.

[0057] Therefore, the total read delay is (rd_dly*Tdata+4~5Trclk) / Tdata=target depth aimDepth+fifo storage depth*N, where N is 0 or 1. Converting it into an inequality yields the following calculation method:

[0058] Assuming the FIFO target depth aimDepth, the single data transmission time is Tdata, the read clock cycle is Trclk, and the read waiting time is rd_dly, then aimDepth- (5*Trclk) / Tdata<= rd_dly<= aimDepth-(4*Trclk) / Tdata, when aimDepth=preset target depth is set, for example, the preset target depth is 2, and the inequality is solved to obtain rd_dly. The setting of the preset target depth in an embodiment of the present invention is determined according to the requirements of the actual application scenario of the FIFO. For example, when a lower data transmission delay is required, a lower value is set, and when a higher data transmission delay is required, a higher value is set.

[0059] Since the circular FIFO is allowed to fill up without being read, the configuration value is rd_dly=mod(rd_dly, fifoDepth).

[0060] However, in actual application scenarios, the target depth is not the same. This is because the clock frequencies in actual application scenarios cannot be determined. The embodiments of the present invention determine the target depth by setting the read wait time, so that the target depth is controllable, or a target depth can be set and then a configurable read wait time can be determined.

[0061] In step S2, the FIFO is started, and after writing rd_dly data, a read enable control signal is initiated. The read enable control signal undergoes a routing delay, and after completing the cross-clock domain synchronization logic to the read address generation logic, the FIFO reading is started.

[0062] Synchronization is the process of asynchronously transferring from one clock domain to another. The unit (bit) signal passes through more than two levels of registers. The higher the clock frequency, the more registers it passes through. Synchronous logic is used to ensure the stability of the signal in another clock domain.

[0063] For step S3, during circuit design, static timing constraints are used to set the read enable signal to meet the maximum routing delay max_delay before reaching the write clock domain. The maximum routing delay max_delay can be adjusted according to actual conditions, such as 500ps, or can be set to a smaller value when the clock frequency is particularly high. For example, taking the cascade of 4 registers as an example, when the clock frequency is higher, the value of the cascade of asynchronous synchronous registers will be larger.

[0064] For S4, Figure 4a As shown in the timing diagram in the upper part, if the read clock is faster than the write clock, the actual difference between the write address and the read address remains at the target depth after adding a small delay or zero delay number (first count). Figure 4a As shown in the timing diagram in the lower part, if the read clock is slower than the write clock, the delay of the first count is configured to be close to the FIFO depth. After the FIFO is flipped after the depth overflow, the write address still remains at the target depth compared to the read address. Here, the first count can be configured according to the relationship between the read clock and the write clock.

[0065] Further, in an embodiment of the present invention, considering that the asynchronous processing from the Gray code write address to the read clock domain needs to meet the static timing constraints, the embodiment of the present invention sets the static timing constraints to meet less than or equal to the maximum routing delay max_delay. Similarly, the maximum routing delay from the Gray code read address to the write clock domain must also meet less than or equal to the maximum routing delay max_delay.

[0066] Furthermore, considering that the FIFO does not generate an empty or full signal under normal working conditions, the FIFO generates an empty or full signal according to the actual situation only when an abnormality occurs in the system clock.

[0067] like Figure 5a , Figure 5b As shown, since the delay matching logic is added and the static asynchronous timing constraints are made in the embodiment of the present invention, the alarms for the read address and the write address are very close to the real situation, that is, the alarm is generated only when the write address is really the same as the read address. Figure 5a The original depth control produces a waste of FIFI depth, Figure 5b In this embodiment of the present invention, the FIFO depth is not wasted.

[0068] Furthermore, the embodiment of the present invention is provided with a switch, so that when the FIFO is empty or full, data is set or an interrupt event is initiated to shut down or restart the subsystem and the FIFO.

[0069] like Figure 6 As shown in the figure, a switch logic is set after the three registers of the data flow outside the FIFO. When the FIFO is empty or full, the output data is set to 0 and an alarm interrupt is reported. The system control locks the data or initiates an interrupt event to shut down or restart the subsystem and FIFO.

[0070] like Figure 2 As shown, an implementation system for reducing FIFO delay under a homologous PLL clock provided by an embodiment of the present invention comprises: a FIFO storage unit, a FIFO write address and full signal generation logic, a FIFO read address and empty signal generation logic, the FIFO read address and empty signal generation logic comprises a delay matching logic, and also comprises a read accurate start logic, the read accurate start logic comprises: an address comparison logic and a cross-clock domain synchronization logic, wherein one end of the address comparison logic is connected to a FIFO write address pointer interface, and the other end is connected to a level conversion circuit, when the address comparison logic determines that the write operation completes the write operation of reading the waiting time value, the level conversion circuit generates a read enable control signal in the write clock domain, and the read enable control signal is synchronized through a routing delay and a cross-domain read clock domain to generate a read operation signal.

[0071] The FIFO write address and full signal generation logic first starts the data FIFO write address. When the write data reaches the pre-configured read wait time numerical address, the address comparison logic generates a 1-bit read enable control signal. The read enable control signal starts the read address counter after routing delay and cross-clock domain synchronization (asynchronous from one clock domain to another clock domain).

[0072] The setting of the read wait time is calculated by the clock frequency of both the read and write sides, so as to ensure that the FIFO depth is small. The value of the read wait time is configured according to the actual application scenario of the FIFO to ensure that the FIFO depth is small when the function is started.

[0073] The specific calculation is as follows:

[0074] Assuming that there is a proportional relationship between the read and write clock frequencies during external read and write control, the effective duty cycle on the read side can be configured. For example, the read clock is 3 times faster than the write clock, and each clock of the write data is valid. When the read effective ratio is 1 / 3, the FIFO will not be empty or full, and the read delay satisfies (rd_dly *Tdata + 4~5Trclk) / Tdata=target depth aimDepth+fifo storage depth*N.

[0075] Assuming that the FIFO target depth is aimDepth, the single data transmission time is Tdata, the read clock cycle is Trclk, and the read wait time is rd_dly, then aimDepth – (5*Trclk) / Tdata<= rd_dly<= aimDepth –(4*Trclk) / Tdata is satisfied. When aimDepth=2 is set, the inequality solves rd_dly.

[0076] Since the circular FIFO is allowed to fill up while not being read, the configuration value for the read latency is rd_dly=mod(rd_dly, fifoDepth).

[0077] In the specific implementation, Figure 7 As shown, Figure 7 It is a schematic diagram of the implementation of the FIFO system of an embodiment of the present invention.

[0078] When the system is implemented, the back-end timing constraints still need to be considered to ensure that the asynchronous routing delay will not become an influencing factor. When the FIFO read and write addresses are close, false triggering or premature triggering of empty and full alarms will affect the use of FIFO, so the problem of false triggering or premature triggering of empty and full alarms needs to be solved. If the empty and full alarms do not occur during the operation of the FIFO, the FIFO depth can be made as small as possible.

[0079] Assuming the FIFO depth is 8, the read-write clock rate ratio is 20:1, after the write address is started, when the write address is greater than or equal to rd_dly, a read enable control signal is generated, and after a period of asynchronous delay, such as a fixed 4 read cycles, the data reading is started. Assuming that after writing 1 data, the read operation is started immediately, at this time, rd_dly is set to 1, and the time to start reading is 1+(4~5) / 20 cycles of the write clock, then the maximum FIFO depth is 1.2~1.25.

[0080] If the read-write clock rate ratio is 1:20, and rd_dly is set to 7, then when the write address reaches 1, a read enable signal is sent. After a period of asynchronous delay, for example, a fixed 4 read cycles, because the data rate is based on the slow read clock, the depth changes to 3~4. The time to start reading is 6+3~4 modulo 8 of the write clock, which is equal to 1~2 depth.

[0081] like Figure 3 As shown, for the read-empty generation logic, add Figure 3 The delay matching logic in the FIFO makes the comparison time of the read address and the write address consistent, instead of comparing them in advance, to avoid reporting pre-read empty due to the FIFO being too shallow during use.

[0082] Similarly, the logic for writing full is increased Figure 3 The read delay matching logic in the FIFO is used to prevent the FIFO from reporting pre-full due to too deep depth during use.

[0083] First, add delay matching logic to generate a read / write control signal after a period of time (this period is the read / write wait time, which is configurable) after writing (reading) data. The read / write wait time can be configured to adapt to various application scenarios and different backend situations.

[0084] Specifically, the FIFO obtains a write enable signal, counts the read delay (i.e., the read wait time, which can be configured from 0 to FIFO depth - 1), generates a read enable control signal in the write clock domain after the count is full, and opens the read operation after asynchronous operation.

[0085] Or the FIFO obtains a read enable signal, counts the read delay (i.e., the write wait time, which can be configured from 0 to FIFO depth - 1), and after the count is full, generates a write enable control signal in the read clock domain, and opens the write operation after the asynchronous operation.

[0086] like Figure 5b As shown, on the one hand, in the read empty generation logic, the delay of the read address is increased, and the delay of the read address matches the delay of the write address over-asynchronous, generating a real read empty alarm. On the other hand, similarly, in the write full generation logic, the delay of the write address is increased, and the delay of the write address matches the delay of the read address over-asynchronous, generating a real write full alarm. The principle and circuit design here are the same as those of the read delay implementation, and will not be repeated one by one.

[0087] In fact, the delay matching logic is to ensure that the real read empty or write full is generated and reported. Only the logic of the additional register cascade of the read / write address in the read / write clock domain is used to match the delay of the read / write address synchronization to the write / read clock domain through the clock domain synchronization.

[0088] The logic of waiting for the configured time to read here can be called the logic of controlling the read and write delay difference.

[0089] The embodiment of the present invention also adds a timing constraint for over-asynchronous operation in FIFO to reduce the uncertainty introduced by asynchronous logic. Specifically, the transition time from read address to write address is constrained, and the arrangement of over-asynchronous register cascades at the back end is fully utilized to control the delay of the first-level over-asynchronous logic to less than half a clock cycle.

[0090] The original FIFO empty and full design method is to compare the address on one side of the FIFO with the address on the other side asynchronously, that is, when the read address is compared with the transmitted write address, since the read address is newer and the write address is older (may be overwritten), if a read empty situation occurs at this time, it may not be a read empty. The same principle applies to the write full indication.

[0091] When FIFO is used in many high-speed data transmission scenarios, if it is empty or full, it is considered that the system clock is abnormal. Use the empty and full alarms to control the data in the subsequent circuits to stop calculating, and use the empty alarm / full alarm to prevent data from flowing into the subsequent chip.

[0092] An embodiment of the present invention also provides an electronic device, including a processor and a memory, wherein the memory is used to store a computer program, the computer program includes program instructions, and the processor is configured to call the program instructions to execute the method for reducing FIFO delay under the same source PLL clock as described above.

[0093] The embodiment of the present invention further provides a digital-analog hybrid chip, including the implementation system for reducing FIFO delay under the same source PLL clock as described above.

[0094] The embodiments of the present application are introduced in detail above. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method and core idea of ​​the present application. At the same time, for general technical personnel in this field, according to the idea of ​​the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

[0095] It should be noted that the above embodiments can be freely combined as needed. The above are only preferred embodiments of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications should also be regarded as the protection scope of the present invention.

Claims

1. A method for reducing FIFO delay under the same source PLL clock, characterized in that: The method comprises: S1. Calculate the read wait time according to the read and write clock frequencies in the actual use scenario of the FIFO, specifically including: use Tdata to represent the time required for the FIFO to read and write a data, Trclk to represent the read clock cycle, Twclk to represent the write clock cycle, and Tdata>=Trclk and Tdata>=Twclk, assuming that the FIFO target depth is aimDepth, and the read wait time is rd_dly; When the write operation completes the read wait time value of the write data, the address comparator determines that the start condition of the read operation is met, and the read enable control signal under the write clock domain is pulled high. The read enable control signal passes through the routing delay and the clock domain synchronization logic 4~5 Trclk to start the read operation, that is, the read delay satisfies (rd_dly*Tdata + 4~5Trclk) / Tdata=target depth aimDepth+fifo storage depth*N, where N is 0 or 1, and converted into an inequality to obtain the following calculation formula: When aimDepth-(5*Trclk) / Tdata <= rd_dly <= aimDepth- (4*Trclk) / Tdata and aimDepth=preset target depth, the inequality is solved to get rd_dly; S2, start the FIFO, and after completing the write operation within the read waiting time, trigger the read enable control signal; S3, after the read enable control signal has passed the routing delay and completed the cross-clock domain logic and the read address generation logic, the FIFO read operation is started, and the asynchronous processing of the Gray code write address to the read clock domain is subjected to static timing constraints, and the static timing constraints are set to be less than or equal to the maximum routing delay; S4. When the read clock is faster than the write clock, the actual difference between the write address and the read address after the first count is increased remains at the target depth; when the read clock is approximately equal to or slower than the write clock, the FIFO undergoes a depth overflow flip so that the difference between the write address and the read address remains at the target depth.

2. The method for reducing FIFO delay under the same source PLL clock as claimed in claim 1, characterized in that: The method further comprises: When an empty or full alarm occurs in the FIFO, the empty or full alarm is transmitted to the back end by setting the switch logic, so that the system controls to lock the data or initiate an interrupt event.

3. A system for reducing FIFO delay under the same source PLL clock, characterized in that: The system comprises: A FIFO storage unit, a FIFO write address and full signal generation logic, a FIFO read address and empty signal generation logic, wherein the FIFO read address and empty signal generation logic includes a delay matching logic and a read accurate start logic, wherein the read accurate start logic includes: an address comparison logic and a cross-clock domain synchronization logic, wherein one end of the address comparison logic is connected to a FIFO write address pointer interface, and the other end is connected to a level conversion circuit, and when the address comparison logic determines that the write operation completes the read wait time value write operation, the level conversion circuit generates a read enable control signal in the write clock domain, and the read enable control signal is synchronized through a routing delay and a cross-domain read clock domain to generate a read operation signal, wherein, The calculation of the read waiting time includes: Tdata represents the time required for FIFO to read or write a data, Trclk represents the read clock cycle, Twclk represents the write clock cycle, and Tdata>=Trclk and Tdata>=Twclk. Assume that the FIFO target depth is aimDepth, and the read wait time is rd_dly. When the write operation completes the read wait time value of the write data, the address comparator determines that the start condition of the read operation is met, and the read enable control signal under the write clock domain is pulled high. The read enable control signal passes through the routing delay and the clock domain synchronization logic 4~5 Trclk to start the read operation, that is, the read delay satisfies (rd_dly *Tdata + 4~5Trclk) / Tdata=target depth aimDepth+fifo storage depth*N, where, N is 0 or 1, and the following calculation formula is obtained by converting it into an inequality: When aimDepth-(5*Trclk) / Tdata <= rd_dly <= aimDepth- (4*Trclk) / Tdata and aimDepth=preset target depth, the inequality is solved to get rd_dly; The system further comprises: cross-clock domain synchronization logic, which performs static timing constraints on asynchronous processing of Gray code write addresses to read clock domains, and sets the static timing constraints to be less than or equal to a maximum routing delay.

4. The system for reducing FIFO delay under the same source PLL clock as claimed in claim 3, characterized in that: The system further comprises a switch logic. When an empty or full alarm occurs in the FIFO, the empty or full alarm is transmitted to the back end through the switch logic, so that the system controls to lock data or initiate an interrupt event.

5. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the memory is used to store a computer program, the computer program comprises program instructions, and the processor is configured to call the program instructions to execute the method for reducing FIFO delay under the same source PLL clock as claimed in any one of claims 1 to 2.

6. A digital-analog hybrid chip, characterized in that: A system for reducing FIFO delay under the same source PLL clock as described in any one of claims 3-4.