A synchronous FIFO verification method and device
By integrating the empty and full state detection of synchronous FIFOs into interrupt over-underflow verification, the integrated verification of multiple synchronous FIFOs is achieved, which solves the problem of time-consuming verification of multiple synchronous FIFOs in chip design, and improves verification efficiency and completeness.
Patent Information
- Application Number
- CN202411163745.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-23
- Publication Date
- 2024-11-15
- Estimated Expiration
- 2044-08-23
AI Technical Summary
In chip design, verification of multiple synchronous FIFOs takes a long time and is cumbersome to operate. Especially when the number of FIFOs is large, it is difficult for the prior art to efficiently verify the empty, full and interrupted states of the FIFO, resulting in inefficient verification of the verification work.
The detection of the empty and full state of the synchronous FIFO is integrated into the interrupt overflow verification. By defining macros and passing parameters, the verification steps are encapsulated to realize integrated verification of multiple synchronous FIFOs and improve verification efficiency.
It improves the efficiency of FIFO verification, ensures the completeness of verification, solves the problem of time-consuming and cumbersome verification caused by the large number of synchronous FIFO modules in the chip, and improves the working efficiency of UVM verification.
Smart Images

Figure CN118689722B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of chip verification, and in particular to a verification method and device for a synchronous FIFO. Background Art
[0002] FIFO (First In First Out) is a storage structure implemented with registers or random access memory (RAM). It uses a first-in, first-out method to store data streams in the data channel and undertakes the functions of data buffering and storage. In the process of chip design, FIFO is often found between different modules inside the chip. When a downstream module in the chip cannot process the data output by the upstream module in time, FIFO is needed to temporarily store data to prevent data loss. When the FIFO is full of data, a back pressure signal will be sent to the upstream module. At this time, the upstream module will stop sending data to the downstream module until the FIFO back pressure signal is revoked.
[0003] According to the clock domain in which FIFO works, it can be divided into synchronous FIFO and asynchronous FIFO. The read and write operations of synchronous FIFO are synchronized with the system clock, while asynchronous FIFO has independent read and write clock signals and is suitable for data transmission across clock domains.
[0004] Synchronous FIFO is usually controlled by credit. Specifically, when a piece of data is received from the upstream module in the synchronous FIFO, the credit value count is increased by one; each time a piece of data is sent to the subsequent module, the credit value count is reduced by one. When the credit value count reaches the agreed credit upper limit, a back pressure signal is generated. When the credit value count is less than the agreed credit upper limit, the back pressure signal is canceled. For chip verification work, it is mainly necessary to verify the three states of FIFO: empty, full, and interrupt. Among them, interrupts involve three scenarios: data overflow, data underflow, and data verification, which are respectively referred to as interrupt overflow, interrupt underflow, and interrupt verification.
[0005] Currently, when verifying a chip based on the Universal Verification Methodology (UVM), if multiple synchronous FIFOs are used in each module of the chip, the empty, full, and interrupt status of each synchronous FIFO must be verified separately inside the module, which is time-consuming and cumbersome. Especially when there are a large number of FIFOs, the verification takes even longer. Summary of the invention
[0006] The present invention aims to provide a synchronous FIFO verification method and device, which integrates the detection of the empty and full states of the synchronous FIFO into the interrupt overflow and underflow verification to ensure the completeness of the synchronous FIFO verification work.
[0007] To achieve the above object, the technical solution of the present invention is:
[0008] A verification method for a synchronous FIFO includes naming multiple synchronous FIFOs according to a naming rule; capturing the names of all synchronous FIFOs and finding the paths of all synchronous FIFOs in sequence; encapsulating the verification steps of a single synchronous FIFO in a macro, defining multiple parameters in the macro, using the macro to pass the corresponding parameters of the synchronous FIFO to each parameter in the macro, and running the macro to verify all synchronous FIFOs in sequence.
[0009] Furthermore, the verification steps for a single synchronous FIFO include,
[0010] Step S1, resetting the chip to be verified and performing an initialization check;
[0011] Step S2, checking the empty state, full state and interrupt overflow state of the synchronous FIFO;
[0012] Step S3, resetting and performing initialization check;
[0013] Step S4, checking the interrupt underflow state of the synchronous FIFO;
[0014] Step S5, resetting and performing initialization check;
[0015] Step S6, performing an interrupt verification check;
[0016] Step S7, complete all verification work of a single synchronous FIFO, and end.
[0017] Furthermore, reset and perform initialization check, specifically, perform logic reset and configuration reset on the chip to be verified, initialize internal signals and registers, use the backdoor to read the empty and full status registers and interrupt overflow and underflow registers of the corresponding FIFO, check whether the FIFO empty signal fifo_empty is 1, whether the FIFO overflow signal fifo_overflow and the FIFO underflow signal fifo_underflow are 0, and whether the FIFO count fifo_counter is 0.
[0018] Furthermore, the above step S2 includes:
[0019] Step S21, input a data and check the empty state of the synchronous FIFO;
[0020] Step S22, input n-1 data again to check the full state of the synchronous FIFO, where n is the depth of the synchronous FIFO;
[0021] Step S23, input a data to the synchronous FIFO and output a data at the same time, and check whether the synchronous FIFO has an overflow state without interruption;
[0022] Step S24, input a data again to check whether the synchronous FIFO has an interrupt overflow state.
[0023] Furthermore, the above step S4 includes:
[0024] Step S41, input a data into the synchronous FIFO and output a data at the same time, and check whether the synchronous FIFO is in an uninterrupted underflow state;
[0025] Step S42, let the synchronous FIFO output a data, and check whether the synchronous FIFO has an interrupt underflow state.
[0026] Furthermore, the above step S6 includes:
[0027] Step S61, grouping the data according to the table entry width, calculating the number of check data groups, inserting error check data into the check bit, and checking whether the check error signal is pulled high;
[0028] Step S62, after one beat, check whether the synchronous FIFO has an interrupt check error state, that is, whether the check error signal can be correctly transmitted to the interrupt check register;
[0029] Step S63, determine whether the number of verification times is less than the number of verification groups, if so, go to step S7; if not, return to step S61, add 1 to the number of verification times, and check the next group of data.
[0030] The present invention also provides a verification device for a synchronous FIFO, which applies the verification method for a synchronous FIFO as described above, and comprises a synchronous FIFO and a UVM verification environment, wherein the UVM verification environment is connected to the synchronous FIFO.
[0031] The above-mentioned UVM verification environment includes a data-driven module, a data comparison module and a reference model module. The data-driven module is used to send data to the synchronous FIFO and the reference model module. The synchronous FIFO and the reference model module receive the data sent by the data-driven module and perform logical processing. The processed data is sent to the data comparison module for comparison.
[0032] The present invention discloses a verification method and device for a synchronous FIFO. Compared with the previous method of detecting the empty, full and interrupted states of each synchronous FIFO individually, the contents to be verified by the synchronous FIFO are integrated into a set of complete methods, thereby improving the FIFO verification efficiency and ensuring the correctness of the FIFO module design. The invention can solve the problems of a large number of synchronous FIFO modules in a chip, a long time consumption and cumbersome operation for verifying the FIFO, thereby improving the work efficiency of UVM verification to a certain extent and ensuring the completeness of verifying the synchronous FIFO.
[0033] In order to make the above features and advantages of the invention more obvious and easy to understand, embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] Figure 1 It is a structural diagram of synchronous FIFO.
[0035] Figure 2 Schematic diagram of the access timing of the synchronous FIFO.
[0036] Figure 3 This is the schematic diagram of the synchronous FIFO interrupt check.
[0037] Figure 4 Flowchart of the verification steps for a single synchronous FIFO.
[0038] Figure 5 This is a flowchart of step S2.
[0039] Figure 6 This is a flowchart of step S4.
[0040] Figure 7 This is a flowchart of step S6.
[0041] Figure 8 This is a waveform diagram of the synchronous FIFO interrupt overflow.
[0042] Fig. 9 This is a waveform diagram of the synchronous FIFO interrupt check.
[0043] Fig.10 The present invention is a schematic diagram of the structure of a verification device for a synchronous FIFO. DETAILED DESCRIPTION
[0044] In order to make the purpose and technical solution of the embodiment of the present invention clearer, the technical solution of the embodiment of the present invention will be clearly and completely described below in conjunction with the drawings of the embodiment of the present invention. Obviously, the described embodiment is a part of the embodiment of the present invention, not all of the embodiments. Based on the described embodiment of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0045] Figure 1 Figure 1 is a schematic diagram of the structure of a synchronous FIFO. Figure 1As shown, the synchronous FIFO 1 includes a write-side module 11 and a read-side module 12. The credit control module of the synchronous FIFO is instantiated in the write-side module 11, and the synchronous FIFO is instantiated in the read-side module 12. The credit control module is used for credit counting. When the count value reaches the agreed credit upper limit, it is necessary to suspend writing data to the synchronous FIFO and wait for credit release. The credit upper limit is less than or equal to the depth n of the synchronous FIFO.
[0046] Furthermore, the write side module 11 outputs the FIFO write enable signal fifo_wen and the FIFO write data signal fifo_din to the read side module 12, and the read side module 12 outputs the FIFO credit release signal fifo_free to the write side module 11; the read side module 12 receives the FIFO read enable signal fifo_ren, and outputs the FIFO read data signal fifo_dout, the FIFO empty signal fifo_empty, the FIFO underflow signal fifo_underflow, and the FIFO overflow signal fifo_overflow.
[0047] In a specific embodiment, the read-side module 12 can output a FIFO underflow signal fifo_underflow and a FIFO overflow signal fifo_overflow to a subsequent interrupt statistics part.
[0048] Furthermore, the synchronous FIFO has the following characteristics: the FIFO data header is visible; it supports arbitrary depth, and it is recommended to use a power of 2 as the depth; the storage body supports dual-port RAM (DPRAM) or single-port RAM, where dual-port RAM means that both the read and write ports are synchronized by the clock, and single-port RAM means that the write port is synchronized by the clock and the read port is asynchronous.
[0049] Furthermore, the interface signals of the synchronous FIFO are shown in Table 1. The direction Input represents the input signal of the synchronous FIFO, and the direction Output represents the output signal of the synchronous FIFO.
[0050] Table 1 Synchronous FIFO interface signals
[0051] signal name direction describe clk Input Clock signal rst_n Input Reset signal, low effective fifo_wen Input FIFO write enable signal fifo_din Input FIFO write data signal fifo_ren Input FIFO read enable signal fifo_dout Output FIFO read data signal fifo_free Output FIFO credit release signal fifo_empty Output FIFO empty signal fifo_underflow Output FIFO underflow signal fifo_overflow Output FIFO overflow signal
[0052] Among them, the read and write pointers and status signals of the synchronous FIFO are generated by the credit control module of the synchronous FIFO. The empty, full, interrupt overflow and interrupt underflow status of the synchronous FIFO are judged by using the FIFO count fifo_counter to count the synchronous FIFO storage data. When only writing but not reading, the FIFO count fifo_counter is increased by 1; when only reading but not writing, the FIFO count fifo_counter is reduced by 1; when reading and writing at the same time or there is no reading and writing operation, the FIFO count fifo_counter remains unchanged.
[0053] More specifically, the status signals of the synchronous FIFO include: a FIFO empty signal fifo_empty, a FIFO overflow signal fifo_overflow, a FIFO underflow signal fifo_underflow, and a FIFO credit release signal fifo_free. The generation conditions of each status signal are as follows:
[0054] FIFO empty signal fifo_empty: When the synchronous FIFO is reset or the FIFO count fifo_counter is 0, the FIFO empty signal fifo_empty is set to 1.
[0055] FIFO overflow signal fifo_overflow: When the FIFO count fifo_counter is equal to the FIFO depth n, that is, the synchronous FIFO is full, a write is initiated at this time, then the synchronous FIFO overflows, and the FIFO overflow signal fifo_overflow is set to 1.
[0056] FIFO underflow signal fifo_underflow: When the FIFO count fifo_counter is equal to 0, that is, the FIFO is empty, a read is initiated at this time, and the synchronous FIFO underflow is set, and the FIFO underflow signal fifo_underflow is set to 1.
[0057] FIFO credit release signal fifo_free: Every time the FIFO receives a FIFO read enable signal fifo_ren, it outputs a FIFO credit release signal fifo_free.
[0058] Once the FIFO overflow signal fifo_overflow or the FIFO underflow signal fifo_underflow is set to 1, it indicates that a serious error has occurred in the synchronous FIFO and the synchronous FIFO cannot work normally.
[0059] Figure 2 The access timing of the synchronous FIFO is shown, which shows the access timing of the clock signal clk, the reset signal rst_n, the FIFO write enable signal fifo_wen, the FIFO write data signal fifo_din, the FIFO read enable signal fifo_ren, the FIFO read data signal fifo_dout, the FIFO credit release signal fifo_free, the FIFO empty signal fifo_empty, the FIFO underflow signal fifo_underflow, the FIFO overflow signal fifo_overflow, and the FIFO count fifo_counter in sequence.
[0060] Furthermore, the interrupt check of the synchronous FIFO mainly involves parity check, the principle is as follows Figure 3 As shown. According to the check width of 8 bits or 16 bits, a check bit of 1 bit is inserted on the basis of the original data, and 9 bits or 17 bits are used as a group to generate data with check code, and then the data after the check bit is inserted is bitwise XORed. If the result is 1, an interrupt is generated.
[0061] Among them, the verification rules include that before the data is written into the random access memory, a 1-bit check code is calculated for every N bits of original data and inserted, and written into the random access memory together with the original data. After reading the data from the random access memory, a parity check is first performed to check the check code. If a parity check error occurs, a check error interrupt is reported, and then the check code is stripped and the original data is returned. In this application, for tables with a table entry width greater than 32 bits, N is 16 bits, that is, a check code is generated for every 16 bits, and the number of remaining bits is checked according to the number of bits. For tables with a table entry width less than 32 bits, N is 8 bits, that is, a check code is generated for every 8 bits, and the number of remaining 8 bits is checked according to the number of 8 bits.
[0062] The following is an introduction to a verification method for a synchronous FIFO of the present invention. The verification method for a synchronous FIFO of the present invention includes naming multiple synchronous FIFOs according to a naming rule; capturing the names of all synchronous FIFOs and finding the paths of all synchronous FIFOs in sequence; encapsulating the verification steps of a single synchronous FIFO in a macro, defining multiple parameters in the macro, using the macro to pass the corresponding parameters of the synchronous FIFO to each parameter in the macro, running the macro, and verifying all synchronous FIFOs in sequence.
[0063] Furthermore, multiple parameters defined in the macro include,
[0064] The parameter ciu_reg_path indicates the interrupt status register;
[0065] The parameter overflow_bitnum indicates the bit of the FIFO overflow signal fifo_overflow in the register;
[0066] The parameter underflow_bitnum indicates the bit of the FIFO underflow signal fifo_underflow in the register.
[0067] The parameter status_reg_path indicates the FIFO empty and full status register;
[0068] The parameter status_bit indicates the bit of the FIFO empty signal fifo_empty in the register;
[0069] The parameter count_reg_path indicates the FIFO count register. If no count is reported, fill in "none";
[0070] The parameter count_bit indicates the bit of the FIFO count fifo_counter in the register. If no count is reported, fill it with 0.
[0071] The parameter fifo_path indicates the path of the synchronous FIFO;
[0072] The parameter fifo_wen indicates the FIFO write enable signal;
[0073] The parameter fifo_ren indicates the FIFO read enable signal;
[0074] The parameter fifo_counter indicates the FIFO count;
[0075] Parameter n indicates the FIFO depth;
[0076] The parameter rst_n_path indicates a logic reset;
[0077] The parameter rst_csr_n_path indicates configuration reset;
[0078] The parameter clk_path indicates the clock.
[0079] Among them, parameter ciu_reg_path, parameter overflow_bitnum, parameter underflow_bitnum, parameter status_reg_path, parameter status_bit, parameter count_reg_path, and parameter count_bit can be stored in the register form provided by the design.
[0080] Among them, parameter fifo_wen, parameter fifo_ren, parameter fifo_counter, and parameter n are interface signals of synchronous FIFO.
[0081] Among them, the parameter rst_n_path, the parameter rst_csr_n_path, and the parameter clk_path are fixed names of the internal signals of the synchronous FIFO.
[0082] In a specific embodiment, the naming convention of the synchronous FIFO may be in the form of the FIFO name inside the chip plus a number.
[0083] Furthermore, if Figure 4 As shown, the verification steps for a single synchronous FIFO include:
[0084] Step S1, reset the chip to be verified and perform an initialization check.
[0085] More specifically, before the verification begins, the chip to be verified is logically reset and configured reset, the internal signals and registers are initialized, and the backdoor is used to read the corresponding FIFO's empty and full status registers and interrupt overflow and underflow registers. It is checked whether the FIFO empty signal fifo_empty is 1, the FIFO overflow signal fifo_overflow and the FIFO underflow signal fifo_underflow are 0, and the FIFO count fifo_counter is 0. There is no data in the FIFO and the FIFO is in an empty state.
[0086] Step S2, checking the empty state, full state and interrupt overflow state of the synchronous FIFO.
[0087] For further information, please refer to Figure 5 , step S2 includes the following steps.
[0088] Step S21, input a data and check the empty state of the synchronous FIFO.
[0089] More specifically, use force to pull up the write enable, set the FIFO write enable signal fifo_wen to 1, write a data, at this time a data is stored in the synchronous FIFO, check whether the FIFO empty signal fifo_empty is 0, whether the FIFO overflow signal fifo_overflow and the FIFO underflow signal fifo_underflow are 0, and whether the FIFO count fifo_counter is 1.
[0090] Step S22, input n-1 data again and check the full state of the synchronous FIFO.
[0091] More specifically, continue to use force to pull up the write enable, set the FIFO write enable signal fifo_wen to 1, and write n-1 data, where n is the depth of the synchronous FIFO, that is, the agreed credit limit. At this time, the data in the synchronous FIFO should be full, check whether the FIFO overflow signal fifo_overflow and the FIFO underflow signal fifo_underflow are 0, and whether the FIFO count fifo_counter is n.
[0092] Step S23, input a data into the synchronous FIFO and output a data at the same time, and check whether the synchronous FIFO has an overflow state without interruption.
[0093] More specifically, use force to pull up the read enable and write enable at the same time, set the FIFO write enable signal fifo_wen to 1, the FIFO read enable signal fifo_ren to 1, write 1 data and read 1 data at the same time. At this time, the FIFO is still full and there is no overflow. Check whether the FIFO overflow signal fifo_overflow and the FIFO underflow signal fifo_underflow are 0, and whether the FIFO count fifo_counter is n.
[0094] Step S24, input a data again to check whether the synchronous FIFO has an interrupt overflow state.
[0095] More specifically, use force to pull up the write enable, set the FIFO write enable signal fifo_wen to 1, write a data, at this time the synchronous FIFO data overflows and is in overflow state, check whether the FIFO overflow signal fifo_overflow is 1, whether the FIFO underflow signal fifo_underflow is 0, and whether the FIFO count fifo_counter is n+1.
[0096] Step S3, reset again and perform initialization check.
[0097] More specifically, perform logic reset and configuration reset on the chip that needs to be verified, initialize internal signals and registers, use the backdoor to read the corresponding FIFO's empty and full status registers and interrupt overflow and underflow registers, check whether the FIFO empty signal fifo_empty is 1, whether the FIFO overflow signal fifo_overflow and the FIFO underflow signal fifo_underflow are 0, whether the FIFO count fifo_counter is 0, there is no data in the FIFO, and the FIFO is in an empty state.
[0098] Step S4, checking the interrupt underflow state of the synchronous FIFO.
[0099] For further information, please refer to Figure 6 , step S4 includes the following steps.
[0100] Step S41, input a data into the synchronous FIFO and output a data at the same time, and check whether the synchronous FIFO is in an uninterrupted underflow state.
[0101] More specifically, use force to pull up the read enable and write enable at the same time, set the FIFO write enable signal fifo_wen to 1, the FIFO read enable signal fifo_ren to 1, write 1 data and read 1 data at the same time. At this time, the synchronous FIFO is still in an empty state and there is no underflow state. Check whether the FIFO overflow signal fifo_overflow and the FIFO underflow signal fifo_underflow are 0, and whether the FIFO count fifo_counter is 0.
[0102] Step S42, let the synchronous FIFO output a data, and check whether the synchronous FIFO has an interrupt underflow state.
[0103] More specifically, use force to pull up the read enable, set the FIFO read enable signal fifo_ren to 1, read a data, and then the synchronous FIFO data underflows. Check whether the FIFO underflow signal fifo_underflow is 1 and whether the FIFO overflow signal fifo_overflow is 0.
[0104] At this point, the empty state, full state, and interrupt overflow state check of the synchronous FIFO are completed.
[0105] Step S5, resetting and performing initialization check again.
[0106] More specifically, perform logic reset and configuration reset on the chip that needs to be verified, initialize internal signals and registers, use the backdoor to read the corresponding FIFO's empty and full status registers and interrupt overflow and underflow registers, check whether the FIFO empty signal fifo_empty is 1, whether the FIFO overflow signal fifo_overflow and the FIFO underflow signal fifo_underflow are 0, whether the FIFO count fifo_counter is 0, there is no data in the FIFO, and the FIFO is in an empty state.
[0107] Step S6, performing an interrupt verification check.
[0108] For further information, please refer to Figure 7 , step S6 includes the following steps.
[0109] Step S61, grouping the data according to the data bit width, calculating the number of check data groups, inserting error check data into the check bit, and checking whether the check error signal is pulled high.
[0110] Step S62, after waiting for one beat, check whether the synchronous FIFO has an interrupt check error state, that is, whether the check error signal can be correctly transmitted to the interrupt check register.
[0111] Step S63, determine whether the number of verification times is less than the number of verification groups. If so, proceed to step S7; if not, return to step S61, add 1 to the number of verification times, and check the next group of data.
[0112] Step S7, complete all verification work of a single synchronous FIFO, and end.
[0113] In a specific embodiment, according to the data bit width, 16 bits of data can be grouped together to calculate the number of check data groups, insert "1" at the 17th bit after the check group to construct a check error, and check whether the check error signal is pulled high; after one beat, check whether the check error signal can be correctly transmitted to the interrupt check register; construct a check error for each group of check data in turn, and check the interrupt check register; at this point, all verification work of a single synchronous FIFO is completed.
[0114] Figure 8 This is a waveform diagram of the synchronous FIFO interrupt overflow. Figure 8 The left side shows the signal names in multiple synchronous FIFOs, the middle shows the instantaneous value of the signal, and the right side shows the change in the signal value in a continuous time sequence. When a synchronous FIFO overflows, the corresponding FIFO overflow signal fifo_overflow in the interrupt register will be pulled high, and the signal will maintain one clock beat; similarly, when a synchronous FIFO underflows, the corresponding FIFO underflow signal fifo_underflow in the interrupt register will be pulled high, and the signal will maintain one clock beat, ensuring that when a synchronous FIFO overflows or underflows, the erroneous signal can be correctly transmitted to the interrupt register, ensuring the completeness of the synchronous FIFO overflow and underflow verification work.
[0115] Fig. 9 This is a waveform diagram of the synchronous FIFO interrupt check. Fig. 9 On the left are the names of the check error signals of different check groups, the middle represents the instantaneous value of the signal, and the right represents the change in the signal value in a continuous time sequence. The signal par_chk_error_n represents a synchronous FIFO check error. When the check groups of the synchronous FIFO have check errors in sequence, from the 1st group to the 12th group, the corresponding signal par_chk_error_n will be pulled high for one beat to ensure that when a check error occurs in the synchronous FIFO, the erroneous signal can be correctly transmitted to the interrupt check register, thereby ensuring the completeness of the synchronous FIFO check verification work.
[0116] The present invention also provides a synchronous FIFO verification device, which applies the above-mentioned synchronous FIFO verification method, such as Fig.10 As shown, it includes a synchronous FIFO 1 and a UVM verification environment 2, and the UVM verification environment 2 is connected to the synchronous FIFO 1.
[0117] Further, UVM verification environment 2 comprises a data driver module 21, a data comparison module 22 and a reference model module 23, the data driver module 21 is used to send data to synchronous FIFO 1 and reference model module 23, synchronous FIFO 1 and reference model module 23 receive the data that the data driver module 21 sends and perform logic processing, and finally the processed data are sent to data comparison module 22 for comparison.
[0118] In a specific embodiment, the reference model module 23 is a code written in System Verilog, and the synchronous FIFO 1 is a code written in Verilog.
[0119] Although the present invention has been disclosed as above by way of embodiments, it is not intended to limit the present invention. Any person having ordinary knowledge in the technical field may make some changes and modifications without departing from the spirit and scope of the present invention. Therefore, the protection scope of the present invention shall be determined by the scope of the attached patent application.
Claims
1. A verification method for synchronous FIFO, It is characterized in that The method includes naming multiple synchronous FIFOs according to the naming rules; capturing the names of all synchronous FIFOs and finding the paths of all synchronous FIFOs in sequence; encapsulating the verification steps of a single synchronous FIFO in a macro, defining multiple parameters in the macro, using the macro to pass the corresponding parameters of the synchronous FIFO to each parameter in the macro, and running the macro to verify all synchronous FIFOs in sequence; The verification steps for a single synchronous FIFO include, Step S1, resetting the chip to be verified and performing an initialization check; Step S2, checking the empty state, full state and interrupt overflow state of the synchronous FIFO; Step S3, resetting and performing initialization check; Step S4, checking the interrupt underflow state of the synchronous FIFO; Step S5, resetting and performing initialization check; Step S6, performing an interrupt verification check; Step S7, complete all verification work of a single synchronous FIFO, and end; Reset and perform initialization check, specifically, perform logic reset and configuration reset on the chip to be verified, initialize internal signals and registers, use the backdoor to read the corresponding FIFO empty and full status registers and interrupt overflow and underflow registers, check whether the FIFO empty signal fifo_empty is 1, whether the FIFO overflow signal fifo_overflow and FIFO underflow signal fifo_underflow are 0, and whether the FIFO count fifo_counter is 0; The step S2 comprises: Step S21, input a data and check the empty state of the synchronous FIFO; Step S22, input n-1 data again to check the full state of the synchronous FIFO, where n is the depth of the synchronous FIFO; Step S23, input a data to the synchronous FIFO and output a data at the same time, and check whether the synchronous FIFO has an overflow state without interruption; Step S24, input a data again to check whether the synchronous FIFO has an interrupt overflow state; The step S4 comprises: Step S41, input a data into the synchronous FIFO and output a data at the same time, and check whether the synchronous FIFO is in an uninterrupted underflow state; Step S42, let the synchronous FIFO output a data, and check whether the synchronous FIFO has an interrupt underflow state; The step S6 comprises: Step S61, grouping the data according to the data bit width, calculating the number of check data groups, inserting error check data into the check bit, and checking whether the check error signal is pulled high; Step S62, after one beat, check whether the synchronous FIFO has an interrupt check error state, that is, whether the check error signal can be correctly transmitted to the interrupt check register; Step S63, determine whether the number of verification times is less than the number of verification groups, if so, go to step S7; if not, return to step S61, add 1 to the number of verification times, and check the next group of data.
2. A verification device for synchronous FIFO, It is characterized in that The application is a verification method for a synchronous FIFO as claimed in claim 1, comprising a synchronous FIFO and a UVM verification environment, wherein the UVM verification environment is connected to the synchronous FIFO.
3. A verification device for a synchronous FIFO as claimed in claim 2, It is characterized in that The UVM verification environment includes a data driving module, a data comparison module and a reference model module. The data driving module is used to send data to the synchronous FIFO and the reference model module. The synchronous FIFO and the reference model module receive the data sent by the data driving module and perform logical processing. The processed data is sent to the data comparison module for comparison.
