System and method for realizing pipelined clock by using FIFO (First In First Out) shift
By setting up the FIFO shift module between functional modules and configuring its series, the problem that existing simulation models cannot accurately analyze timing delays is solved, and the ability to accurately simulate and evaluate pipeline clock systems is realized, and the simulation efficiency is improved.
Patent Information
- Application Number
- CN202310648783.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-31
- Publication Date
- 2024-12-03
AI Technical Summary
Existing simulation models cannot accurately analyze timing delays when simulating hardware timing, resulting in the simulation being inconsistent with the actual situation and the inability to effectively evaluate the pipeline clock system.
Set up the FIFO shift module between the functional modules, and configure the number of stages of the FIFO shift module through the intercept layer module, perform pipeline shift operations to calculate the clock number, ensuring the accuracy of the timing logic.
It realizes the ability to accurately simulate hardware timing and evaluate pipeline clock system while maintaining simulation speed, improving the performance analysis efficiency of clock system.
Smart Images

Figure CN119065628A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of simulation technology, and in particular to a system and method for realizing pipeline clock by using FIFO shift. Background Art
[0002] The complex calculation model in the Function Module in the existing typical high-efficiency simulation model (such as C model) does not consider the pipeline delay in the hardware during the implementation process. Usually, due to the complexity of the combinational circuit and combinational logic in the hardware, only its internal functions are implemented and used as a "black box", which greatly improves the convenience. However, its disadvantage is that it cannot accurately and effectively simulate the timing in the hardware, so the Function model has no advantage in timing analysis.
[0003] When a Function Module with "black box" functionality is directly used as a Function Module Timer model, the following problems will occur:
[0004] There is a level t n =5-level pipeline function module is used as a "black box" in the current model that can analyze timing. When the input data time is T, the output data time must be T+t n , that is, T+5. The basic timing delay can be achieved by directly delaying the output of the "black box" by 5 cycles. However, if there are two consecutive cycles with input data at T0=0 and T1=1, it is usually necessary to input another data after one data input is completed. After the delay just achieved, the output data time is T0 ′ =T0+5,T1 ′ =T0+10, such as Figure 1 As shown; in actual hardware, the output data time should be T0 ′ =T0+5,T1 ′ =T1+5=T0+6, such as Figure 2 Obviously, when the continuous input data is output after being executed in the "black box", a simple delay in the "black box" will cause the simulated clock to be completely inconsistent with the actual situation.
[0005] In view of this, overcoming the defects of the prior art is an urgent problem to be solved in the field of this technology. Summary of the invention
[0006] The technical problem to be solved by the embodiment of the present invention is how to solve the problem that the timing cannot be directly and correctly analyzed within the functional module while ensuring the simulation efficiency.
[0007] The embodiment of the present invention adopts the following technical solution:
[0008] In a first aspect, the present invention proposes a system for implementing a pipeline clock using FIFO shifting, comprising a plurality of functional modules, a plurality of FIFO shifting modules and an interception layer module, wherein a FIFO shifting module is arranged between every two adjacent functional modules; the interception layer module is connected to the plurality of FIFO shifting modules;
[0009] Each of the FIFO shift modules is used to perform a pipeline shift operation on data and calculate the number of clocks;
[0010] The interception layer module is used to configure the number of stages of the multiple FIFO shift modules.
[0011] Preferably, each of the functional modules includes a SCHED module, an ICTRL module, a plurality of ALU pipelines and a plurality of registers;
[0012] A FIFO shift module with a number of S is configured between the SCHED module and the ICTRL module, a FIFO shift module with a number of I is configured between the ICTRL module and the ALU pipeline, and a FIFO shift module with a number of Ai is configured between the ALU pipeline and the corresponding register, wherein i=0, 1, ..., n, and n is the number of the ALU pipelines; the SCHED module is used to schedule data in the system and transmit the scheduled data to the ICTRL module;
[0013] The ICTRL module is used to parse the data transmitted by the SCHED module into instructions of the corresponding ALU pipeline, and distribute the instructions to the corresponding ALU pipeline;
[0014] The ALU pipeline is used to write the calculation result of the received instruction into the corresponding register.
[0015] Preferably, the FIFO shift module is used to perform a pipeline shift operation on data, specifically comprising:
[0016] Obtain the number M of depth units in the FIFO shift module, initialize the position flag of the depth unit in the FIFO shift module to 0, and sort the depth units according to the data transmission order, and the sorting order is 1, 2, ..., M, where M is a natural number greater than 0;
[0017] When the first data is input at time T, the first data is pulled into the depth unit with sequence number 1 in the FIFO shift module, and the position flag of the depth unit with sequence number 1 is updated to 1;
[0018] When the second data is input at time T+t, the first data is moved forward by t depth units, and the first data is pulled into the depth unit with sequence number t+1 in the FIFO shift module, the position flag of the depth unit with sequence number 1 is updated to 0, the position flag of the depth unit with sequence number t+1 is updated to 1, and the second data is pulled into the depth unit with sequence number 1, and the position flag of the depth unit with sequence number 1 is updated to 1;
[0019] When preparing for output, if the position mark in the depth unit with sequence number M in the current FIFO shift module is 0, the data in the FIFO shift module is moved forward one depth unit as a whole; if the position mark in the depth unit with sequence number M in the current FIFO shift module is 1, the corresponding data is output.
[0020] Preferably, the ALU pipeline is one or more of FOP, DOT, BIT, INT, CPX and MOV.
[0021] In a second aspect, the present invention further provides a method for implementing a pipeline clock using FIFO shifting, the method being used to construct the system for implementing a pipeline clock using FIFO shifting according to the first aspect, the method comprising:
[0022] A corresponding FIFO shift module is arranged between every two adjacent functional modules, the interception layer module is connected to the FIFO shift module, and the number of stages of the FIFO shift module is set;
[0023] The FIFO shift module is used to perform pipeline operation on the data in the system and calculate the clock number of the data to obtain the timing of data transmission.
[0024] Preferably, the functional module includes a SCHED module, an ICTRL module, a plurality of ALU pipelines and a plurality of registers, and the interception layer module is used to configure the number of stages of the FIFO shift module, and the FIFO shift module is used to perform a pipeline operation on the data to obtain the clock number of the data, which specifically includes: using the SCHED module to schedule the data in the system, and transmitting the scheduled data to the ICTRL module;
[0025] Utilize the ICTRL module to parse the data transmitted by the SCHED module into instructions of the corresponding ALU pipeline, and distribute the instructions to the corresponding ALU pipeline;
[0026] Using the ALU pipeline, the calculation result of the received instruction is written into the corresponding register;
[0027] The interception layer module is used to configure the corresponding FIFO shift module levels between the SCHED module and the ICTRL module, between the ICTRL module and the ALU pipeline, and between the ALU pipeline and the register, and the FIFO shift module is used to perform a pipeline clock shift operation on the data to obtain the clock number of the data.
[0028] Preferably, the using the FIFO shift module to perform a pipeline shift operation on the data further includes obtaining the timing delay corresponding to each FIFO shift module in the system, specifically including:
[0029] Inputting the test data into the system for simulation to obtain first simulation waveform data;
[0030] The input signal timing and the output signal timing in each FIFO shift module are extracted from the first simulation waveform data, and the clock number difference between the input signal timing and the output signal timing of each FIFO shift module is obtained.
[0031] Preferably, after constructing the system, the accuracy of the pipeline timing of the FIFO shift module in the system is verified by using the RTL model, specifically including:
[0032] Obtain a preset number of test data, input the test data into the RTL model in sequence for simulation, and obtain second simulation waveform data of the RTL model;
[0033] Inputting the test data into the system for simulation, and obtaining third simulation waveform data of the system;
[0034] Compare the second simulation waveform data with the third simulation waveform data, obtain the amount of data that is inconsistent between the second simulation waveform data and the third simulation waveform data according to the comparison structure, and calculate the first error percentage of the data amount in the test data;
[0035] A comparison threshold of the first error percentage is set. If the first error percentage is less than or equal to the comparison threshold, it means that the verification is passed; if the first error percentage is greater than the comparison threshold, it means that the verification is not passed, and the system is readjusted.
[0036] Preferably, the timing verification of the FIFO shift module in the system is performed by one or more of counting the time consumed by the length of data flowing into the FIFO shift module, counting the time consumed by the entire task, or counting the time consumed by the functional logic of each sub-stage corresponding to the task.
[0037] Preferably, after constructing the system, the method further includes using the system to perform simulation, specifically including:
[0038] Loading the pipeline operation configuration file in the system, and configuring the pipeline shift delay of each FIFO shift module;
[0039] Acquire data tasks to be simulated, and sort the data tasks to be simulated according to the order in which they are input into the system;
[0040] The data tasks to be simulated are input into the system for simulation in sequence according to the sorted serial numbers until the simulation of all the data tasks to be simulated is completed, and the start clock, end clock and corresponding simulation waveform data of each data task to be simulated are recorded at the end.
[0041] In the system of the present invention that uses FIFO shifting to implement pipeline clock, a FIFO shift module is added between every two adjacent functional modules, and the number of stages of the FIFO shift module is configured through an interception layer module. The FIFO shift module performs a pipeline shift operation on data and calculates the number of clocks, so that the FIFO shift module has correct pipeline timing logic, so that the pipeline clock system of the present invention has both the simulation speed of combinational logic and the ability to simulate the timing in hardware, and has the ability to evaluate the pipeline clock system. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0043] Figure 1 It is a schematic diagram of the structure of two delayed data transmission from a "black box" in a system of the prior art provided by an embodiment of the present invention;
[0044] Figure 2 It is a schematic diagram of a delay structure of simulating continuous input data by using a "black box" in a prior art system provided by an embodiment of the present invention;
[0045] Figure 3 It is an architecture diagram of a system for implementing a pipeline clock using FIFO shifting according to an embodiment of the present invention;
[0046] Figure 4 It is a specific architecture diagram of a system for implementing a pipeline clock using FIFO shifting provided by an embodiment of the present invention;
[0047] Figure 5 It is a flow chart of a method for implementing a pipeline clock using a FIFO shift module in a system for performing a pipeline operation on data, provided by an embodiment of the present invention;
[0048] Figure 6It is a schematic diagram of a FIFO shift module in a system that uses FIFO shifting to implement a pipeline clock and is used to perform a pipeline operation on data, provided by an embodiment of the present invention;
[0049] Figure 7 It is a flow chart of a method for implementing a pipeline clock using FIFO shifting provided by an embodiment of the present invention;
[0050] Figure 8 is a flow chart of a method for performing pipeline operation on data using the FIFO shift module provided by an embodiment of the present invention;
[0051] Fig. 9 It is a flow chart of a method for obtaining the timing delay corresponding to each FIFO shift module in a pipeline clock system in a system that uses FIFO shifting to implement a pipeline clock, provided by an embodiment of the present invention;
[0052] Fig.10 It is a waveform input and output diagram of a specific FIFO shift module in the system provided by an embodiment of the present invention;
[0053] Fig.11 It is a flow chart of a method for verifying the accuracy of the pipeline timing of the FIFO shift module in the system of the embodiment of the present invention by using the RTL model provided by the embodiment of the present invention;
[0054] Fig.12 is a flow chart of a method for performing simulation using a system according to an embodiment of the present invention provided by an embodiment of the present invention;
[0055] Fig.13 It is an ideal timing diagram of a plurality of continuous data passing through the system of the embodiment of the present invention in the embodiment of the present invention;
[0056] Fig.14 It is a diagram of the operation status of each model corresponding to the ideal timing of a plurality of continuous data passing through the system of the embodiment of the present invention within the implementation of the present invention. DETAILED DESCRIPTION
[0057] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0058] In the description of the present invention, the terms "inside", "outside", "longitudinal", "lateral", "upper", "lower", "top", "bottom" and the like indicate orientations or positional relationships that are shown in the accompanying drawings. They are only for the convenience of describing the present invention and do not require that the present invention must be constructed and operated in a specific orientation. Therefore, they should not be understood as limitations on the present invention.
[0059] In addition, the technical features involved in the various embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.
[0060] The embodiment of the present invention provides a system for implementing a pipeline clock using FIFO shifting, such as Figure 3 As shown, it includes multiple functional modules, multiple FIFO shift modules and an interception layer module, and a FIFO shift module is arranged between every two adjacent functional modules; the interception layer module is connected to the multiple FIFO shift modules;
[0061] Each FIFO shift module is used to perform pipeline shift operations on data and calculate the number of clocks;
[0062] The interception layer module is used to configure the number of stages of multiple FIFO shift modules.
[0063] like Figure 3 As shown, in the system of realizing pipeline clock using FIFO shift of the present invention, by adding FIFO shift module between every two adjacent functional modules, and configuring the number of stages of FIFO shift module through interception layer module, FIFO shift module performs pipeline shift operation on data, and calculates the number of clocks, so that FIFO shift module has correct pipeline timing logic, so that pipeline clock system of the present invention has both simulation speed of combinational logic and can simulate the timing in hardware, and has the ability to evaluate pipeline clock system. It is worth noting that the interception layer module of the embodiment of the present invention is connected to different FIFO shift modules in the form of interface, no matter how complex the functional module is, how many pipeline stages are inside the functional module, FIFO shift module can be dynamically embedded between adjacent functional modules, and then the overall controllable effect can be achieved. When the function of any functional module changes, it is only necessary to dynamically adjust the configuration information according to the change of the level of the corresponding FIFO shift module of the functional module, so as to achieve the effect of dynamic controllability. At the same time, a dynamic analysis mechanism of module level can be introduced on this basis, which can help analyze the overall performance bottleneck. The results are then fed back to adjust the hierarchical changes of functional modules to achieve a stable and efficient pipeline system.
[0064] It is understandable that the configuration information here can be managed accordingly according to the real hardware pipeline level of the RTL model. In order to more clearly illustrate the effect of the embodiment of the present invention, a specific example is given below: for example, the default parameter of the pipeline level of the FIFO shift module between a current ALU pipeline and the corresponding register is 5. At this time, if the pipeline level of the FIFO shift module needs to be dynamically adjusted to 6, the modification of this parameter can be passed through the interface between the interception layer module and the ALU pipeline, thereby achieving the modification effect; similarly, the pipeline levels of other FIFO shift modules can be modified accordingly by the interception layer module.
[0065] According to the embodiment of the present invention, each functional module divides the data processing function, such as Figure 4 As shown, in some embodiments, the functional module includes a SCHED module, an ICTRL module, a plurality of ALU pipelines, and a plurality of registers;
[0066] A FIFO shift module with a number of S is configured between the SCHED module and the ICTRL module, a FIFO shift module with a number of I is configured between the ICTRL module and the ALU pipeline, and a FIFO shift module with a number of Ai is configured between the ALU pipeline and the corresponding register, wherein i=0, 1, ..., n, and n is the number of the ALU pipelines; the SCHED module is used to schedule data in the system and transmit the scheduled data to the ICTRL module;
[0067] The ICTRL module is used to parse the data transmitted by the SCHED module into instructions of the corresponding ALU pipeline, and distribute the instructions to the corresponding ALU pipeline;
[0068] The ALU pipeline is used to write the calculation result of the received instruction into the corresponding register.
[0069] like Figure 4As shown, in the system for implementing pipeline clock using FIFO shifting according to the embodiment of the present invention, an interception layer module and a first preset number of FIFO shift modules are provided, and the FIFO shift modules are used to perform pipeline operations on data and calculate the number of clocks; the SCHED module, the ICTRL module and the ALU pipeline are all provided with corresponding levels of FIFO shift modules, and when any one or more values in the S, I, A0, ..., An levels in the FIFO shift module change, the internal clock pipeline of each module will be affected, thereby affecting the running timing of the entire model; for example, assuming that there are currently three ALU pipelines, ALU0, ALU1 and ALU 2, the execution of ALU1 needs to rely on the calculation result of ALU0, and the execution of ALU2 needs to rely on the calculation result of ALU1. At this time, the pipeline level of ALU1 changes, which will affect the moment when the calculation result of ALU0 enters ALU1 and the moment when the calculation result of ALU1 enters ALU2. It is worth noting that, referring to Figure 3 and Figure 4 As shown, although Figure 4 ALU0, ALU1, ..., ALUn presented in the figure are similar to parallel connection. When the pipeline level of the FIFO shift module between ALU0 and register 0 changes, it seems that the timing of data processing of the FIFO shift modules between ALU1 and register 1, ALU1 and register 2, ..., ALUn and register n will not be affected. However, there is a dependency relationship in the actual application of the embodiment of the present invention. For example, register 1 depends on the data of register 0. When the branch corresponding to ALU0 (see Figure 4 As shown, the branch corresponding to ALU0 represents the FIFO shift module in the branch from the SCHED module to register 0 (see Figure 4 , including FIFO shift modules with stages S, I and A0) changes, it will affect the pipeline timing of the data stored in register 0. When register 1 processes data, due to the dependency on the data in the branch corresponding to register 0 (that is, register 1 needs to use the data in register 0), after the pipeline timing of data processing in the register 0 branch changes, the pipeline timing obtained by the corresponding register 1 branch will also change. In addition, the dependency relationship between registers in the embodiment of the present invention is not only the dependency between adjacent registers. For example, register 2 may also depend on the timing of the data in register 0. It is worth noting that the pipeline stage of the FIFO shift module actually corresponds to the embodiment of the present invention, which actually also represents the depth in the FIFO shift module. See. Figure 6 As shown, the FIFO shift module has 6 pipeline stages and a depth of 6.
[0070] In the FIFO shift-based pipeline clock system of the embodiment of the present invention, an interception layer module is set to control all FIFO shift modules, so that the configuration information of the pipeline operation can be implanted into the FIFO shift modules of each module while the functional logic of the entire model remains unchanged, thereby achieving a dynamically controllable effect. In addition, the number of FIFO shift modules in the embodiment of the present invention is n+3, wherein the value of n is determined by the number of functional modules or ALU pipelines in the pipeline clock system, and each ALU pipeline corresponds to a register. The ALU pipeline of the embodiment of the present invention is one or more of FOP, DOT, BIT, INT, CPX and MOV. It is worth noting that the number of stages of the FIFO shift module in the embodiment of the present invention, for example, S, I and Ai represent the number of pipeline stages in the FIFO shift module (see Figure 6 In the figure, the pipeline stage number is 6), it should be understood that S, I and Ai respectively represent the pipeline stages in the corresponding FIFO shift module, which represent specific numbers.
[0071] In order to elaborate on the complete solution of the embodiment of the present invention, the details of the embodiment of the present invention are elaborated in detail below. The FIFO shift module of the embodiment of the present invention is used to perform a pipeline shift operation on data, such as Figure 5 and Figure 6 As shown, specifically including:
[0072] Step 201: obtain the number M of depth units in the FIFO shift module, initialize the position flags of the depth units in the FIFO shift module to 0, and sort the depth units into 1, 2, ..., M according to the data transmission order, where M is a natural number greater than 0.
[0073] Among them, the FIFO shift-based pipeline clock system of the embodiment of the present invention includes n+3 FIFO shift modules, and each FIFO shift module includes its own number of depth units. When the position mark of the depth unit in the FIFO shift module is 0, it means that there is no corresponding data in the depth unit at this moment, that is, the depth unit is empty; when the position mark of the depth unit in the FIFO shift module is 1, it means that the depth unit stores the corresponding data at this time, that is, the depth unit is in an occupied state.
[0074] Step 202: when the first data is input at time T, the first data is pulled into the depth unit with sequence number 1 in the FIFO shift module, and the position flag of the depth unit with sequence number 1 is updated to 1.
[0075] When data is input into the FIFO shift module of the embodiment of the present invention, it is first input from the depth unit with the sequence number 1 of the FIFO shift module, and finally output from the depth unit with the sequence number M. In each cycle (also called clock) unit, the data is shifted forward by 1 depth unit from the FIFO shift module. The FIFO shift module of the embodiment of the present invention includes M depth units, and it takes M+1 cycles (or clocks) for data to be completely output from the FIFO shift module after it is just entered.
[0076] Step 203: When the second data is input at time T+t, the first data is moved forward by t depth units, and the first data is pulled into the depth unit with sequence number t+1 in the FIFO shift module, the position flag of the depth unit with sequence number 1 is updated to 0, the position flag of the depth unit with sequence number t+1 is updated to 1, and the second data is pulled into the depth unit with sequence number 1, and the position flag of the depth unit with sequence number 1 is updated to 1.
[0077] Among them, when the first data and the second data are input in a discontinuous state, that is, the second data are input with a difference of t cycles, there are t "bubbles" between the second data (each "bubble" corresponds to a depth unit with a position standard of 0). When the second data is input, the position standard of the depth unit with sequence number 1 is first updated to 0, and then the second data is input into the depth unit with sequence number 1, and the position standard is updated to 1.
[0078] Step 204: When preparing for output, if the position mark in the depth unit with sequence number M in the current FIFO shift module is 0, the data in the FIFO shift module is moved forward by one depth unit as a whole; if the position mark in the depth unit with sequence number M in the current FIFO shift module is 1, the corresponding data is output.
[0079] Among them, when data is output, by checking the position standard in the depth unit with serial number M (the depth unit with the last serial number) in the FIFO shift module, when the position mark of the depth unit with serial number M is 1, it means that there is data occupying the depth unit, and the data is output at this time; when the position mark of the depth unit with serial number M is 0, it means that the depth unit with serial number M is in a vacant state at this time, and the data is output at this time, and the data in the FIFO shift module is shifted forward by one depth unit as a whole, and the corresponding position standard is updated.
[0080] The system of the present invention that uses FIFO shifting to implement pipeline clocking adds a FIFO shifting module within a functional module, and the FIFO shifting module performs a pipeline shifting operation on data, so that the FIFO shifting module has pipeline timing logic, so that the pipeline clock system of the present invention has both the simulation speed of combinational logic and the ability to simulate the timing in hardware, and has the ability to evaluate the pipeline clock system.
[0081] The present invention also proposes a method for implementing a pipeline clock using FIFO shifting, the method being used to construct a system for implementing a pipeline clock using FIFO shifting, such as Figure 7 As shown, the method includes:
[0082] Step 301: a corresponding FIFO shift module is set between every two adjacent functional modules, an interception layer module is connected to the FIFO shift module, and the number of stages of the FIFO shift module is set.
[0083] The process of setting the FIFO shift module between the functional modules and the number of stages of the FIFO shift module in the embodiment of the present invention has been described above and will not be described in detail here.
[0084] Step 302: Use the FIFO shift module to perform pipeline operation on the data in the system, and calculate the clock number of the data to obtain the timing of data transmission.
[0085] The embodiment of the present invention calculates the output transmission timing and the number of clocks of the data by acquiring the input timing and the output timing in the data input function module.
[0086] The functional modules of the embodiment of the present invention include a CHED module, an ICTRL module, multiple ALU pipelines and multiple registers. The interception layer module configures the number of stages of the FIFO shift module, and uses the FIFO shift module to perform pipeline operations on data to obtain the clock number of the data, such as Figure 8 As shown, specifically including:
[0087] Step 401: Utilize the SCHED module to schedule data in the system, and transfer the scheduled data to the ICTRL module.
[0088] Step 402: Utilize the ICTRL module to parse the data transmitted by the SCHED module into instructions corresponding to the ALU pipeline, and distribute the instructions to the corresponding ALU pipeline.
[0089] Step 403: Use the ALU pipeline to write the calculation result of the received instruction into the corresponding register.
[0090] Step 404: Use the interception layer module to configure corresponding FIFO shift module levels between the SCHED module and the ICTRL module, between the ICTRL module and the ALU pipeline, and between the ALU pipeline and the register, and use the FIFO shift module to perform a pipeline clock shift operation on the data to obtain the clock number of the data.
[0091] For steps 401 to 404, the corresponding explanations have been made above, and will not be repeated here. It should be noted in particular that for the data in the SCHED module scheduling system in step 401, the data in the system here does not refer to the data in the pipeline clock system, but represents the test data to be input into the pipeline clock system or the data to be simulated. In an embodiment of the present invention, a method for implementing a pipeline clock by using FIFO shifting is used to build a system that implements a pipeline clock by using FIFO shifting. A FIFO shift module is added to the built system, and the FIFO shift module performs a pipeline shift operation on the data, so that the FIFO shift module has a pipeline timing logic, so that the pipeline clock system of the present invention has both the simulation speed of the combinational logic and the ability to simulate the timing in the hardware, and has the ability to evaluate the pipeline clock system. It is worth noting that the setting of the interception layer module and the FIFO shift module in the embodiment of the present invention has been described above, and will not be repeated here.
[0092] In order to elaborate on the complete scheme of the embodiment of the present invention, the details of the implementation method of the embodiment of the present invention are elaborated in detail below. The pipeline clock system based on FIFO shifting of the embodiment of the present invention is actually a simulation model, which is mainly used to simulate data. In order to make the pipeline clock system based on FIFO shifting of the embodiment of the present invention have specific simulation functions, the embodiment of the present invention uses the FIFO shifting module to perform the pipeline clock shifting operation on the data, and also includes obtaining the timing delay corresponding to each FIFO shifting module in the pipeline clock system, such as Fig. 9 As shown, specifically including:
[0093] Step 501: input test data into the system for simulation to obtain first simulation waveform data.
[0094] The first simulation waveform data of the embodiment of the present invention includes data information, data input timing information, and data output timing information.
[0095] Step 502: extracting the input signal timing and the output signal timing in each FIFO shift module from the first simulation waveform data, and obtaining the clock number difference between the input signal timing and the output signal timing of each FIFO shift module.
[0096] Among them, by parsing the second simulation data through the ICTRL module, the input signal timing and output signal timing corresponding to each FIFO shift module can be obtained, and the clock number difference between each FIFO shift module can be obtained through the difference between the input signal timing and the output signal timing.
[0097] like Fig.10 As shown, it represents a waveform input and output diagram of a specific FIFO shift module of the pipeline clock system of the present invention, Fig. 9 In is the input enable signal of a module, din is the input data; out is the output enable signal of the module. The in and out signals are one-to-one corresponding, that is, the clock cycle between a group of adjacent in and out is the time consumption of the data processing logic of the module. For example Fig.10 As shown, △t1 is the time to process the first input data v1, which is 2 clock cycles, and △t2 is the time to process the second input data v2, which is 1 clock cycle. Record the input enable signal and output enable signal corresponding to each data according to the input order of the data; when the input enable signal of the data is at a high level, start timing to obtain the input signal timing of the corresponding data; when the output enable signal of the data is at a high level, the timing ends and the output signal timing of the corresponding data is obtained. Fig.10 As shown, when the input enable signal (in) of the embodiment of the present invention is at a high level, that is, at a rising edge, it indicates an input, and when the output enable signal (out) is at a high level, it indicates output of the module.
[0098] After the system is constructed, the embodiment of the present invention further includes using the RTL model to verify the accuracy of the pipeline timing of the FIFO shift module in the system, such as Fig.11 As shown, specifically including:
[0099] Step 601: Obtain a preset number of test data, input the test data into the RTL model in sequence for simulation, and obtain second simulation waveform data of the RTL model; input the test data into the system for simulation, and obtain third simulation waveform data of the system.
[0100] Among them, the ICTRL module in the system described in the embodiment of the present invention verifies the delay of the FIFO shift module in the system, and compares the results of simulation of the same source data by comparing the RTL model and the system of the embodiment of the present invention, and inputs the test data into the RTL model and the system of the embodiment of the present invention respectively to obtain the second simulation waveform data of the RTL model and the third simulation waveform data of the system of the embodiment of the present invention.
[0101] Step 602: compare the second simulation waveform data with the third simulation waveform data, obtain the inconsistent data volume between the second simulation waveform data and the third simulation waveform data according to the comparison structure, and calculate the first error percentage of the data volume in the test data.
[0102] Among them, before using the second simulation waveform data to compare with the third simulation waveform data, it is also necessary to use the ICTRL module to parse the second simulation waveform data and the third simulation waveform data, and compare the third simulation waveform data of the system of the embodiment of the present invention with the second simulation waveform data of the RTL model through the ICTRL module, calculate the amount of data inconsistent with the RTL model in the system of the embodiment of the present invention, and divide the inconsistent data amount by the total amount of data in the system of the embodiment of the present invention to calculate the first error percentage in the pipeline clock system. It is worth noting that when calculating the amount of data inconsistent with the RTL model in the system of the embodiment of the present invention, each sub-data in the test data is used as a unit for calculation, rather than the memory size occupied by the data amount.
[0103] Step 603: Set a comparison threshold of the first error percentage. If the first error percentage is less than or equal to the comparison threshold, it means that the verification is passed; if the first error percentage is greater than the comparison threshold, it means that the verification fails and the system is readjusted.
[0104] Among them, after obtaining the system of the embodiment of the present invention, by comparing the set comparison threshold with the first error percentage, it is possible to obtain whether the system of the embodiment of the present invention is qualified. The setting of the comparison threshold of the embodiment of the present invention is set according to the actual situation. In addition, the timing verification of the FIFO shift module in the system of the embodiment of the present invention is one or more of the time consumption of the length of the data flowing into the FIFO shift module, the overall statistical time consumption of the task, or the time consumption of each sub-stage functional logic corresponding to the task. It is worth noting that the SCHED module of the embodiment of the present invention is mainly used for data scheduling, scheduling test data or data to be simulated, and the test data or data to be simulated is input into the system of the embodiment of the present invention, and then the scheduled data is transmitted to the ICTRL module; the ICTRL module is mainly used for parsing data, including parsing the data transmitted by the SCHED module into the corresponding ALU pipeline instructions when building the system of the embodiment of the present invention; it also includes parsing the simulation data during the simulation process using the system of the embodiment of the present invention, obtaining the information, timing, and order of issuance in the simulation data.
[0105] After constructing the system of the embodiment of the present invention, it also includes using the system to perform simulation, such as Fig.12 As shown, specifically including:
[0106] Step 701: Load the pipeline operation configuration file in the system, configure the pipeline shift delay of each FIFO shift module, obtain the data tasks to be simulated, and sort the data tasks to be simulated according to the order input into the system.
[0107] Among them, a FIFO shift module is provided in the system of the embodiment of the present invention, and the FIFO shift module is used to perform pipeline operation on data. In the process of using the system of the embodiment of the present invention for simulation, it is first necessary to load the pipeline operation configuration file in the system of the embodiment of the present invention, and configure the pipeline shift delay of each FIFO shift module. Then, the total number of data tasks to be simulated is obtained through the ICTRL module, and the data tasks to be simulated are sorted according to the order of input into the system of the embodiment of the present invention, so that the data can be input into the system of the embodiment of the present invention for simulation in the manner of pipeline timing.
[0108] Step 702: Input the data tasks to be simulated into the system for simulation in sequence according to the sorted serial numbers until the simulation of all the data tasks to be simulated is completed, and record the start clock, end clock, and corresponding simulation waveform data of each data task to be simulated.
[0109] After the ICTRL module obtains the total number and sequence of data tasks to be simulated, it inputs them into the system of the embodiment of the present invention in sequence according to the sorted sequence numbers for simulation, and outputs the corresponding simulation waveform diagram.
[0110] The system of the embodiment of the present invention processes data in a pipeline manner. Assuming that there are N submodules in the system of the embodiment of the present invention, the corresponding processing times are T1 to T2 respectively. N , which can be analyzed from the corresponding simulation waveform data. In the embodiment of the present invention, a corresponding delay is added to each FIFO shift module in the system to indicate the module time consumption. Then the total processing time required for the input data in the offline model is
[0111] When a plurality of continuous data passes through the system of the embodiment of the present invention, the timing is ideally as follows: Fig.13 and Fig.14As shown, we use CLFFT and SM4 use case data to perform simulation timing calibration, and use the output data of the system of the embodiment of the present invention to perform simulation experiments such as CLFFT, SM4, AES (an encryption algorithm), and SHA256 (an encryption algorithm). The clock accuracy obtained from the experimental results is very close to RTL, and the error is within 10%, which can approximately evaluate the system performance; and the simulation time of the system of the embodiment of the present invention is almost the same as the simulation time of the C model, both within 1 hour, which is much lower than the RTL simulation time. Therefore, the pipeline clock system construction method proposed in the present invention has the characteristics of fast simulation speed and high clock accuracy, which significantly improves the efficiency of system performance analysis.
[0112] The system of the present invention that uses FIFO shifting to implement pipeline clock adds a FIFO shift module within the functional module, and the FIFO shift module performs pipeline operations on data, so that the FIFO shift module has pipeline timing logic, so that the system of the present invention has both the simulation speed of combinational logic and the ability to simulate the timing in hardware, and has the ability to evaluate the pipeline clock system.
[0113] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A system for implementing pipeline clock using FIFO shifting, It is characterized in that It includes multiple functional modules, multiple FIFO shift modules and interception layer modules, and a FIFO shift module is arranged between every two adjacent functional modules; the interception layer module is connected with the multiple FIFO shift modules; Each of the FIFO shift modules is used to perform a pipeline shift operation on data and calculate the number of clocks; The interception layer module is used to configure the number of stages of the multiple FIFO shift modules.
2. The system for implementing pipeline clock using FIFO shifting according to claim 1, It is characterized in that Each of the functional modules includes a SCHED module, an ICTRL module, a plurality of ALU pipelines and a plurality of registers; A FIFO shift module with a number of S is configured between the SCHED module and the ICTRL module, a FIFO shift module with a number of I is configured between the ICTRL module and the ALU pipeline, and a FIFO shift module with a number of Ai is configured between the ALU pipeline and the corresponding register, wherein Ai=0, 1, ..., n, and n is the number of the ALU pipelines; the SCHED module is used to schedule data in the system and transmit the scheduled data to the ICTRL module; The ICTRL module is used to parse the data transmitted by the SCHED module into instructions of the corresponding ALU pipeline, and distribute the instructions to the corresponding ALU pipeline; The ALU pipeline is used to write the calculation result of the received instruction into the corresponding register.
3. The system for implementing pipeline clock using FIFO shifting according to claim 1, It is characterized in that The FIFO shift module is used to perform a pipeline shift operation on data, including: Obtain the number M of depth units in the FIFO shift module, initialize the position flag of the depth unit in the FIFO shift module to 0, and sort the depth units according to the data transmission order, and the sorting order is 1, 2, ..., M, where M is a natural number greater than 0; When the first data is input at time T, the first data is pulled into the depth unit with sequence number 1 in the FIFO shift module, and the position flag of the depth unit with sequence number 1 is updated to 1; When the second data is input at time T+t, the first data is moved forward by t depth units, and the first data is pulled into the depth unit with sequence number t+1 in the FIFO shift module, the position flag of the depth unit with sequence number 1 is updated to 0, the position flag of the depth unit with sequence number t+1 is updated to 1, and the second data is pulled into the depth unit with sequence number 1, and the position flag of the depth unit with sequence number 1 is updated to 1; When preparing for output, if the position mark in the depth unit with sequence number M in the current FIFO shift module is 0, the data in the FIFO shift module is moved forward one depth unit as a whole; if the position mark in the depth unit with sequence number M in the current FIFO shift module is 1, the corresponding data is output.
4. The system for implementing pipeline clock using FIFO shifting according to claim 3, It is characterized in that The ALU pipeline is one or more of FOP, DOT, BIT, INT, CPX and MOV.
5. A method of implementing pipeline clock using FIFO shifting, It is characterized in that The method is used to construct a system for implementing a pipeline clock using FIFO shifting according to any one of claims 1 to 4, and the method comprises: A corresponding FIFO shift module is arranged between every two adjacent functional modules, the interception layer module is connected to the FIFO shift module, and the number of stages of the FIFO shift module is set; The FIFO shift module is used to perform pipeline operation on the data in the system and calculate the clock number of the data to obtain the timing of data transmission.
6. The method for implementing pipeline clock using FIFO shifting according to claim 5, It is characterized in that The functional module includes a SCHED module, an ICTRL module, a plurality of ALU pipelines and a plurality of registers. The interception layer module is used to configure the number of stages of the FIFO shift module, and the FIFO shift module is used to perform a pipeline operation on the data to obtain the clock number of the data, including: using the SCHED module to schedule the data in the system, and transmitting the scheduled data to the ICTRL module; Utilize the ICTRL module to parse the data transmitted by the SCHED module into instructions of the corresponding ALU pipeline, and distribute the instructions to the corresponding ALU pipeline; Using the ALU pipeline, the calculation result of the received instruction is written into the corresponding register; The interception layer module is used to configure the corresponding FIFO shift module levels between the SCHED module and the ICTRL module, between the ICTRL module and the ALU pipeline, and between the ALU pipeline and the register, and the FIFO shift module is used to perform a pipeline clock shift operation on the data to obtain the clock number of the data.
7. The method for implementing pipeline clock using FIFO shifting according to claim 6, It is characterized in that The method of using the FIFO shift module to perform a pipeline shift operation on the data also includes obtaining a timing delay corresponding to each FIFO shift module in the system, including: Inputting the test data into the system for simulation to obtain first simulation waveform data; The input signal timing and the output signal timing in each FIFO shift module are extracted from the first simulation waveform data, and the clock number difference between the input signal timing and the output signal timing of each FIFO shift module is obtained.
8. The method for implementing pipeline clock using FIFO shifting according to claim 6, It is characterized in that After the system is constructed, the accuracy of the pipeline timing of the FIFO shift module in the system is verified by using the RTL model, including: Obtain a preset number of test data, input the test data into the RTL model in sequence for simulation, and obtain second simulation waveform data of the RTL model; Inputting the test data into the system for simulation, and obtaining third simulation waveform data of the system; Compare the second simulation waveform data with the third simulation waveform data, obtain the amount of data that is inconsistent between the second simulation waveform data and the third simulation waveform data according to the comparison structure, and calculate the first error percentage of the data amount in the test data; A comparison threshold of the first error percentage is set. If the first error percentage is less than or equal to the comparison threshold, it means that the verification is passed; if the first error percentage is greater than the comparison threshold, it means that the verification is not passed, and the system is readjusted.
9. The method for implementing pipeline clock using FIFO shifting according to claim 8, It is characterized in that The timing verification of the FIFO shift module in the system is performed by counting the time consumed by the length of data flowing into the FIFO shift module, counting the time consumed by the entire task, or counting the time consumed by the functional logic of each sub-stage corresponding to the task.
10. The method for implementing pipeline clock using FIFO shifting according to claim 7, It is characterized in that After the system is constructed, simulation is performed using the system, including: Loading the pipeline operation configuration file in the system, and configuring the pipeline shift delay of each FIFO shift module; Acquire data tasks to be simulated, and sort the data tasks to be simulated according to the order in which they are input into the system; The data tasks to be simulated are input into the system for simulation in sequence according to the sorted serial numbers until the simulation of all the data tasks to be simulated is completed, and the start clock, end clock and corresponding simulation waveform data of each data task to be simulated are recorded at the end.
Citation Information
Cited By
Shifting circuit, integrated circuit device and electronic equipment
CN120165690A
