Method, system and storage medium for simulating IC design on FPGA

By reducing the IC design to a directed graph and modifying it into a clock model, and using the main clock' to control the sampling data and timing, the problem of sampling errors caused by glitches in the IC design timing unit on the FPGA is solved, and effective simulation and circuitry of the IC design are achieved. of normal operation.

CN117634384BActive Publication Date: 2024-08-30SHANGHAI UNIVISTA IND SOFTWARE GRP CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310658622.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-06-05
Publication Date
2024-08-30
Estimated Expiration
2043-06-05

AI Technical Summary

Technical Problem

When IC design is directly applied to FPGA, due to differences in physical structure, sampling errors caused by burrs in the timing unit cannot be effectively avoided. The existing technology cannot control the generation of burrs by controlling the wiring length.

Method used

Reduce the IC design to a directed graph, modify the nodes to clock models, introduce the main clock', control the sampling data and data sampling timing through the clock models CA and CB, and set the phase offset of the main clock' to ensure the normal operation of the circuit. Avoid burr effects.

Benefits of technology

Effective simulation of IC design is realized on FPGA, which solves the problem of sampling errors caused by glitches and ensures the functional integrity of the timing unit and the normal operation of the circuit.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117634384B_ABST
    Figure CN117634384B_ABST
Patent Text Reader

Abstract

The present invention relates to the technical field of electronic design automation, and in particular to a method, system and storage medium for simulating IC design on FPGA. A timing unit is modified into a clock model, and a user enable terminal is added to the external port of the clock model compared with the port of the timing unit in the IC design. A user clock is connected to the user enable terminal of the clock model and a master clock' is connected to the clock input terminal of the clock model. The function of the timing unit in the IC design is reproduced by controlling the output timing of sampled data through a clock model CA, and the function of the timing unit in the IC design is reproduced by controlling the sampling timing of data through a clock model CB; and a phase offset of the master clock' connected to the clock model CA and the clock model CB is set, so as to solve the technical problem of sampling error caused by burrs in the user clock while ensuring the original function of the timing unit.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of electronic design automation, and in particular to a method, system and storage medium for simulating IC design on FPGA. Background Art

[0002] Integrated circuit design (IC design) refers to the design process that targets integrated circuits and very large-scale integrated circuits. Integrated circuit design includes application-specific integrated circuit (ASIC) design, which refers to integrated circuits designed and manufactured to meet specific user requirements and the needs of specific electronic systems. After the integrated circuit design is completed, it will enter the tape-out stage. The cost of tape-out is very high, and once a problem occurs, it will lead to tape-out failure. In order to reduce the risk of tape-out failure, the software and hardware of the IC need to be fully verified before tape-out, and some problems that are difficult to find during the design process should be discovered in time, and the design should be adjusted in time to ensure the smooth progress of tape-out. Common verification tools include Simulation and Emulation, among which Emulation refers to simulating the hardware actually used in the user-designed chip, and then emulating it. Most emulations are designed based on field programmable gate array (FPGA) chips. FPGA chips are composed of components such as lookup tables and registers. Different functions can be realized by configuring the electrical signals of the corresponding components through software.

[0003] Due to the different physical structures of IC and FPGA, IC design is based on standard cell library, while FPGA is based on macro cell module (lookup table) provided by the manufacturer. Therefore, if IC design is to be verified on FPGA, IC design must be converted to a certain extent before it can be transplanted to FPGA. The biggest difference between the cores of IC and FPGA chips is the clock structure. The clock structure in IC includes at least one clock tree, and each clock tree is a clock tree structure composed of a primary clock and multiple generated clocks. Before the IC design is designed by wiring, the circuit delay will cause glitches in the generated clock generated by the combinational logic operation. If the generated clock with glitches is connected to the clock input end of the timing unit, since the clock input end of the timing unit is sensitive to glitches, it will erroneously trigger the timing unit to sample the signal at the data input end, thereby causing errors in the sampled data output by the data output end of the timing unit. In order to solve the glitch problem, in IC design, strict wiring design can be used to control the delay of the combinational logic input signal, thereby controlling the generation of glitches. However, if the IC design is directly applied to the FPGA, since the FPGA is a pre-wired semi-custom circuit, it is impossible to control the generation of glitches by controlling the wiring length and delay, and thus it is impossible to avoid the problem of glitches causing the timing unit to output erroneous sampling data. Summary of the invention

[0004] It is an object of the present invention to overcome some or all of these disadvantages.

[0005] To this end, according to a first aspect, the present invention provides a method for simulating an IC design on an FPGA, comprising:

[0006] S2) reducing the IC design to a directed graph, including: 2.1) reducing the plurality of timing units to a plurality of nodes, including: identifying a user clock input terminal and a data output terminal on each timing unit; defining a logical path from the user clock input terminal to the data output terminal as a node. 2.2) connecting the plurality of nodes to obtain a directed graph.

[0007] S3) setting nodes on the directed graph, including:

[0008] 3.1) Inserting a clock model into a node on the directed graph, including:

[0009] 3.1.1) At least one node on the directed graph is identified as group A and at least another node is identified as group B.

[0010] 3.1.2) Modify the nodes identified as group A, including: i) set the data input terminal CA, data output terminal CA, user enable terminal CA and clock input terminal CA for the clock model CA. ii) Modify node A in the nodes identified as group A, insert clock model CA in node A, including: modify the data input terminal and data output terminal of node A to data input terminal CA and data output terminal CA respectively; modify the user clock input terminal of node A to user enable terminal CA; connect the master clock 'to the clock input terminal CA, wherein: the frequency of the master clock 'is greater than or equal to the frequency of the master clock; set the clock model CA including: sample the signal from the data input terminal CA at each valid edge of the master clock ', and obtain the sampled data within a cycle of the master clock ' starting from the valid edge; when the user clock A has a valid edge for the Nth time, obtain the sampled data of the master clock 'in the current cycle, and output the sampled data to the data output terminal CA until the user clock A has a valid edge for the N+1th time.

[0011] 3.1.3) Modify the nodes identified as group B, including: i) set the data input terminal CB, data output terminal CB, user enable terminal CB and clock input terminal CB for the clock model CB. ii) Modify the node B in the nodes identified as group B, insert the clock model CB in the node B, including: connect the data input terminal and data output terminal of the node B to the data input terminal CB and the data output terminal CB respectively; connect the user clock input terminal of the node B to the user enable terminal CB; connect the master clock 'to the clock input terminal CB; set the clock model CB including: when the valid edge of the user clock B occurs and the valid edge of the master clock ' occurs: sample the signal from the data input terminal CB to obtain the sampled data within a period of the master clock ' starting from the valid edge of the master clock '; output the sampled data to the data output terminal CB.

[0012] 3.2) Set the phase offset for the master clock.

[0013] In a second aspect, the present invention provides a method for simulating IC design on an FPGA, comprising:

[0014] S2) reducing the IC design to a directed graph, including: 2.1) reducing the plurality of timing units to a plurality of nodes, including: identifying a user clock input terminal and a data output terminal on each timing unit; defining a logical path from the user clock input terminal to the data output terminal as a node. 2.2) connecting the plurality of nodes to obtain a directed graph.

[0015] S3) setting nodes on the directed graph, including:

[0016] 3.1) Inserting a clock model into a node on the directed graph, including:

[0017] 3.1.1) All nodes on the directed graph are identified as group A.

[0018] 3.1.2) Modify the nodes identified as group A, including: i) set the data input terminal CA, data output terminal CA, user enable terminal CA and clock input terminal CA for the clock model CA. ii) Modify node A in the nodes identified as group A, insert clock model CA in node A, including: modify the data input terminal and data output terminal of node A to data input terminal CA and data output terminal CA respectively; modify the user clock input terminal of node A to user enable terminal CA; connect the master clock 'to the clock input terminal CA, wherein: the frequency of the master clock 'is greater than or equal to the frequency of the master clock; set the clock model CA including: sample the signal from the data input terminal CA at each valid edge of the master clock ', and obtain the sampled data within a cycle of the master clock ' starting from the valid edge; when the user clock A has a valid edge for the Nth time, obtain the sampled data of the master clock 'in the current cycle, and output the sampled data to the data output terminal CA until the user clock A has a valid edge for the N+1th time.

[0019] 3.2) Set the phase offset for the master clock.

[0020] In a third aspect, the present invention provides a method for simulating IC design on an FPGA, comprising:

[0021] S2) reducing the IC design to a directed graph, including: 2.1) reducing the plurality of timing units to a plurality of nodes, including: identifying a user clock input terminal and a data output terminal on each timing unit; defining a logical path from the user clock input terminal to the data output terminal as a node. 2.2) connecting the plurality of nodes to obtain a directed graph.

[0022] S3) setting nodes on the directed graph, including:

[0023] 3.1) Inserting a clock model into a node on the directed graph, including:

[0024] 3.1.1) All nodes on the directed graph are identified as group B.

[0025] 3.1.2) Modify the nodes identified as group B, including: i) set the data input terminal CB, data output terminal CB, user enable terminal CB and clock input terminal CB for the clock model CB. ii) Modify the node B in the nodes identified as group B, insert the clock model CB in the node B, including: connect the data input terminal and data output terminal of the node B to the data input terminal CB and the data output terminal CB respectively; connect the user clock input terminal of the node B to the user enable terminal CB; connect the master clock 'to the clock input terminal CB; set the clock model CB including: when the valid edge of the user clock B occurs and the valid edge of the master clock ' occurs: sample the signal from the data input terminal CB to obtain the sampled data within a period of the master clock ' starting from the valid edge of the master clock '; output the sampled data to the data output terminal CB.

[0026] 3.2) Set the phase offset for the master clock.

[0027] In a fourth aspect, the present invention provides a system for simulating IC design on FPGA, comprising a processor and a storage medium communicatively connected to the processor, wherein: when the processor executes a program in the storage medium, the system can implement the above-mentioned method for simulating IC design on FPGA.

[0028] In a fifth aspect, the present invention provides a non-transitory computer-readable storage medium, wherein the storage medium stores at least one instruction or at least one program, and the at least one instruction or the at least one program is loaded and executed by a processor to implement the above-mentioned method of simulating IC design on FPGA.

[0029] The present invention has at least the following beneficial effects:

[0030] The embodiment of the present invention provides a method for simulating IC design on FPGA, extracting a directed graph by identifying the logical path of a timing unit in the IC design, and modifying the timing unit corresponding to the node in the directed graph into a clock model, wherein a user enable end is added to the external port of the clock model compared to the port of the timing unit in the IC design, and the clock model CA reproduces the function of the timing unit in the IC design by controlling the output timing of sampled data, and the clock model CB reproduces the function of the timing unit in the IC design by controlling the sampling timing of data; and the phase offset of the master clock 'connected to the clock model CA and the clock model CB is set to ensure the normal operation of the circuit; since the master clock 'is directly connected to the clock input end of the clock model CA and CB, there is no burr in the master clock '; at the same time, the user clock is connected to the user enable end of the clock model CA and CB, but the user enable end is insensitive to the user clock with burrs, so the present invention can solve the technical problem of sampling error caused by burrs in the user clock while ensuring the original function of the timing unit. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] Other advantages, objects, and features of the present invention will become apparent from the non-limiting description of at least one specific embodiment of a method, system, and storage medium for simulating an IC design on an FPGA following with reference to the accompanying drawings, in which:

[0032] Figure 1 A schematic diagram of the structure of a clock model CA provided by an embodiment of the present invention;

[0033] Figure 2 A schematic diagram of the structure of a clock model CB provided by an embodiment of the present invention;

[0034] Figure 3 This is a comparison diagram before and after the sequential unit is modified into a clock model;

[0035] Figure 4 It is a timing diagram of the clock model CB before the master clock ′ moves;

[0036] Figure 5 It is a timing comparison diagram of the clock model CB before and after the master clock ′ moves;

[0037] Figure 6 A schematic diagram showing the comparison between the ideal state and the actual burr generation in the prior art;

[0038] Figure 7 A flow chart of a method for simulating IC design on FPGA provided by an embodiment of the present invention;

[0039] Figure 8 is a flow chart of the steps of S2 in an embodiment of the present invention;

[0040] Fig. 9 is a flow chart of the steps of S3 in an embodiment of the present invention;

[0041] Fig.10 It is a schematic diagram of the structure of the clock tree;

[0042] Fig.11 For Fig.10 The directed graph obtained by extraction;

[0043] Fig.12 A schematic diagram of replacing sequential unit A with clock model CA;

[0044] Fig.13 A schematic diagram of the structure of a clock model CA provided by another embodiment of the present invention;

[0045] Fig.14 A schematic diagram of the structure of a clock model CB provided in another embodiment of the present invention;

[0046] Fig.15 A schematic diagram of the structure of a clock model CB provided in yet another embodiment of the present invention;

[0047] Fig.16 A schematic diagram of the structure of a clock model CB provided in yet another embodiment of the present invention;

[0048] Fig.17 A schematic diagram of a structure after a sequential unit is replaced with a clock model provided by the present invention;

[0049] Fig.18 A schematic diagram of the structure of a clock detector shared by a clock model CA and a clock model CB provided by the present invention;

[0050] Fig.19 A schematic diagram of the structure of a common clock detector for two clock models CA provided by the present invention;

[0051] Fig. 20 A schematic diagram of the structure of a common clock detector for two clock models CB provided by the present invention;

[0052] Fig.21 It is a timing diagram between two group B nodes on the same path;

[0053] Fig. 22 A timing diagram between a node of group A and the nearest node of group B on the same path; and

[0054] Fig.23 Another timing diagram between a group A node and the nearest group B node on the same path. DETAILED DESCRIPTION

[0055] Before the IC design is designed through wiring, the circuit delay will cause glitches in the generated clock generated by the combinational logic operation. To better understand the source of the glitches, take the AND gate circuit with two input terminals as an example. Figure 6 , Figure 6 Figure a in the figure shows that in an ideal state, the two input terminals of the AND gate circuit input waveform signals IA and IB respectively, and the waveform signal output by the output terminal of the AND gate is OC; however, in the case of delay control without wiring design, due to the delay caused by the length of the line or the delay caused by the operation of the upper circuit, it cannot be guaranteed that the signals at the two input terminals of the AND gate circuit will flip according to the preset time interval. When the delays of the waveform signals input at the two input terminals of the AND gate circuit are inconsistent, such as Figure 6 As shown in Figure b, assuming that the waveform signal IB′ input to the AND gate circuit is delayed by a time t0 compared to the waveform signal IA, the waveform signal output by the AND gate circuit is OC′ with d, where d that should not appear appears in OC′ compared to the ideal waveform signal OC, and d is the glitch. That is, due to the effect of delay, the time when multiple signals that should be input at the same time arrive at the end point has a sequential relationship, forming a competitive relationship, and the erroneous output generated by the competition is the glitch. If the generated clock with glitch is connected to the clock input end of the timing unit, since the clock input end of the timing unit is sensitive to glitch, it will erroneously trigger the timing unit to sample the signal at the data input end, and thus the problem of glitch causing the timing unit to output erroneous sampled data cannot be avoided. In order to solve the glitch problem, in IC design, the delay of the combinational logic input signal can be controlled by strict wiring design, thereby controlling the generation of glitch. However, if the IC design is directly applied to FPGA, since FPGA is a pre-wired semi-custom circuit, it is impossible to control the glitch by controlling the wiring length and delay.

[0056] In order to solve the problem of sampling errors caused by the clock input end of the generated clock input timing unit with glitches, and at the same time realize the application of the timing unit in the IC design to the FPGA, it is first necessary to extract the timing unit in the IC design, take the clock input end to the data output end in the timing unit as a logical path, and extract the logical path in each timing unit. Define a node on the logical path. Take the data output end of the current node flowing to the clock input end of the next node as a directed edge, and use the edge to connect the nodes to obtain a directed graph. The directed graph includes a root node, multiple leaf nodes, and intermediate nodes between the root node and the leaf nodes. There is at least one path from the root node to each leaf node. The root node in the directed graph corresponds to the root node in the clock tree. The user clock connected to the root node is the main clock, and the user clocks connected to other nodes are generated clocks. All nodes in the directed graph and the connection relationship between nodes represent the logical paths in all timing units of the clock tree in the IC design and the relationship between each logical path.

[0057] After extracting the directed graph, the timing unit represented by each node in the directed graph needs to be modified as a whole into a clock model with logically equivalent functions in the FPGA, including clock model CA and clock model CB. In order to solve the glitch problem, a new master clock 'is introduced, and the master clock 'is directly connected to the clock input of clock model CA or clock model CB. There is no combinational logic between the master clock 'and the clock input of clock model CA or clock model CB, and no delay is introduced. Therefore, there is no glitch at the clock input of clock model CA and CB, which solves the glitch problem. The user clock is connected to the clock model CA or CB as the user enable terminal. Since the user clock of the user enable terminal needs to meet the requirements of setup time and hold time, the setup time refers to the time that the data remains stable before the effective edge of the master clock 'arrives, and the hold time refers to the time that the data remains stable after the effective edge of the master clock 'arrives. The duration of the glitch is generally short, and it cannot meet the requirements of setup time and hold time and is shielded. The glitch is no longer harmful and will not affect data sampling. Therefore, the user enable terminal is insensitive to the glitch. The master clock 'and the user clock cooperate to drive the clock model CA or CB to sample data, ensuring the reproduction of the function of the timing unit in the IC design. The present invention proposes two types of clock models: the clock model CA controls the user clock to drive the clock model CA to output sampled data at the data output end to simulate the function of the timing unit in the IC design; the clock model CB controls the user clock to cooperate with the master clock 'to sample and output the data at the data input end to simulate the function of the timing unit in the IC design. Finally, setting a suitable phase offset for the master clock 'can make the modified circuit work normally.

[0058] Based on this, the present invention provides the following three embodiments, wherein in the scheme provided in Embodiment 1, at least one timing unit is modified to clock model CA and at least another timing unit is modified to clock model CB, in the scheme provided in Embodiment 2, all timing units are replaced with clock model CA, and in the scheme provided in Embodiment 3, all timing units are modified to clock model CB.

[0059] Embodiment 1

[0060] See also Figure 7 , the following combination Figure 7 A method for simulating IC design on FPGA proposed by the present invention is specifically described, and the method comprises the following steps:

[0061] S1) Identify in IC design: a main clock; a subcircuit; a plurality of generated clocks, the main clock is generated into the plurality of generated clocks through subcircuit calculation; and a plurality of timing units, the user clock connected to the plurality of timing units is the main clock or the plurality of generated clocks.

[0062] Optionally, the master clock is a clock input source for the IC design, typically representing a physical clock.

[0063] Optionally, the subcircuit is a combinational logic circuit, a sequential logic circuit, or a hybrid circuit of a combinational logic circuit and a sequential logic circuit. As an example, the subcircuit may be a frequency divider, a gated clock, or a multiplexer, wherein the frequency divider is a sequential logic circuit, and the gated clock and the multiplexer are combinational logic circuits.

[0064] Among them, the generated clock is obtained by the main clock or the previous level generated clock through the subcircuit. The main clock can generate different generated clocks through different subcircuits. The previous level generated clock can also pass through another subcircuit to generate the next level generated clock. And so on. The topological structure of the main clock and the generated clock constitutes a clock tree structure. The generated clock is used to access the clock input end of multiple timing units to drive the timing units to perform data sampling.

[0065] The timing unit has a user clock input terminal, a data input terminal and a data output terminal, and is used to trigger the timing unit to sample the data signal connected to the data input terminal when the effective edge of the user clock connected to the user clock input terminal occurs, and output the sampled data from the data output terminal. The effective edge of the user clock is used as a driving signal to drive the timing unit to sample, and the data input to the timing unit is sampled and output under the action of the driving signal to obtain a generated clock. The sampled data output from the data output terminal of the timing unit can be used as a clock input signal of the clock input terminal of another timing unit, or as a data input signal of the data input terminal of another timing unit.

[0066] The connection modes between sequential units include cascade and series. Figure 3 ,exist Figure 3 Part a in the figure is a possible connection structure between sequential units in IC design, where each sequential unit includes a data input terminal D, a clock input terminal C, and a data output terminal Q. The cascade relationship is that the i-th sequential unit FF i The data output terminal Q outputs the data signal Q i The clock input terminal C of the jth sequential unit is connected in series to the i-th sequential unit FF. i The data output terminal Q outputs the data signal Q i Connected to the data input terminal D of the pth timing unit.

[0067] Optionally, the timing unit is a latch, a trigger, a register, a shift register or a memory, and other combination units with the same functions in the prior art also fall within the protection scope of the present invention.

[0068] S2) reducing the IC design to a directed graph. Figure 8 , S2 includes: 2.1) reducing the multiple timing units to multiple nodes, 2.2) connecting the multiple nodes to obtain a directed graph.

[0069] It should be noted that the IC design includes combinational logic circuits and sequential logic circuits. The problem to be solved by the present invention is the problem of sampling data errors caused by glitches in the clock input signal of the input timing unit. In order to solve this problem, the timing unit needs to be extracted for processing.

[0070] Further, step 2.1 also includes the step of reducing one of the multiple timing units to a node, including: identifying a user clock connected to the timing unit; identifying on the timing unit: a data input terminal, a user clock input terminal and a data output terminal, wherein the user clock is connected to the user clock input terminal; reducing the timing unit to a node. The step of reducing the timing unit to a node includes: defining a logic path with two ends, wherein: the user clock input terminal is one of the two ends, and the data output terminal is the other of the two ends; defining a node between the two ends of the logic path. According to the step of reducing one timing unit to a node, other timing units in the multiple timing units are reduced to nodes. By extracting nodes by identifying the logical path, the timing unit can be extracted as an abstract node, and only the topological relationship between related timing units is extracted to avoid interference from other irrelevant structures.

[0071] Furthermore, the step of connecting the edges of the nodes in step 2.2 is: connecting the nodes with the data output end of one node flowing to the clock input end of the next node as a directed edge. By connecting the nodes and ignoring the combinational logic between the sequential units, a directed graph is obtained.

[0072] Optionally, the directed graph is stored in an adjacency matrix or an adjacency table.

[0073] As an example, in order to better understand the present invention, take 8 sequential units as an example to form a part of the clock tree, see Fig.10 , which shows a partial clock tree structure in IC design, including sequential units F1-F8 and combinational logic Lo1-Lo6 in the clock tree, and each sequential unit has the same external port, including data input terminal D, user clock input terminal C and data output terminal Q. In the clock tree, sequential unit F1 is the root node, and the user clock input terminal C of the sequential unit F1 is connected to the primary clock. For one of the paths including F2-F4 with the root node as the parent node, the primary clock drives the sequential unit F1 to sample the input data to obtain the generated clock 1 (generated clock), and the generated clock 1 drives the sequential unit F2 to sample the input data through the combinational logic Lo1 to obtain the generated clock 2, and so on, to obtain the generated clock 3 and the generated clock 4; similarly, in another path including F5-F8 with the root node as the parent node, the generated clocks 5-8 can be obtained. The logical path formed from the user clock input terminal C to the data output terminal Q in each sequential unit is a node, and the data flow output from the data output terminal of a sequential unit to the clock input terminal of the next node is a directional edge. Fig.10 The clock tree structure shown in is extracted to obtain a directed graph. Fig.11 , which shows that Fig.10 The directed graph obtained after extracting the clock tree in Fig.11 The root node of the directed graph is Fig.10 The root node of the clock tree in Fig.11 The clock input terminal C of the root node is connected to the master clock. In the directed graph, the user clock input terminals C of nodes other than the root node are all connected to the generated clock. The directed edges in the directed graph are the flow directions of the data output signals. Fig.11 Each node in represents the extracted time series unit, and there is a one-to-one mapping relationship between the nodes and the time series units.

[0074] S3) Set the nodes on the directed graph, wherein: the directed graph includes exactly one root node and multiple leaf nodes. Modify the node to the clock model CA or the clock model CB. It should be noted that in the directed graph, the user clock connected to the root node is the master clock; except for the root node, the user clocks connected to other nodes in the directed graph are generated clocks.

[0075] For further information, see Fig. 9 , S3 the step of setting the nodes on the directed graph also includes: 3.1) inserting the clock model into the nodes on the directed graph; 3.2) setting the phase offset for the master clock′.

[0076] Further, step 3.1) includes: 3.1.1) identifying multiple nodes on the directed graph as group A and group B; 3.1.2) modifying the nodes identified as group A; 3.1.3) modifying the nodes identified as group B.

[0077] It should be noted that, in order to solve the technical problem proposed by the present invention, the present invention proposes two clock models that can functionally replace the timing unit in IC design, and uses the clock model to solve the technical problem, wherein the nodes of group A will be replaced by clock model CA, and the nodes of group B will be replaced by clock model CB. Clock model CA reproduces the function of the timing unit in IC design by controlling the output timing of sampled data. Clock model CB reproduces the function of the timing unit in IC design by controlling the sampling timing of data.

[0078] Optionally, in step 3.1.1, the grouping may be performed according to user specification, or may be performed according to a random specification, or may be performed in other ways.

[0079] Wherein, 3.1.2) further comprises the following steps:

[0080] i) Set a data input terminal CA, a data output terminal CA, a user enable terminal CA and a clock input terminal CA for the clock model CA.

[0081] ii) modifying a node A among the nodes identified as the A group, comprising:

[0082] ii.1) Identify the logical path defined by S2 where node A is located, wherein: one end of the logical path is user clock input terminal A; the other end of the logical path is data output terminal A; and user clock A is connected to user clock input terminal A.

[0083] ii.2) Inserting the clock model CA at node A includes: connecting the data input terminal A to the data input terminal CA; connecting the data output terminal A to the data output terminal CA; connecting the user clock input terminal A to the user enable terminal CA; and connecting the master clock 'to the clock input terminal CA, wherein: the frequency of the master clock 'is greater than the frequency of the master clock, so as to facilitate the use of the higher frequency master clock 'to simulate the behavior of the lower frequency master clock or the generated clock. It should be noted that the data input terminal CA, data output terminal CA, and user enable terminal CA reserved by the clock module CA correspond to the data input terminal A, data output terminal A, and user clock input terminal A of the timing unit in the IC design, respectively, and when modified, it can be realized that the timing unit A can be directly replaced by the clock module CA without changing other circuits connected to the timing unit in the IC design.

[0084] As a preferred embodiment, the clock frequency of the master clock' is twice the clock frequency of the main clock.

[0085] See also Fig.12 , in order to better understand step ii.2, Fig.12 FIG. 1 shows a schematic diagram of a structure in which a sequential unit A corresponding to a node A is modified into a clock model CA. First, it should be noted that the external ports of the sequential unit A include a data input terminal A, a user clock input terminal A and a data output terminal A. Fig.12 In the figure, D represents the data input terminal A of the timing unit A, C represents the user clock input terminal A of the timing unit A, and Q represents the data output terminal A of the timing unit A. In the following description, the data input terminal D of the timing unit A directly refers to the data input terminal A of the timing unit A, the user clock input terminal C of the timing unit A refers to the user clock input terminal A of the timing unit A, and the data output terminal Q of the timing unit A refers to the data output terminal A of the timing unit A. Fig.12 The "X" in the figure indicates disconnection, and the dotted line indicates the wiring after the sequential unit A is modified to the clock model CA. A signal line of the sequential unit A is disconnected, and the signal line is connected to the corresponding port of the clock model CA, which is equivalent to replacing the port of the sequential unit A with the corresponding port of the clock model CA to connect to the corresponding signal line; Fig.12In the process, the clock signal line connected to the user clock input terminal C of the timing unit A is disconnected, and the clock signal line is connected to the user enable terminal E of the clock model CA, which is equivalent to replacing the user clock input terminal C of the timing unit A with the user enable terminal E of the clock model CA, so that the user enable terminal E of the clock model CA is connected to the user clock; by analogy, the data input terminal D of the timing unit A is replaced with the data input terminal D of the clock model CA, and the data input terminal D of the clock model CA is connected to the data input signal; the data output terminal Q of the timing unit A is replaced with the data output terminal Q of the clock model CA, so that the data output terminal Q of the clock model CA is connected to the output of the subsequent circuit; the main clock ′ is directly connected to the clock input terminal of the clock model CA, so as to achieve the purpose of replacing the timing unit F with the clock model CA.

[0086] Since the master clock ' is directly connected to the clock input terminal CA of the clock model CA, there is no combinational logic between the master clock ' and the clock input terminal CA of the clock model CA, so no delay will be introduced into the clock input terminal CA, and therefore there are no glitches at the clock input terminal CA of the clock model CA; and the user clock with glitches is connected to the user enable terminal CA of the clock model CA, and the user clock connected to the user enable terminal CA needs to meet the requirements of setup time and hold time, wherein the setup time refers to the time for the data to remain stable before the effective edge of the master clock 'arrives, and the hold time refers to the time for the data to remain stable after the effective edge of the master clock 'arrives, and the duration of the glitches in the user clock is generally short, and cannot meet the requirements of setup time and hold time and is shielded, and the glitches in the user clock at the user enable terminal CA of the clock model CA are no longer harmful and will not affect data sampling, so the clock model CA solves the glitch problem.

[0087] ii.3) Setting the clock model CA, including: sampling the signal from the data input terminal CA at each valid edge of the master clock ', obtaining the sampled data within a cycle of the master clock ' starting from the valid edge; when the user clock A has a valid edge for the Nth time: obtaining the sampled data data of the master clock ' in the current cycle N ; and output the sampled data data to the data output terminal CA N , until the user clock A has an effective edge for the N+1th time; and when the user clock A has an effective edge for the N+1th time: obtain the sampling data data of the master clock 'in the current cycle N+1 ; and output the sampled data data to the data output terminal CA N+1, until the user clock A has a valid edge for the N+2th time. It should be noted that the clock model CA samples data at each valid edge of the main clock ', but the output sampled data is controlled by the user clock A. The final effect is to output new sampled data when the user clock A is valid, otherwise the last sampled data is output; this function reproduces the function of the timing unit. It should be noted that the clock model CA samples the input data signal at each valid edge of the main clock ', but it controls which cycle of the sampled data is output through the user clock A, that is, the clock model CA reproduces the function of the timing unit in the IC design by controlling the output timing of the sampled data.

[0088] As a preferred embodiment, please refer to Figure 1 , Figure 1 The structure of the clock model CA is shown in FIG. 1 , and the clock model CA includes a clock detector E1 and a sampling unit CAs. Figure 1 As shown, D1 represents the data signal connected to the clock input terminal CA, C1 represents the user clock A connected to the user enable terminal CA, MC1 represents the master clock 'connected to the clock input terminal CA, and Q1 represents the data signal output by the data output terminal CA. That is, the user enable terminal E1 is connected to C1, the clock input terminal E1 is connected to MC1, the valid edge output terminal E1 is connected to the enable terminal CAs, the data input terminal CAs is connected to D1, and the data output terminal CAs is connected to Q1. Among them, S4.1.2 also includes: setting a clock detector E1 and a sampling unit CAs for the clock model CA; setting a user enable terminal E1, a clock input terminal E1 and a valid edge output terminal E1 for the clock detector E1; setting a data input terminal CAs, an enable terminal CAs, a clock input terminal CAs and a data output terminal CAs for the sampling unit CAs; connecting the user enable terminal E1 to the user enable terminal CA; connecting the clock input terminal E1 and the clock input terminal CAs to the clock input terminal CA; connecting the valid edge output terminal E1 to the enable terminal CAs; connecting the data input terminal CAs to the data input terminal CA; and connecting the data output terminal CAs to the data output terminal CA.

[0089] The clock detector E1 is used to detect whether the user clock has an effective edge. The sampling unit CAs is used to sample the signal from the data input terminal CA at each effective edge of the master clock ', and obtain the sampled data within a cycle of the master clock ' starting from the effective edge; when the user clock A has an effective edge for the Nth time: obtain the sampled data of the master clock ' in the current cycle N ; and output the sampled data to the data output terminal CA N , until the user clock A has an effective edge for the N+1th time; and when the user clock A has an effective edge for the N+1th time: obtain the sampling data of the master clock' in the current cycle N+1 ; and output the sampled data to the data output terminal CAN+1 , until the user clock A has an effective edge for the N+2th time. The effective edge of the user clock output by the clock detector E1 is used to drive the sampling unit CAs to output corresponding sampled data.

[0090] Further, as a preferred embodiment, please refer again to Figure 1 , S3.1.2 also includes: setting a first basic storage unit Re1, a second basic storage unit Re2 and a multiplexer MUX1 for the sampling unit CAs; setting a clock input terminal Re1, a data input terminal Re1 and a data output terminal Re1 for the first basic storage unit Re1; setting a clock input terminal Re2, a data input terminal Re2 and a data output terminal Re2 for the second basic storage unit Re2; setting a first data input terminal MUX1, a second data input terminal MUX1, a signal selection terminal MUX1 and a data output terminal MUX1 for the multiplexer MUX1; connecting the data input terminal Re1 to the data input terminal CAs; connecting the data output terminal MUX1 to the data output terminal CAs; connecting the clock input terminal Re1 and the clock input terminal Re2 to the clock input terminal CAs; connecting the data output terminal Re1 to the first data input terminal MUX1; connecting the data input terminal Re2 to the data output terminal MUX1; connecting the data output terminal Re2 to the second data input terminal MUX1; and connecting the enable terminal CAs to the signal selection terminal MUX1.

[0091] Among them, the multiplexer is a combinational logic circuit with multiple data inputs and a single data output. The multiplexer with multiple data inputs is a multi-channel digital switch that can select a data input signal from multiple data inputs and output it to a common data output terminal according to different signals at the signal selection terminal.

[0092] The first basic storage unit Re1 is used to sample the data signal from the data input terminal CA at each valid edge of the master clock 'to obtain sampled data. The second basic storage unit Re2 is used to sample the output signal of the data output terminal CA at each valid edge of the master clock 'to obtain sampled data. The clock frequency of the master clock 'is greater than the clock frequency of the user clock. Re1 and Re2 are connected to the same master clock '. Two types of sampled data will be obtained at each valid edge of the master clock ': Re1 outputs the sampled data obtained in the current cycle of the master clock ', and Re2 outputs the sampled data obtained in the previous cycle of the master clock '. The multiplexer MUX1 is used to select and output the sampled data of Re1 when the user clock A is valid, and output the sampled data of Re2 when the user clock A is invalid. That is, when the i-th valid edge of the master clock 'arrives, Re1 samples the input data to obtain the sampled data data1. If the user clock A is valid at this time, MUX1 is driven to select Re1's sampled data output data1. When the i+1-th valid edge of the master clock 'arrives, Re1 continues to sample the input data to obtain new sampled data data2. However, at this time, Re2 samples the data1 output by MUX1 to obtain data1. If the user clock A is invalid at this time, MUX1 is driven to select Re2's sampled data output data1. When the i+2-th valid edge of the master clock 'arrives, if the user clock is valid, MUX1 is driven to output new sampled data data2, otherwise it continues to output data1. That is, when the user clock A has a valid edge for the Nth time: obtain the sampled data data of the master clock 'in the current cycle. N ; and output the sampled data data to the data output terminal CA N , until the user clock A has an effective edge for the N+1th time; and when the user clock A has an effective edge for the N+1th time: obtain the sampling data data of the master clock 'in the current cycle N+1 ; and output the sampled data data to the data output terminal CA N+1 , until the valid edge of user clock A occurs for the N+2th time.

[0093] Further, as a preferred embodiment, please refer again to Figure 1, a third basic storage unit Re3, a NOT gate circuit A0 and an AND gate circuit A1 are set for the clock detector E1, wherein: a clock input terminal Re3, a data input terminal Re3 and a data output terminal Re3 are set for Re3; a signal input terminal A0 and a signal output terminal A0 are set for the NOT gate circuit; a first data input terminal A1, a second data input terminal A1 and a data output terminal A1 are set for the AND gate circuit; the clock input terminal Re3 is connected to the clock input terminal E1; the data input terminal Re3 and the first data input terminal A1 are connected to the user enable terminal E1; the data output terminal Re3 is connected to the signal input terminal A0; the signal output terminal A0 is connected to the second data input terminal A1; the data output terminal A1 is connected to the valid edge output terminal E1.

[0094] The NOT gate circuit A0 is used to make the level output by the signal output terminal A0 opposite to the level input by the signal input terminal A0. The AND gate circuit A1 is used to make the data output terminal A1 output a high level when the first data input terminal A1 and the second data input terminal A1 are both high level; otherwise, the data output terminal A1 outputs a low level.

[0095] Optionally, the combination circuit of the NOT gate circuit A0 and the AND gate circuit A1 can be a lookup table with the same truth table, wherein the combination of digital circuits implementing the lookup table of the same truth table includes multiple types. The lookup table is a structure for implementing a truth table that has all possible logical combinations and their corresponding logical results written in advance, and the corresponding logical result can be obtained according to the logical combination of the input end of the lookup table.

[0096] Optionally, the valid edge of the user clock is set to a rising edge or a falling edge.

[0097] Optionally, the effective edge of the master clock ' of the clock model CA and the clock model CB is set to be a rising edge trigger, or is set to be a falling edge trigger, or the clock model CA is set to be a rising edge trigger and the clock model CB is set to be a falling edge trigger, or the clock model CA is set to be a falling edge trigger and the clock model CB is set to be a rising edge trigger. When the effective edge is set to be a rising edge trigger, the clock detector adopts a clock detector that detects a rising edge, such as Figure 1 The clock detector E1 in the clock detector. When the valid edge is set to be triggered by the falling edge, the clock detector samples the clock detector that detects the falling edge. At this time, the clock detector samples the clock detector that detects the falling edge. The clock detector that detects the falling edge is different from the clock detector E1 in that the data output terminal Re3 of the third basic storage unit Re3 is directly connected to the second data input terminal A1 of the AND gate circuit, and the NOT gate circuit A0 is set to connect the NOT gate input terminal of the NOT gate circuit to the user enable terminal E1, and the NOT gate output terminal is connected to the first data input terminal A1 of the AND gate circuit. The clock detectors that can detect the rising edge, the falling edge or the double edge in the prior art all fall within the protection scope of the present invention.

[0098] The clock model CA can not only reproduce the function of the timing unit, but also has no delay problem in the sampling timing of the clock model CA because the internal structure of the clock model CA directly samples data after the effective edge of the main clock ′ arrives and only selectively outputs the corresponding sampling results.

[0099] As a preferred embodiment, when the enable terminal of the sequential unit is connected to the circuit, please refer to Fig.13, D1 represents the data signal connected to the data input terminal CA, Q1 represents the sampled data output by the data output terminal CA, C1 represents the user clock connected to the user enable terminal CA, MC1 represents the clock signal connected to the clock input terminal CA, and EN1 represents the enable signal connected to the enable terminal CA; S2.1 also includes identifying on the timing unit: the data input terminal, the user clock input terminal, the data output terminal and the enable terminal; then S4.1.2 also includes: setting the data input terminal CA, the data output terminal CA, the user enable terminal CA, the clock input terminal CA and the enable terminal CA for the clock model CA; setting the clock detector E1, the first basic storage unit Re1, the second basic storage unit Re2, the multiplexer MUX1 and the multiplexer MUX2 for the clock model CA; setting the user enable terminal E1, the clock input terminal E1 and the valid edge output terminal E1 for the clock detector E1; setting the clock input terminal Re1, the data input terminal Re1 and the data output terminal Re1 for the first basic storage unit Re1; setting the clock input terminal Re1 for the second basic storage unit Re2 2. Data input terminal Re2 and data output terminal Re2; set a first data input terminal MUX1, a second data input terminal MUX1, a signal selection terminal MUX1 and a data output terminal MUX1 for the multiplexer MUX1; set a first data input terminal MUX2, a second data input terminal MUX2, a signal selection terminal MUX2 and a data output terminal MUX2 for the multiplexer MUX2; connect the second data input terminal MUX2 to the data input terminal CA; connect the data output terminal MUX1 to the data output terminal CA, the data input terminal Re2 and the first data input terminal MUX2; connect the clock input terminal Re1, the clock input terminal Re2 and the clock input terminal E1 to the clock input terminal CA; connect the user enable terminal E1 to the user enable terminal CA; connect the valid edge output terminal E1 to the signal selection terminal MUX1; connect the data output terminal Re2 to the second data input terminal MUX1; connect the enable terminal CA to the signal selection terminal MUX2; connect the data output terminal MUX2 to the data input terminal Re1; and connect the data output terminal Re1 to the first data input terminal MUX1. It should be noted that MUX2 is used to realize that when the enable signal connected to the enable terminal CA is valid, MUX2 is driven to select the data signal D1 input by the data input terminal CA to be output to the data input terminal Re1; otherwise, MUX2 is driven to select the data signal Q1 output by the data output terminal CA to be output to the data input terminal Re1.

[0100] Optionally, the first basic storage unit Re1 is configured as a register or a latch. The second basic storage unit Re2 is configured as a register or a latch.

[0101] iii) Modify other nodes in the nodes identified as group A.

[0102] Wherein, 3.1.3) further comprises the following steps:

[0103] i) Set a data input terminal CB, a data output terminal CB, a user enable terminal CB and a clock input terminal CB for the clock model CB.

[0104] ii) modifying a node B among the nodes identified as the B group, comprising:

[0105] ii.1) Identify the logical path defined by S2 where node B is located, wherein: one end of the logical path is the user clock input terminal B; the other end of the logical path is the data output terminal B; and the user clock B is connected to the user clock input terminal B.

[0106] ii.2) Inserting the clock model CB at the node B includes: connecting the data input terminal B to the data input terminal CB; connecting the data output terminal B to the data output terminal CB; connecting the user clock input terminal B to the user enable terminal CB; and connecting the master clock 'to the clock input terminal CB. It should be noted that, the data input terminal CB, data output terminal CB, and user enable terminal CB reserved by the clock model CB correspond to the data input terminal B, data output terminal B, and user clock input terminal B of the timing unit in the IC design, respectively, and when modified, it can be realized that the timing unit B can be directly replaced by the clock module CB without changing other circuits connected to the timing unit in the IC design.

[0107] It should be noted that since the external interfaces of the clock model CA and the clock model CB are the same, the replacement method is the same as Fig.11 The methods shown are similar and will not be described again.

[0108] Since the master clock ′ is directly connected to the clock input terminal CB of the clock model CB, and the user clock with glitches is connected to the user enable terminal CB of the clock model CB, the clock model CB and the clock model CA have the same principle for solving technical problems. There are no glitches in the master clock ′ connected to the clock input terminal CB, and the user clock with glitches is connected to the user enable terminal CB that is insensitive to glitches. The glitches will not affect data sampling, so the clock model CB solves the glitch problem.

[0109] ii.3) Setting the clock model CB, including: when the valid edge of the user clock B occurs and the valid edge of the master clock ' occurs: sampling the signal from the data input terminal CB, obtaining the sampled data within a period of the master clock ' starting from the valid edge of the master clock ', and outputting the sampled data to the data output terminal CB; when the valid edge of the user clock B does not occur or when the valid edge of the master clock ' does not occur: not sampling the signal from the data input terminal CB, and not outputting data to the data output terminal CB. It should be noted that since the frequency of the user clock B is lower than that of the master clock ', and sampling is performed only when the valid edge of the user clock B occurs and the valid edge of the master clock ' occurs, that is, the clock model CB reproduces the function of the timing unit in the IC design by controlling the sampling timing of the sampled data.

[0110] As a preferred embodiment, please refer to Figure 2 , wherein S3.1.3 also includes: setting a clock detector E2 and a sampling unit CBs for the clock model CB; setting a user enable terminal E2, a clock input terminal E2 and a valid edge output terminal E2 for the clock detector E2; setting a clock input terminal CBs, an enable terminal CBs, a data input terminal CBs and a data output terminal CBs for the sampling unit CBs; connecting the data input terminal CBs to the data input terminal CB; connecting the data output terminal CBs to the data output terminal CB; connecting the clock input terminal E2 and the clock input terminal CBs to the clock input terminal CB; connecting the user enable terminal E2 to the user enable terminal CB; and connecting the valid edge output terminal E2 to the enable terminal CBs. Please refer again Figure 2 , D2 represents the data signal connected to the data input terminal CB, Q2 represents the sampled data output by the data output terminal CB, C2 represents the user clock connected to the user enable terminal CB, and MC2 represents the clock signal connected to the clock input terminal CB.

[0111] The function of the clock detector E2 is the same as that of E1, and is used to detect whether a valid edge occurs in the user clock. The internal structure of the clock detector E2 is the same as that of E1, and will not be described in detail.

[0112] The sampling unit CBs is used to realize that when the effective edge of the user clock B occurs and the effective edge of the master clock ' occurs: sampling the signal from the data input terminal CB to obtain sampled data within a period of the master clock ' starting from the effective edge of the master clock '; outputting the sampled data to the data output terminal CB; when the effective edge of the user clock B does not occur or when the effective edge of the master clock ' does not occur: not sampling the signal from the data input terminal CB, and not outputting data to the data output terminal CB.

[0113] The implementation circuit of the sampling unit CBs may be configured in various types. The embodiment of the present invention provides the following two variant methods.

[0114] Optionally, the sampling unit CBs is set to have a register ERe1 with an enable terminal. The internal structure of the clock model CB is simple, while the clock model CA requires more hardware combinations to implement. The clock model CB can save a lot of hardware resources compared to the clock model CA. Therefore, the balance of hardware resources can be achieved through the cooperation of the clock model CA and the clock model CB.

[0115] As a preferred embodiment, the clock model CB includes a register ERe1 and a clock detector E2, wherein the register ERe1 is a register with an enable terminal, and the output terminal of the clock detector is connected to the enable terminal of the register.

[0116] As a preferred embodiment, please refer to Fig.14 , S3.1.3 also includes: setting a fourth basic storage unit Re4 and a multiplexer MUX3 for the sampling unit CBs; setting a clock input terminal Re4, a data input terminal Re4 and a data output terminal Re4 for the fourth basic storage unit Re4; setting a first data input terminal MUX3, a second data input terminal MUX3, a signal selection terminal MUX3 and a data output terminal MUX3 for the multiplexer MUX3; connecting the first data input terminal MUX3 to the data input terminal CBs; connecting the data output terminal Re4 to the second data input terminal MUX3 and the data output terminal CBs; connecting the clock input terminal Re4 to the clock input terminal CBs; connecting the signal selection terminal MUX3 to the enable terminal CBs; and connecting the data output terminal MUX3 to the data input terminal Re4. Among them, the combined function of MUX3 and Re4 is equivalent to the function of register ERe1 with an enable terminal. MUX3 is used to select the data signal input from the data input terminal CBs to be output to Re4 when the user signal is valid, otherwise the data signal output from the data output terminal CBs is selected to be output to Re4, and the data signal from the data input terminal Re4 is sampled and output when the master clock 'is valid. It should be noted that the clock model CB is a clock model with a clock delay relative to the clock model CA, and the clock delay of the clock model CB is the delay caused by the hardware structure of the clock model CB itself.

[0117] Optionally, the fourth basic storage unit Re4 is a register or a latch.

[0118] As a preferred embodiment, the clock model CB may also be a functional module composed of other structures, see Fig.15, set the third basic storage unit Re3, the fourth basic storage unit Re4 and the lookup table LUT1 for the clock model CB; set the clock input terminal Re3, the data input terminal Re3 and the data output terminal Re3 for the third basic storage unit Re3; set the clock input terminal Re4, the data input terminal Re4 and the data output terminal Re4 for the fourth basic storage unit Re4; set the first data input terminal LUT1, the second data input terminal LUT1, the third data input terminal LUT1, the fourth data input terminal LUT1 and the data output terminal LUT1 for the lookup table LUT1; connect the second data input terminal LUT1 to the data input terminal CB; connect the data output terminal Re4 to the first data input terminal LUT1 and the data output terminal CB; connect the clock input terminal Re3 and the clock input terminal Re4 to the clock input terminal CB; connect the data input terminal Re3 and the third data input terminal LUT1 to the user enable terminal CB; connect the data output terminal Re3 to the fourth data input terminal LUT1; and connect the data output terminal LUT1 to the data input terminal Re4. It should be noted that the role of the lookup table LUT1 is equivalent to Fig.14 The gate circuit A0, the AND gate circuit A1 and the multiplexer MUX3 function as a combination of a module, wherein the first to fourth data input terminals of the lookup table LUT1 are equivalent to the signal input terminal A0, the first data input terminal A1, the first data input terminal MUX3 and the second data input terminal MUX3, and the data output terminal LUT1 of the lookup table LUT1 is equivalent to Fig.14 The function of the data output terminal Re4, that is, the truth table pre-written in the lookup table LUT1, is equivalent to the combined function of A0, A1 and MUX3.

[0119] The third basic storage unit Re3 is configured as a register or a latch.

[0120] As a preferred embodiment, when the enable terminal of the sequential unit is connected to the circuit, please refer to Fig.16, S2.1 also includes identifying on the timing unit: a data input terminal, a user clock input terminal, a data output terminal and an enable terminal. S4.1.3 also includes: setting a data input terminal CB, a data output terminal CB, a user enable terminal CB, a clock input terminal CB and an enable terminal CB for the clock model CB; setting a clock detector E2, a storage unit ERe1 and a multiplexer MUX4 for the timing unit CB; setting a user enable terminal E2, a clock input terminal E2 and a valid edge output terminal E2 for the clock detector E2; setting a clock input terminal ERe1, an enable terminal ERe1, a data input terminal ERe1 and a data output terminal ERe1 for the storage unit ERe1; setting a first data input terminal for the multiplexer MUX4 MUX4, the second data input terminal MUX4, the signal selection terminal MUX4 and the data output terminal MUX4; connect the second data input terminal MUX4 to the data input terminal CB; connect the signal selection terminal MUX4 to the enable terminal CB; connect the data output terminal ERe1 to the data output terminal CB and the first data input terminal MUX4; connect the clock input terminal E2 and the clock input terminal ERe1 to the clock input terminal CB; connect the user enable terminal E2 to the user enable terminal CB; connect the valid edge output terminal E2 to the enable terminal ERe1; and connect the data output terminal MUX4 to the data input terminal ERe1. Fig.16 D2 represents the data signal connected to the data input terminal CB, Q2 represents the sampled data outputted from the data output terminal CB, C2 represents the user clock connected to the user enable terminal CB, MC2 represents the clock signal connected to the clock input terminal CB, and EN2 represents the enable signal connected to the enable terminal CB. It should be noted that MUX4 is used to realize that when the enable signal connected to the enable terminal CB is valid, MUX4 is driven to select and output the data signal D2 inputted from the data input terminal CB to the data input terminal ERe1; otherwise, MUX4 is driven to select and output the data signal Q2 outputted from the data output terminal CB to the data input terminal ERe1.

[0121] As a preferred embodiment, the effective edge is set to a rising edge or a falling edge, wherein the effective edge is the effective edge of the user clock and / or the effective edge of the master clock'.

[0122] In IC design, there are anchor points in the combinatorial logic between sequential units. The anchor point is the generated clock output by the sequential unit after being processed by the combinatorial logic circuit and output through multiple branch output ports. Each branch output port is called an anchor point, and each anchor point is connected to the clock input of the corresponding clock model. Since the user clocks connected to the same anchor point are exactly the same, the same user clock has the same result of the valid edge of the user clock output by the clock detectors of different clock models. Therefore, in order to save hardware resources, the clock models connected to the same anchor point are set to share the same clock detector to detect the valid edge of the user clock. As an example, in order to better understand the anchor point in the present invention, please refer to Fig.17 , Fig.17 The 4 modified clock models EMU1-EMU4 are included, wherein the clock model EMU1 can be the clock model CA or the clock model CB. The clock models CA and CB have the same external ports reserved. Fig.17 In the figure, D represents the data input terminal, Q represents the data output terminal, Ev represents the user enable terminal, and MC represents the clock input terminal. The user enable terminal Ev of EMU1 and the user enable terminal Ev of EMU4 are connected to the same anchor point anchor1, the user enable terminal Ev of EMU2 and the user enable terminal Ev of EMU3 are connected to the same anchor point anchor2, the user clock UC1 connected to EMU1 and EMU4 is the same, and the user clock UC2 connected to EMU2 and EMU3 is the same. For the clock detector, when the input user clock is the same, the output result of its clock detector is the same. Therefore, the clock models connected to the same user clock can share the same clock detector, that is, EMU1 and EMU4 share the same clock detector, and EMU2 and EMU3 share the same clock detector.

[0123] The combination of the common clock detector includes the following three embodiments.

[0124] As a preferred embodiment, please refer to the attached Fig.18, wherein in S1, the plurality of sequential units include: sequential unit A1 and sequential unit B1; in S2, on the directed graph: sequential unit A1 is reduced to node A1, and sequential unit B1 is reduced to node B1; in S3.1.1: node A1 is identified as group A, and node B1 is identified as group B; in S3.1.2: clock model CA1 is inserted into node A1, and clock model CA1 is set to include data input terminal CA1, data output terminal CA1, user enable terminal CA1 and clock input terminal CA1; in S3.1.3: the clock model CB1 is inserted into the node B1, and the clock model CB1 is configured to include a data input terminal CB1, a data output terminal CB1, a user enable terminal CB1, and a clock input terminal CB1; S3.1 also includes: setting a sampling unit CA1s for the clock model CA1; setting a data input terminal CA1s, an enable terminal CA1s, a clock input terminal CA1s, and a data output terminal CA1s for the sampling unit CA1s; setting a sampling unit CB1s for the clock model CB1; The sampling unit CB1s sets a data input terminal CB1s, an enable terminal CB1s, a clock input terminal CB1s and a data output terminal CB1s; identifies an anchor point to which the user enable terminal CA1 is connected and if the user enable terminal CB1 is connected to the anchor point: sets a clock detector E12 for the clock model CA1 and the clock model CB1; sets a user enable terminal E12, a clock input terminal E12 and a valid edge output terminal E12 for the clock detector E12; connects the user enable terminal E12 to the anchor point, the user enable terminal CA1 and the clock detector E12; 1 and user enable terminal CB1; connect the clock input terminal E12 to the clock input terminal CA1s, the clock input terminal CA1, the clock input terminal CB1s and the clock input terminal CB1; connect the valid edge output terminal E12 to the enable terminal CA1s and the enable terminal CB1s; connect the data input terminal CA1s to the data input terminal CA1; connect the data output terminal CA1s to the data output terminal CA1; connect the data input terminal CB1s to the data input terminal CB1; and connect the data output terminal CB1s to the data output terminal CB1. Fig.18 As shown in FIG. 1 , C1 represents the user clock A connected to the user enable terminal CA1, and also represents the user clock B connected to the user enable terminal CB1; MC1 represents the master clock ' connected to the clock input terminal CA1, and also represents the master clock ' connected to the clock input terminal CB1. By making the clock model CA1 and the clock model CB1 connected to the same anchor point share a clock detector, not only can the same valid edge as the unshared clock detector be obtained, but also the use of the clock detector can be greatly reduced, reducing the consumption of hardware resources. As a preferred embodiment, please refer to the attached Fig.19, wherein in S1, the plurality of sequential units include: sequential unit A1 and sequential unit A2; in S2, on the directed graph: sequential unit A1 is reduced to node A1, and sequential unit A2 is reduced to node A2; in S3.1.1, both node A1 and node A2 are identified as group A; in S3.1.2: clock model CA1 is inserted into node A1, and clock model CA1 is configured to include data input terminal CA1, data output terminal CA1, user enable terminal CA1 and clock input terminal CA1; clock model CA2 is inserted into node A2, and clock model CA2 is configured to include data input terminal CA2, data output terminal CA2, user enable terminal CA2 and clock input terminal CA2; S3.1 also includes: setting sampling unit CA1s for clock model CA1, setting data input terminal CA1s, enable terminal CA1s, clock input terminal CA1s and data output terminal CA1s for sampling unit CAs1; setting sampling unit CA2s for clock model CA2, and setting sampling unit CA2 s sets a data input terminal CA2s, an enable terminal CA2s, a clock input terminal CA2s and a data output terminal CA2s; identifies an anchor point to which the user enable terminal CA1 is connected; if the user enable terminal CA2 is connected to the anchor point: sets a clock detector E12 for both the clock model CA1 and the clock model CA2; sets a user enable terminal E12, a clock input terminal E12 and a valid edge output terminal E12 for the clock detector E12; connects the user enable terminal E12 to the anchor point, the user enable terminal CA1 and the user Enable terminal CA2; connect the clock input terminal E12 to the clock input terminal CA1s, the clock input terminal CA1, the clock input terminal CA2s and the clock input terminal CA2; connect the valid edge output terminal E12 to the enable terminal CA1s and the enable terminal CA2s; connect the data input terminal CA1s to the data input terminal CA1; connect the data output terminal CA1s to the data output terminal CA1; connect the data input terminal CA2s to the data input terminal CA2; and connect the data output terminal CA2s to the data output terminal CA2. Fig.19 As shown, since the clock detector E12 is shared, C1 represents both the user clock A connected to the user enable terminal CA1 and the user clock A connected to the user enable terminal CA2; MC1 represents both the master clock ' connected to the clock input terminal CA1 and the master clock ' connected to the clock input terminal CA2. By making two or more clock models CA connected to the same anchor point share a clock detector, not only can the same valid edge as that of the unshared clock detector be obtained, but also the use of the clock detector can be greatly reduced, reducing the consumption of hardware resources. As a preferred embodiment, please refer to the attached Fig. 20, wherein in S1, the plurality of sequential units include: sequential unit B1 and sequential unit B2; in S2, on the directed graph: sequential unit B1 is reduced to node B1, and sequential unit B2 is reduced to node B2; in S3.1.1, both node B1 and node B2 are identified as group B; in S3.1.3: clock model CB1 is inserted into node B1, and clock model CB1 is configured to include data input terminal CB1, data output terminal CB1, user enable terminal CB1 and clock input terminal CB1; clock model CB2 is inserted into node B2, and clock model CB2 is configured to include data input terminal CB2, data output terminal CB2, user enable terminal CB2 and clock input terminal CB2; S3.1 also includes: setting sampling unit CB1s for clock model CB1; setting data input terminal CB1s, enable terminal CB1s, clock input terminal CB1s and data output terminal CB1s for sampling unit CB1s; setting sampling unit CB2s for clock model CB2, and setting sampling unit CB 2s sets a data input terminal CB2s, an enable terminal CB2s, a clock input terminal CB2s and a data output terminal CB2s; identifies the anchor point to which the user enable terminal CB1 is connected and if the user enable terminal CB2 is connected to the anchor point: sets an edge detector E12 for the clock model CB1 and the clock model CB2; sets a user enable terminal E12, a clock input terminal E12 and a valid edge output terminal E12 for the clock detector E12; connects the user enable terminal E12 to the anchor point, the user enable terminal CB1 and the user Enable terminal CB2; connect the clock input terminal E12 to the clock input terminal CB1s, the clock input terminal CB1, the clock input terminal CB2s and the clock input terminal CB2; connect the valid edge output terminal E12 to the enable terminal CB1s and the enable terminal CB2s; connect the data input terminal CB1s to the data input terminal CB1; connect the data output terminal CB1s to the data output terminal CB1; connect the data input terminal CB2s to the data input terminal CB2; and connect the data output terminal CB2s to the data output terminal CB2. Fig. 20 As shown, since the clock detector E12 is shared, C2 represents both the user clock B connected to the user enable terminal CB1 and the user clock B connected to the user enable terminal CB2; MC2 represents both the master clock ' connected to the clock input terminal CB1 and the master clock ' connected to the clock input terminal CB2. By making two or more clock models CB connected to the same anchor point share a clock detector, not only can the same valid edge as that of the unshared clock detector be obtained, but also the use of clock detectors can be greatly reduced, reducing the consumption of hardware resources.

[0125] iii) Modify the other nodes in the nodes identified as group B.

[0126] Please refer again Figure 3 , Figure 3The figure shows a comparison diagram before and after the modification. In order to make the figure better express the relationship between before and after the replacement, the same letters are used in the figure to indicate that the signals connected to each port before and after the replacement remain unchanged. Figure 3 The figure in part a shows the structure between the timing units of the IC design before modification. For any register FF before replacement i , FF i It includes clock input terminal C, data input terminal D and data output terminal Q, where Lo is a combinational logic circuit. i The clock input terminal C is connected to the user clock UC i , the data input terminal D is connected to the data signal D i The data output terminal Q outputs the data signal Q i . See Figure 3 The accompanying drawings in part b show a schematic diagram of the structure of the modified clock model. In order to better express the relationship between the ports, in the accompanying drawings in part b, D is still used to represent the data input terminal CA of the clock model CA or the data input terminal CB of the clock model CB, C is used to represent the clock input terminal CA of the clock model CA or the clock input terminal CB of the clock model CB, Q is used to represent the data output terminal CA of the clock model CA or the data output terminal CB of the clock model CB, and Ev is used to identify the user enable terminal CA of the clock model CA or the user enable terminal CB of the clock model CB. FF is replaced i Modified to clock model CA i , where D i Connected to CA i Data input terminal D, UC i Connected to CA i User enablement end Ev, CA i The data output terminal Q outputs the data signal Q i , CA i The clock input terminal C of FF is connected to the main clock '. j Replaced with clock model CA j , FF p Replaced with clock model CB p , CA i , CA j and CB p The clock input ends are respectively connected to the corresponding clock signals MC.

[0127] Wherein, the replaced circuit includes the pth clock model CA and the gth clock model CB connected in series, and the user enable end CA of the pth clock model CA and the user enable end CB of the gth clock model CB are connected to the same user clock. Wherein, the series relationship is that the data output end of the previous clock model is connected to the data input end of the next clock model. Wherein, the replaced circuit also includes the vth clock model CB and the qth clock model CB connected in series, and the user enable end CB of the vth clock model CB and the user enable end CB of the qth clock model CB are connected to the same user clock. Wherein, the vth clock model CB and the qth clock model CB can also be connected to the same master clock ′. The use of two clock models CA can solve the timing disorder problem caused by the use of clock models CB in the cascade structure.

[0128] 3.2) Setting the phase offset for the master clock ', comprising the following steps:

[0129] 3.2.1) A path is identified on the directed graph, and a phase offset is set for the master clocks' of the nodes connected to the path.

[0130] Optionally, the algorithm for identifying the path is a depth-first search algorithm (DFS) or a breadth-first search algorithm (BFS). Other algorithms for identifying the path in the prior art also fall within the protection scope of the present invention.

[0131] 3.2.2) The K nodes on the path are numbered sequentially, wherein the root node is node No. 1 and one of the leaf nodes is node No. K.

[0132] It should be noted that there is only one root node and one leaf node on a path, and the starting point of the path is the root node and the end point is the leaf node.

[0133] i) setting a phase offset for a master clock 'accessing a node identified as group B, comprising: identifying nodes identified as group B on the path, including nodes M and N, wherein: 1≤N<M≤K; making F(xt M )=F(xt N ) and t M >t N , where: 1≤N<M≤K; F(xt M ) is the waveform of the master clock connected to node M, t M is the phase of its shift; and F(xt N ) is the waveform of the master clock connected to node N, t N is the phase of its shift. Fig.21 As shown, the phase difference satisfies △t=tM -t N >0.

[0134] As an example, see again Fig.11 , assuming that node F4 is a leaf node, and nodes F2 and F3 are marked as group B, Fig.11 The nodes in the path F1-F4 are numbered sequentially, and the nodes F1-F4 are marked as nodes 1-4 respectively, then nodes 2 and 3 satisfy: F(x-t3)=F(x-t2) and t3>t2.

[0135] Among them, whether the clock model CB outputs sampled data is controlled by both the user clock and the master clock ', while whether the clock model CA outputs sampled data is completely controlled independently by the user clock. When the same valid edge of the user clock propagates to different nodes in a path, there is a sequence of time. The clock model CA in the path will directly output sampled data with the occurrence of the valid edge of the user clock, but the clock model CB in the path needs to wait for the valid edge of the master clock 'to occur before outputting the sampled data; for the clock model CB, the sampled data propagates along the path direction, the N node with a small number outputs the sampled data first, and the M node with a larger number outputs the sampled data later. Therefore, it is necessary to set the time sequence of the arrival of the valid edge of the master clock 'to ensure the order of outputting the sampled data, thereby ensuring the normal operation of the circuit. Therefore, only when the time when the M node outputs the sampled data lags behind the N node, can the M node obtain the correct sampled data. Therefore, it is necessary to set the phase t of the master clock 'connected to the M node with a larger number in the path. M The phase t of the master clock ′ that lags behind the Nth node with a smaller number N , to ensure that the correct sampling data is obtained. Further, when t M and t N When the phase difference is greater than or equal to the time it takes for the sampled data to propagate from node N to node M, sampling the data at the same time when the data arrives at node M, or waiting for a small time difference before sampling, can both obtain the correct sampling results within the same master clock cycle.

[0136] ii) Setting a phase offset for a master clock 'accessing a node identified as group A, comprising:

[0137] ii.1) Identify nodes identified as group A on the path, including node number U.

[0138] ii.2) When 1<U<K: Identify the nodes closest to node U and marked as group B, including nodes R and S, where: R<U<S; make exactly one of the following true: F(xt U )=F(xt R) and t U ≥t R , F(xt U )=F(xt S ) and t S ≥t U .

[0139] As an example, see again Fig.11 , assuming that node F8 is a leaf node, and nodes F5 and F7 are marked as group B, and F6 is marked as group A. Fig.11 The nodes in another path F1-F8 are numbered sequentially, node F1 is marked as node 1, and F5-F8 are marked as nodes 2-5 respectively. Among them, nodes 2 and 4 are marked as group B, so they need to satisfy: F(x-t4)=F(x-t2) and t4>t2; node 3 is marked as group A, then node 3 needs to satisfy: F(x-t3)=F(x-t2) and t3≥t2, or satisfy: F(x-t3)=F(x-t4) and t4≥t3.

[0140] Among them, since the clock model CA outputs sampled data or not is not controlled by the master clock ', the clock model CA and any of the closest clock models CB can use the master clock ' with the same phase. For nodes U and R, since the clock model CA corresponding to node U outputs sampled data or not is not controlled by the master clock ', the phase of the master clock ' connected to node U can be equal to the phase of the master clock ' of node R or node S, such as Fig. 22 As shown in the figure, when the phase of the master clock ′ connected to the U node is equal to the phase difference of the R node, △t=t U -t R = 0. However, since nodes R and S are both group B nodes, nodes R and S also need to satisfy the phase t of the master clock ′ accessed by node S. S The phase t that lags behind the master clock ′ connected to node R R , that is, the phases of nodes R and S cannot be equal, so the phase of the master clock 'of node U can only be equal to the phase of the master clock 'of node R or the phase of the master clock 'of node S. At the same time, since the sampled data needs a certain propagation time to propagate from node R to node U, when t U and t R When the phase difference is greater than or equal to the time it takes for the sampled data to propagate from node N to node M, node U can also obtain the correct sampling result. S and t U When the phase difference is greater than or equal to the time it takes for the sampled data to propagate from node U to node R, node R can also obtain the correct sampling result. Fig.23 As shown in the figure, when the phase of the master clock ' connected to the U node lags behind the phase difference of the R node, △t = t U -t R >0.

[0141] As a preferred embodiment, τ=t S -t U Satisfies: t0<τ<T / 2, or satisfies: t0<τ<T. Where t0 is the minimum threshold of τ.

[0142] Optionally, t0 is a preset offset time threshold;

[0143] Preferably, t0 is the time difference between the occurrence time of the valid edge of the user clock in the clock model CB when it is connected to the clock detector and the occurrence time of the valid edge of the user clock output by the clock detector, so as to ensure that the offset time τ is within the time range of the valid rising edge output by the clock detector.

[0144] Understandably, see Figure 4 , the clock model CB performs data sampling only when the valid edge of the user clock output from the effective edge output terminal E1 of the clock detector and connected to Ev occurs and the valid edge of the master clock 'connected to the clock input terminal occurs, that is, the user clock needs to detect the valid edge of the user clock first after connecting to the clock model CB, and there is a delay in the circuit before connecting to Ev, that is, the occurrence time of the valid edge of the user clock connected to Ev has a slight delay relative to the actual occurrence time of the valid edge of the user clock. Therefore, when the rising edge of the master clock 'comes at time T1, the effective edge of the user clock connected to Ev lags behind, resulting in Ev being at a low level at this time. Therefore, the master clock 'cannot sample when this rising edge comes at time T1; when the rising edge of the master clock 'comes at the next time T2 during the high level of Ev, effective data sampling can be performed. It can be seen that data sampling lags behind one clock cycle of the master clock '. Please refer to Figure 5 After actively shifting the master clock 'backward by a time τ, the moved master clock ' is obtained, so that the moved master clock ' can be sampled at the time point T1+τ. When t0<τ<T, the sampling of T1+τ is in the same clock cycle as the actually expected sampling.

[0145] ii.3) When U=1: identify the nodes closest to the root node and marked as group B, including node S; let F(xt U )=F(xt S ), where t S ≥t UThat is, when the root node in the path is the clock model CA, the phase of the master clock ' of the node S closest to the root node must be equal to or lag behind the phase of the master clock ' of the root node, so it is necessary to satisfy: △t = t S -t U ≥0.

[0146] ii.4) When U=K: identify the nodes closest to the leaf node and identified as group B, including node R; and make F(xt U )=F(xt R ) and t U ≥t R That is, when the leaf node in the path is the clock model CA, the phase of the master clock of the leaf node's clock model CA must be equal to or lag behind the phase of the master clock of the nearest node R, so it must satisfy: △t = t U -t R ≥0.

[0147] It should be noted that ii.3 and ii.4 respectively define the phase relationship between the clock model CA and the clock model CB in the path when the root node or leaf node is the clock model CA, to ensure that each node in the path can obtain the correct sampling result.

[0148] Where: F(xt R ) is the waveform of the master clock connected to node R, t R is the phase of the waveform; F(xt U ) is the waveform of the master clock connected to node U, t U is the phase of the waveform; F(xt S ) is the waveform of the master clock ′ connected to node S, t S is the phase of the waveform.

[0149] 3.2.3) Identify other paths on the directed graph, and set phase offsets for the master clocks' of the nodes connected to the other paths.

[0150] As a preferred embodiment, F(xt M ) includes: obtaining a clock signal Tc; dividing the clock signal Tc by X to obtain a divided signal, wherein the divided signal is F(x); delaying the divided signal by a time t M , we get F(xt M). By analogy, the waveforms of the master clocks' of other nodes can be obtained in this way. It can be understood that the clock frequency of the divided signal after frequency division is 1 / X times that of the clock signal Tc. By dividing the clock signal to obtain the clock signals of the first clock replacement model and the second clock replacement model respectively, the introduction of the clock domain can be further reduced. The clock signal Tc can be a crystal oscillator signal.

[0151] Optionally, the method of dividing the clock signal Tc by X is: inputting the clock signal Tc into a frequency divider to obtain a frequency-divided signal, where X is greater than 0.

[0152] Optionally, the method of delaying the frequency-divided signal by a time τ is: inputting the frequency-divided signal into a delay circuit.

[0153] The clock tree includes a clock domain and a data domain, wherein the clock domain includes X clock models CA, and the data domain includes Y hybrid clock models; the Y hybrid clock models include Y1 clock models CA and Y2 clock models CB, wherein Y=Y1+Y2; the clock model CA is a clock model whose function is completely equivalent to the register FF, and the clock model CB is a clock model with clock delay relative to the clock model CA; the master clock 'mc2 of the clock model CB has the same clock period T as the master clock 'mc1 of the clock model CA, mc2 is offset by a time τ relative to mc1, and t0<τ<T / 2, t0 is the minimum threshold of τ. The data signal at the data output end of the i-th clock model CA in the clock domain is the clock input signal of the i+1-th clock model CA. The data signal at the data output end of the j-th hybrid clock model in the data domain is the data input signal of the j+1-th clock replacement model.

[0154] It should be noted that the number of clock models CB is greater than the number of clock models CA. In actual circuits, the number of timing units in the data domain is much greater than the number of timing units in the clock domain. Therefore, after replacement, more clock models CB can be used, further reducing system resource consumption.

[0155] Among them, for the clock model CB in the data domain, when the data signal of the data output end of the jth timing unit is connected to the data input end of the gth timing unit, the jth timing unit and the gth timing unit are both modified to the clock model CB. For two clock models CB connected in series, when the master clock 'connected to both is the same, the timing of the two clock models CB is also exactly the same, which will not cause the problem of timing disorder, and at the same time reduce the resource consumption of the system.

[0156] As a preferred embodiment, the method further includes:

[0157] Preferably, the data domain includes the rth clock model CB and the r+1th clock model CB connected in series, and the r+1th clock model CB and the qth clock model CA connected in series, and there is an offset time τ in the clock signal between the r+1th clock model CB and the qth clock model CA, and the transfer step of the offset time τ is: replace the r+1th clock model CB with the clock model CA, and the offset time τ is transferred to between the rth clock model CB and the r+1th clock model CA. By adjusting the type transfer offset time of the clock replacement model, the maximum clock frequency of the system is further increased, and the performance of the system is improved.

[0158] It should be noted that all clock models CA in the clock domain belong to the same clock domain. The fewer clock domains are introduced, the fewer BUFG resources are required, which can further save system resource consumption. By controlling a master clock, the entire system can be started and stopped at the same time.

[0159] It should be noted that all clock models CB in the data domain are connected to the same master clock ′.

[0160] S4) Obtain the modified IC design.

[0161] S5) Writing the modified IC design into the FPGA.

[0162] S6) Verifying the IC design on the FPGA into which the modified IC design is written.

[0163] In summary, the embodiment of the present invention provides a method for simulating IC design on FPGA, extracting a directed graph by identifying the logical path of the timing unit in the IC design, and replacing the timing unit corresponding to the node in the directed graph with the clock model CA or the clock model CB. The external ports of the clock model CA and the clock model CB have a new user enable terminal compared to the ports of the timing unit in the IC design. By coordinating the user clock connected to the user enable terminal of the clock model CA or CA and the master clock 'connected to the clock input terminal, the clock model CA reproduces the function of the timing unit in the IC design by controlling the output timing of the sampled data, and the clock model CB reproduces the function of the timing unit in the IC design by controlling the sampling timing of the data; and the phase offset of the master clock 'connected to the clock model CA and the clock model CB is set to ensure the normal operation of the circuit; since the master clock 'is directly connected to the clock input terminal of the clock model CA and the clock model CB, there is no burr in the master clock '; at the same time, the user clock is connected to the user enable terminal of the clock model CA and the clock model CB, but the user enable terminal is insensitive to the user clock with burrs, so the present invention can solve the technical problem of sampling errors caused by burrs in the user clock while ensuring the original function of the timing unit.

[0164] The beneficial effect of the first embodiment over the second and third embodiments is that it balances the problem that all use of the clock model CA results in large consumption of hardware resources and all use of the clock model CB results in a huge number of clock domains.

[0165] Embodiment 2

[0166] Embodiment 2 provides a method for simulating IC design on FPGA, the method comprising the following steps:

[0167] S1) Identifying in the IC design: a main clock, a subcircuit, a plurality of generated clocks and a plurality of sequential units, wherein the main clock is generated by the subcircuit operation to generate the plurality of generated clocks, and a user clock connected to the plurality of sequential units is the main clock or the plurality of generated clocks.

[0168] S2) reducing the IC design to a directed graph, including: 2.1) reducing the plurality of timing units to a plurality of nodes, 2.2) connecting the plurality of nodes to obtain a directed graph.

[0169] Among them, 2.1) reducing the multiple timing units to multiple nodes, wherein reducing one of the multiple timing units to a node includes: identifying a user clock connected to the timing unit; identifying a node on the timing unit and connecting the multiple nodes to obtain a directed graph; wherein the nodes identified on the timing unit include: a data input terminal, a user clock input terminal and a data output terminal, and the user clock is connected to the user clock input terminal; reducing the timing unit to a node includes: defining a logic path with two ends, wherein: the user clock input terminal is one end of the two ends, and the data output terminal is the other end of the two ends; defining a node between the two ends of the logic path; defining other logic paths, and defining a node between the two ends of the other logic paths; reducing the other timing units in the multiple timing units to nodes.

[0170] S3) Setting nodes on the directed graph, wherein: the directed graph includes exactly one root node and multiple leaf nodes, including: 3.1) Inserting clock model CA into the nodes on the directed graph; 3.2) Setting phase offset for the master clock ′.

[0171] Among them, 3.1 includes: 3.1.1) identifying all multiple nodes on the directed graph as group A; 3.1.2) modifying the nodes identified as group A.

[0172] Among them, 3.1.2 also includes: i) setting the data input terminal CA, data output terminal CA, user enable terminal CA and clock input terminal CA for the clock model CA; ii) modifying one node A among the nodes identified as group A; iii) modifying other nodes among the nodes identified as group A.

[0173] Among them, 3.1.2.ii includes:

[0174] ii.1) Identify the logical path defined by S2 where node A is located, wherein: one end of the logical path is the user clock input terminal A, and the other end of the logical path is the data output terminal A; user clock A is connected to user clock input terminal A.

[0175] ii.2) Inserting the clock model CA at node A, including: connecting the data input terminal A to the data input terminal CA, connecting the data output terminal A to the data output terminal CA, connecting the user clock input terminal A to the user enable terminal CA, and connecting the master clock 'to the clock input terminal CA, wherein: the frequency of the master clock 'is greater than or equal to the frequency of the master clock.

[0176] ii.3) Setting the clock model CA, including: sampling the signal from the data input terminal CA at each valid edge of the master clock ', obtaining the sampled data within a cycle of the master clock ' starting from the valid edge; when the user clock A has a valid edge for the Nth time: obtaining the sampled data data of the master clock ' in the current cycle N , output the sampled data to the data output terminal CA N , until the user clock A has an effective edge for the N+1th time; when the user clock A has an effective edge for the N+1th time: obtain the sampling data data of the master clock' in the current cycle N+1 , output the sampled data to the data output terminal CA N+1 , until the valid edge of user clock A occurs for the N+2th time.

[0177] Among them, 3.2 includes:

[0178] 3.2.1) A path is identified on the directed graph, and a phase offset is set for the master clocks' of the nodes connected to the path.

[0179] 3.2.2) The K nodes on the path are numbered in sequence, the K nodes including: node 1, node H, node U and node K, where node 1 is the root node and node K is one of the multiple leaf nodes, where: 1≤H≤U≤K.

[0180] 3.2.3) Let F(x–t) U )=F(xt H ) and t U ≥t H , where: F(x–t U ) is the waveform of the master clock connected to node U, t U is the phase of its movement; F(xt H) is the waveform of the master clock connected to node H, t H is the phase of its movement.

[0181] 3.2.4) Identify other paths on the directed graph, and set phase offsets for the master clocks' of the nodes connected to the other paths.

[0182] As a preferred embodiment, S3.1 also includes: setting a clock detector E1 and a sampling unit CAs for the clock model CA; setting a user enable terminal E1, a clock input terminal E1 and a valid edge output terminal E1 for the clock detector E1; setting a data input terminal CAs, an enable terminal CAs, a clock input terminal CAs and a data output terminal CAs for the sampling unit CAs; connecting the user enable terminal E1 to the user enable terminal CA; connecting the clock input terminal E1 and the clock input terminal CAs to the clock input terminal CA; connecting the valid edge output terminal E1 to the enable terminal CAs; connecting the data input terminal CAs to the data input terminal CA; connecting the data output terminal CAs to the data output terminal CA.

[0183] As a preferred embodiment, S3.1 also includes: setting a first basic storage unit Re1, a second basic storage unit Re2 and a multiplexer MUX1 for the sampling unit CAs; setting a clock input terminal Re1, a data input terminal Re1 and a data output terminal Re1 for the first basic storage unit Re1; setting a clock input terminal Re2, a data input terminal Re2 and a data output terminal Re2 for the second basic storage unit Re2; setting a first data input terminal MUX1, a second data input terminal MUX1, a signal selection terminal MUX1 and a data output terminal MUX1 for the multiplexer MUX1; connecting the data input terminal Re1 to the data input terminal CAs; connecting the data output terminal MUX1 to the data output terminal CAs; connecting the clock input terminal Re1 and the clock input terminal Re2 to the clock input terminal CAs; connecting the data output terminal Re1 to the first data input terminal MUX1; connecting the data input terminal Re2 to the data output terminal MUX1; connecting the data output terminal Re2 to the second data input terminal MUX1; connecting the enable terminal CAs to the signal selection terminal MUX1.

[0184] As a preferred embodiment, in S1, the plurality of sequential units include: sequential unit A1 and sequential unit A2; in S2, on the directed graph: sequential unit A1 is reduced to node A1, and sequential unit A2 is reduced to node A2; in S3.1.1, both node A1 and node A2 are identified as group A; in S3.1.2: clock model CA1 is inserted into node A1, and clock model CA1 is set to include data input terminal CA1, data output terminal CA1, user enable terminal CA1 and clock input terminal CA1; clock model CA2 is inserted into node A2, and clock model CA2 is configured to include data input terminal CA2, data output terminal CA2, user enable terminal CA2 and clock input terminal CA2; S3.1 also includes: setting sampling unit CA1s for clock model CA1, setting data input terminal CA1s, enable terminal CA1s, clock input terminal CA1s and data output terminal CA1s for sampling unit CAs1; setting sampling unit CA2s for clock model CA2, setting data input terminal CA2s, enable terminal CA2s, clock input terminal CA2s and data output terminal CA2s for sampling unit CA2s; identifying the anchor point to which user enable terminal CA1 is connected; if user enable terminal CA2 is connected to the anchor point: setting clock detector E12 for clock model CA1 and clock model CA2 together; setting user enable terminal E12, clock input terminal E12 and valid edge output terminal E12 for clock detector E12; connecting user enable terminal E12 to the anchor point, user enable terminal CA1 and clock detector E12; 1 and user enable terminal CA2; connect the clock input terminal E12 to the clock input terminal CA1s, the clock input terminal CA1, the clock input terminal CA2s and the clock input terminal CA2; connect the valid edge output terminal E12 to the enable terminal CA1s and the enable terminal CA2s; connect the data input terminal CA1s to the data input terminal CA1; connect the data output terminal CA1s to the data output terminal CA1; connect the data input terminal CA2s to the data input terminal CA2; connect the data output terminal CA2s to the data output terminal CA2.

[0185] The beneficial effect of the second embodiment is that the phase offsets of all clock models CA can be the same. When the phase offsets are the same, all clock models CA are in the same clock domain, which can not only save the hardware resources of the clock low offset buffer (BUFG), but also achieve the purpose of starting or pausing the circuit at the same time.

[0186] Embodiment 3

[0187] Embodiment 3 provides a method for simulating IC design on FPGA, the method comprising the following steps:

[0188] S1) Identifying in the IC design: a main clock, a subcircuit, a plurality of generated clocks and a plurality of sequential units, wherein the main clock is generated by the subcircuit operation to generate the plurality of generated clocks, and a user clock connected to the plurality of sequential units is the main clock or the plurality of generated clocks.

[0189] S2) reducing the IC design to a directed graph, including: 2.1) reducing the plurality of timing units to a plurality of nodes, 2.2) connecting the plurality of nodes to obtain a directed graph.

[0190] Among them, 2.1) reducing the multiple timing units to multiple nodes, wherein reducing one of the multiple timing units to a node includes: identifying a user clock connected to the timing unit; identifying a node on the timing unit and connecting the multiple nodes to obtain a directed graph; wherein the nodes identified on the timing unit include: a data input terminal, a user clock input terminal and a data output terminal, and the user clock is connected to the user clock input terminal; reducing the timing unit to a node includes: defining a logic path with two ends, wherein: the user clock input terminal is one end of the two ends, and the data output terminal is the other end of the two ends; defining a node between the two ends of the logic path; defining other logic paths, and defining a node between the two ends of the other logic paths; reducing the other timing units in the multiple timing units to nodes.

[0191] S3) Setting nodes on the directed graph, wherein: the directed graph includes exactly one root node and multiple leaf nodes, including: 3.1) Inserting a clock model CB into the nodes on the directed graph; 3.2) Setting a phase offset for the master clock ′.

[0192] Among them, 3.1 includes: 3.1.1) identifying all the multiple nodes on the directed graph as group B; 3.1.2) modifying the nodes identified as group B.

[0193] Among them, 3.1.2 includes: i) setting a data input terminal CB, a data output terminal CB, a user enable terminal CB and a clock input terminal CB for the clock model CB; ii) modifying a node B in the nodes identified as group B; iii) modifying other nodes in the directed graph.

[0194] Among them, 3.1.2.ii includes:

[0195] ii.1) Identify the logical path defined by S2 where node B is located, wherein: one end of the logical path is the user clock input terminal B; the other end of the logical path is the data output terminal B; and the user clock B is connected to the user clock input terminal B.

[0196] ii.2) Inserting the clock model CB at the node B includes: connecting the data input terminal B to the data input terminal CB, connecting the data output terminal B to the data output terminal CB, connecting the user clock input terminal B to the user enable terminal CB, and connecting the master clock 'to the clock input terminal CB.

[0197] ii.3) Setting the clock model CB, including: when the valid edge of the user clock B occurs and the valid edge of the master clock ′ occurs: sampling the signal from the data input terminal CB, obtaining sampled data within a period of the master clock ′ starting from the valid edge of the master clock ′, and outputting the sampled data to the data output terminal CB; when the valid edge of the user clock B does not occur or when the valid edge of the master clock ′ does not occur: not sampling the signal from the data input terminal CB, and not outputting data to the data output terminal CB.

[0198] Wherein, 3.2 includes: 3.2.1) identifying a path on the directed graph, and setting a phase offset for the master clock 'of the node connected to the path; 3.2.2) numbering a total of K nodes on the path in sequence, wherein the total of K nodes include: node 1, node N, node M and node K, node 1 is the root node, and node K is one of the multiple leaf nodes, wherein: 1≤N≤M≤K; 3.2.3) making F(xt M )=F(xt N ) and t M >t N , where: F(xt M ) is the waveform of the master clock connected to node M, t M is the phase of its shift; and F(xt N ) is the waveform of the master clock connected to node N, t N is the phase of its movement; 3.2.4) identifying other paths on the directed graph, and setting a phase offset for the master clock' of the node connected to the other path.

[0199] As a preferred embodiment, S3.1 also includes: setting a clock detector E2 and a sampling unit CBs for the clock model CB; setting a user enable terminal E2, a clock input terminal E2 and a valid edge output terminal E2 for the clock detector E2; setting a clock input terminal CBs, an enable terminal CBs, a data input terminal CBs and a data output terminal CBs for the sampling unit CBs; connecting the data input terminal CBs to the data input terminal CB; connecting the data output terminal CBs to the data output terminal CB; connecting the clock input terminal E2 and the clock input terminal CBs to the clock input terminal CB; connecting the user enable terminal E2 to the user enable terminal CB; connecting the valid edge output terminal E2 to the enable terminal CBs.

[0200] As a preferred embodiment, the sampling unit CBs is configured as a register with an enable terminal.

[0201] As a preferred embodiment, in S1, the plurality of sequential units include: sequential unit B1 and sequential unit B2; in S2, on the directed graph: sequential unit B1 is reduced to node B1, and sequential unit B2 is reduced to node B2; in S3.1.1, both node B1 and node B2 are identified as group B; in S3.1.2: clock model CB1 is inserted into node B1, and clock model CB1 is set to include data input terminal CB1, data output terminal CB1, user enable terminal CB1 and clock input terminal CB1; the clock model CB2 is inserted into the node B2, and the clock model CB2 is configured to include a data input terminal CB2, a data output terminal CB2, a user enable terminal CB2 and a clock input terminal CB2; S3.1 also includes: setting a sampling unit CB1s for the clock model CB1, setting a data input terminal CB1s, an enable terminal CB1s, a clock input terminal CB1s and a data output terminal CB1s for the sampling unit CB1s; setting a sampling unit CB2s for the clock model CB2, setting a data input terminal CB2s, an enable terminal CB2s, a clock input terminal CB2s and a data output terminal CB2s for the sampling unit CB2s; identifying the anchor point to which the user enable terminal CB1 is connected; if the user enable terminal CB2 is connected to the anchor point: jointly setting an edge detector E12 for the clock model CB1 and the clock model CB2; setting a user enable terminal E12, a clock input terminal E12 and a valid edge output terminal E12 for the clock detector E12; connecting the user enable terminal E12 to the anchor point, the user enable terminal CB1 and user enable terminal CB2; connect the clock input terminal E12 to the clock input terminal CB1s, the clock input terminal CB1, the clock input terminal CB2s and the clock input terminal CB2; connect the valid edge output terminal E12 to the enable terminal CB1s and the enable terminal CB2s; connect the data input terminal CB1s to the data input terminal CB1; connect the data output terminal CB1s to the data output terminal CB1; connect the data input terminal CB2s to the data input terminal CB2; connect the data output terminal CB2s to the data output terminal CB2.

[0202] The beneficial effect of the third embodiment is that, due to the simple structure of the clock model CB, the consumption of FPGA hardware resources can be reduced to a greater extent compared with the first and second embodiments.

[0203] Based on the same inventive concept as the above-mentioned method embodiments, an embodiment of the present invention also provides a system for simulating IC design on FPGA, comprising a processor and a storage medium communicatively connected to the processor, wherein: when the processor executes a program in the storage medium, the system can implement a method for simulating IC design on FPGA provided in any one of the above-mentioned embodiments.

[0204] Among them, the processor may include one or more processing cores, such as a 4-core processor, a 12-core processor, etc. The processor can be implemented in at least one hardware form of digital signal processing (DSP), field programmable gate array (FPGA), and programmable logic array (PLA). The processor may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a CPU; the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor may be integrated with a graphics processing unit (GPU), which is responsible for rendering and drawing the content that needs to be displayed on the display. In some embodiments, the processor may also include an artificial intelligence (AI) processor, which is used to process computing operations related to machine learning.

[0205] Among them, the storage medium is a memory device in a computer device, which is used to store information such as computer-readable instructions, data structures, program modules or other data. It is understandable that the storage medium here can include both built-in storage media in the computer device and, of course, extended storage media supported by the computer device. The storage medium provides a storage space, in which one or more computer instructions suitable for being loaded and executed by the processor are also stored. These computer instructions can be one or more computer programs (including program codes). It should be noted that the storage medium here can be a high-speed RAM memory or a non-volatile memory (Non-volatile Memory). For example, the storage medium includes RAM, ROM, Erasable Programmable Read-only Memory (EPROM), Electrically Erasable Programmable Read-only Memory (EEPROM), flash memory or other solid-state storage technology, CD-ROM, Digital Video Disc (DVD) or other optical storage, tape cassette, tape, disk storage or other magnetic storage devices, etc. Of course, those skilled in the art will know that computer storage media are not limited to the above-mentioned ones.

[0206] Based on the same inventive concept as the above-mentioned method embodiments, an embodiment of the present invention provides a non-transitory computer-readable storage medium, in which at least one instruction or at least one program is stored. The at least one instruction or the at least one program is loaded and executed by a processor to implement a method for simulating IC design on FPGA provided by any one of the above-mentioned method embodiments, wherein a method for simulating IC design on FPGA has been described in detail in the above-mentioned method embodiments and will not be repeated here.

Claims

1. A method for simulating an IC design on an FPGA, comprising: S1) Identify in IC design: the master clock; Subcircuit; Multiple generated clocks, the main clock is operated by sub-circuits to generate multiple generated clocks; and a plurality of timing units, wherein the user clock connected to the plurality of timing units is the master clock or the plurality of generated clocks; S2) reducing the IC design to a directed graph, including: 2.1) reducing the plurality of sequential units to a plurality of nodes, including: identifying a user clock input terminal and a data output terminal on each sequential unit; defining a logical path from the user clock input terminal to the data output terminal as a node; 2.2) connecting the multiple nodes to obtain a directed graph; S3) setting nodes on the directed graph, including: 3.1) Inserting a clock model into a node on the directed graph, including: 3.1.1) at least one node on the directed graph is identified as group A and at least another node is identified as group B; 3.1.2) Modify the nodes identified as group A, including: i) setting a data input terminal CA, a data output terminal CA, a user enable terminal CA and a clock input terminal CA for the clock model CA; ii) Modify node A in the nodes identified as group A, insert clock model CA into node A, including: Modify the data input terminal and data output terminal of node A to data input terminal CA and data output terminal CA respectively; Change the user clock input terminal of node A to the user enable terminal CA; connect the master clock 'to the clock input terminal CA, Wherein: the frequency of the master clock 'is greater than or equal to the frequency of the master clock; setting the clock model CA includes: The signal from the data input terminal CA is sampled at each effective edge of the master clock ', and the sampled data in a cycle of the master clock ' starting from the effective edge is obtained; when the user clock A has an effective edge for the Nth time, the sampled data of the master clock ' in the current cycle is obtained, and the sampled data is output to the data output terminal CA until the user clock A has an effective edge for the N+1th time; 3.1.3) Modify the nodes identified as group B, including: i) setting a data input terminal CB, a data output terminal CB, a user enable terminal CB and a clock input terminal CB for the clock model CB; ii) modifying node B in the nodes identified as group B, inserting clock model CB in node B, including: Connect the data input terminal and the data output terminal of the node B to the data input terminal CB and the data output terminal CB respectively; connect the user clock input terminal of the node B to the user enable terminal CB; connect the master clock 'to the clock input terminal CB; set the clock model CB to include: when the effective edge of the user clock B occurs and the effective edge of the master clock ' occurs: sample the signal from the data input terminal CB to obtain sampled data within a cycle of the master clock ' starting from the effective edge of the master clock '; output the sampled data to the data output terminal CB; 3.2) Set the phase offset for the master clock.

2. The method according to claim 1, wherein S3.1.2 further comprises: Setting a clock detector E1 and a sampling unit CAs for a clock model CA; A user enable terminal E1, a clock input terminal E1 and a valid edge output terminal E1 are set for the clock detector E1; Setting a data input terminal CAs, an enable terminal CAs, a clock input terminal CAs and a data output terminal CAs for the sampling unit CAs; Connect the user enable terminal E1 to the user enable terminal CA; Connect the clock input terminal E1 and the clock input terminal CAs to the clock input terminal CA; Connect the effective edge output terminal E1 to the enable terminal CAs; Connect the data input terminal CAs to the data input terminal CA; and Connect the data output terminal CAs to the data output terminal CA.

3. The method according to claim 2, wherein S3.1.2 further comprises: A first basic storage unit Re1, a second basic storage unit Re2 and a multiplexer MUX1 are provided for the sampling unit CAs; A clock input terminal Re1, a data input terminal Re1 and a data output terminal Re1 are provided for the first basic storage unit Re1; A clock input terminal Re2, a data input terminal Re2 and a data output terminal Re2 are provided for the second basic storage unit Re2; A first data input terminal MUX1, a second data input terminal MUX1, a signal selection terminal MUX1 and a data output terminal MUX1 are provided for the multiplexer MUX1; Connect the data input terminal Re1 to the data input terminal CAs; Connect the data output terminal MUX1 to the data output terminal CAs; Connect the clock input terminal Re1 and the clock input terminal Re2 to the clock input terminal CAs; Connect the data output terminal Re1 to the first data input terminal MUX1; Connect the data input terminal Re2 to the data output terminal MUX1; Connecting the data output terminal Re2 to the second data input terminal MUX1; and Connect the enable terminal CAs to the signal selection terminal MUX1.

4. The method according to claim 1, wherein: S2.1 also includes identifying, on the timing unit: Data input terminal; User clock input terminal; Data output terminal; and Enable end; and S3.1.2 also includes: Setting a data input terminal CA, a data output terminal CA, a user enable terminal CA, a clock input terminal CA and an enable terminal CA for the clock model CA; A clock detector E1, a first basic storage unit Re1, a second basic storage unit Re2, a multiplexer MUX1 and a multiplexer MUX2 are provided for the clock model CA; A user enable terminal E1, a clock input terminal E1 and a valid edge output terminal E1 are set for the clock detector E1; A clock input terminal Re1, a data input terminal Re1 and a data output terminal Re1 are provided for the first basic storage unit Re1; A clock input terminal Re2, a data input terminal Re2 and a data output terminal Re2 are provided for the second basic storage unit Re2; A first data input terminal MUX1, a second data input terminal MUX1, a signal selection terminal MUX1 and a data output terminal MUX1 are provided for the multiplexer MUX1; A first data input terminal MUX2, a second data input terminal MUX2, a signal selection terminal MUX2 and a data output terminal MUX2 are provided for the multiplexer MUX2; Connect the second data input terminal MUX2 to the data input terminal CA; Connect the data output terminal MUX1 to the data output terminal CA, the data input terminal Re2 and the first data input terminal MUX2; Connect the clock input terminal Re1, the clock input terminal Re2 and the clock input terminal E1 to the clock input terminal CA; Connect the user enable terminal E1 to the user enable terminal CA; Connect the effective edge output terminal E1 to the signal selection terminal MUX1; Connect the data output terminal Re2 to the second data input terminal MUX1; Connect the enable terminal CA to the signal selection terminal MUX2; Connecting the data output terminal MUX2 to the data input terminal Re1; and The data output terminal Re1 is connected to the first data input terminal MUX1.

5. The method according to claim 3 or 4, wherein: The first basic storage unit Re1 is configured as a register or a latch; and The second basic storage unit Re2 is configured as a register or a latch.

6. The method according to claim 1, wherein S3.1.3 further comprises: Setting a clock detector E2 and a sampling unit CBs for the clock model CB; A user enable terminal E2, a clock input terminal E2 and a valid edge output terminal E2 are set for the clock detector E2; Setting a clock input terminal CBs, an enable terminal CBs, a data input terminal CBs, and a data output terminal CBs for the sampling unit CBs; Connect the data input terminal CBs to the data input terminal CB; Connect the data output terminal CBs to the data output terminal CB; Connect the clock input terminal E2 and the clock input terminal CBs to the clock input terminal CB; Connect the user enable terminal E2 to the user enable terminal CB; and Connect the effective edge output terminal E2 to the enable terminal CBs.

7. The method according to claim 6, wherein: the sampling unit CBs is configured as a register having an enable terminal.

8. The method according to claim 6, wherein S3.1.3 further comprises: A fourth basic storage unit Re4 and a multiplexer MUX3 are provided for the sampling unit CBs; A clock input terminal Re4, a data input terminal Re4 and a data output terminal Re4 are provided for the fourth basic storage unit Re4; A first data input terminal MUX3, a second data input terminal MUX3, a signal selection terminal MUX3 and a data output terminal MUX3 are set for the multiplexer MUX3; Connect the first data input terminal MUX3 to the data input terminal CBs; Connect the data output terminal Re4 to the second data input terminal MUX3 and the data output terminal CBs; Connect the clock input terminal Re4 to the clock input terminal CBs; Connect the signal selection terminal MUX3 to the enable terminal CBs; and The data output terminal MUX3 is connected to the data input terminal Re4.

9. The method according to claim 1, wherein S3.1.3 further comprises: A third basic storage unit Re3, a fourth basic storage unit Re4 and a lookup table LUT1 are set for the clock model CB; A clock input terminal Re3, a data input terminal Re3 and a data output terminal Re3 are provided for the third basic storage unit Re3; A clock input terminal Re4, a data input terminal Re4 and a data output terminal Re4 are provided for the fourth basic storage unit Re4; Setting a first data input terminal LUT1, a second data input terminal LUT1, a third data input terminal LUT1, a fourth data input terminal LUT1 and a data output terminal LUT1 for the lookup table LUT1; Connect the second data input terminal LUT1 to the data input terminal CB; Connect the data output terminal Re4 to the first data input terminal LUT1 and the data output terminal CB; Connect the clock input terminal Re3 and the clock input terminal Re4 to the clock input terminal CB; Connect the data input terminal Re3 and the third data input terminal LUT1 to the user enable terminal CB; Connecting the data output terminal Re3 to the fourth data input terminal LUT1; and The data output terminal LUT1 is connected to the data input terminal Re4.

10. The method of claim 1, wherein: S2.1 also includes identifying, on the timing unit: Data input terminal; User clock input terminal; Data output terminal; and Enable end; and S3.1.3 also includes: Setting a data input terminal CB, a data output terminal CB, a user enable terminal CB, a clock input terminal CB and an enable terminal CB for the clock model CB; Set a clock detector E2, a storage unit ERe1 and a multiplexer MUX4 for the clock model CB; A user enable terminal E2, a clock input terminal E2 and a valid edge output terminal E2 are set for the clock detector E2; A clock input terminal ERe1, an enable terminal ERe1, a data input terminal ERe1, and a data output terminal ERe1 are set for the storage unit ERe1; A first data input terminal MUX4, a second data input terminal MUX4, a signal selection terminal MUX4 and a data output terminal MUX4 are provided for the multiplexer MUX4; Connect the second data input terminal MUX4 to the data input terminal CB; Connect the signal selection terminal MUX4 to the enable terminal CB; Connect the data output terminal ERe1 to the data output terminal CB and the first data input terminal MUX4; Connect the clock input terminal E2 and the clock input terminal ERe1 to the clock input terminal CB; Connect the user enable terminal E2 to the user enable terminal CB; Connect the valid edge output terminal E2 to the enable terminal ERe1; and The data output terminal MUX4 is connected to the data input terminal ERe1.

11. The method according to claim 9, wherein: The third basic storage unit Re3 is configured as a register or a latch.

12. The method according to claim 8 or 9, wherein: The fourth basic storage unit Re4 is configured as a register or a latch.

13. The method of claim 1, wherein: The valid edge is set to a rising edge or a falling edge.

14. The method according to claim 1, further comprising: S1, identifying multiple sequential units including: Sequential unit A1; and Timing unit B1; In S2, on the directed graph: Sequential unit A1 is reduced to node A1; Sequential cell B1 is reduced to node B1; In S3.1.1: Node A1 is identified as group A; Node B1 is identified as group B; In S3.1.2: Clock model CA1 is inserted into node A1; and The clock model CA1 is configured to include a data input terminal CA1, a data output terminal CA1, a user enable terminal CA1 and a clock input terminal CA1; In S3.1.3: Clock model CB1 is inserted into node B1; and The clock model CB1 is configured to include a data input terminal CB1, a data output terminal CB1, a user enable terminal CB1 and a clock input terminal CB1; S3.1 also includes: Set sampling unit CA1s for clock model CA1; Setting a data input terminal CA1s, an enable terminal CA1s, a clock input terminal CA1s and a data output terminal CA1s for the sampling unit CA1s; Set sampling unit CB1s for clock model CB1; Setting a data input terminal CB1s, an enable terminal CB1s, a clock input terminal CB1s and a data output terminal CB1s for the sampling unit CB1s; Identify the anchor point to which the user enable terminal CA1 accesses; and If the user enabling terminal CB1 is connected to the anchor point: A clock detector E12 is provided for both the clock model CA1 and the clock model CB1; A user enable terminal E12, a clock input terminal E12 and a valid edge output terminal E12 are set for the clock detector E12; Connecting the user enable terminal E12 to the anchor point, the user enable terminal CA1 and the user enable terminal CB1; Connect the clock input terminal E12 to the clock input terminal CA1s, the clock input terminal CA1, the clock input terminal CB1s and the clock input terminal CB1; Connect the effective edge output terminal E12 to the enable terminal CA1s and the enable terminal CB1s; Connect the data input terminal CA1s to the data input terminal CA1; Connect the data output terminal CA1s to the data output terminal CA1; Connecting the data input terminal CB1s to the data input terminal CB1; and Connect the data output terminal CB1s to the data output terminal CB1.

15. The method according to claim 1, further comprising: S1, identifying multiple sequential units including: Sequential unit A1; and Timing unit A2; In S2, on the directed graph: Sequential unit A1 is reduced to node A1; Sequential unit A2 is reduced to node A2; In S3.1.1, both node A1 and node A2 are identified as group A; In S3.1.2: The clock model CA1 is inserted into node A1; The clock model CA1 is configured to include a data input terminal CA1, a data output terminal CA1, a user enable terminal CA1 and a clock input terminal CA1; Clock model CA2 is inserted into node A2; and The clock model CA2 is configured to include a data input terminal CA2, a data output terminal CA2, a user enable terminal CA2 and a clock input terminal CA2; S3.1 also includes: Set sampling unit CA1s for the bell model CA1; Setting a data input terminal CA1s, an enable terminal CA1s, a clock input terminal CA1s and a data output terminal CA1s for the sampling unit CAs1; Set sampling unit CA2s for clock model CA2; Setting a data input terminal CA2s, an enable terminal CA2s, a clock input terminal CA2s and a data output terminal CA2s for the sampling unit CA2s; Identify the anchor point to which the user enable terminal CA1 accesses; and If the user enabler CA2 is connected to the anchor point: A clock detector E12 is provided for both the clock model CA1 and the clock model CA2; A user enable terminal E12, a clock input terminal E12 and a valid edge output terminal E12 are set for the clock detector E12; Connecting the user enable terminal E12 to the anchor point, the user enable terminal CA1 and the user enable terminal CA2; Connect the clock input terminal E12 to the clock input terminal CA1s, the clock input terminal CA1, the clock input terminal CA2s and the clock input terminal CA2; Connect the effective edge output terminal E12 to the enable terminal CA1s and the enable terminal CA2s; Connect the data input terminal CA1s to the data input terminal CA1; Connect the data output terminal CA1s to the data output terminal CA1; Connecting the data input terminal CA2s to the data input terminal CA2; and Connect the data output terminal CA2s to the data output terminal CA2.

16. The method according to claim 1, further comprising: S1, identifying multiple sequential units including: Sequential unit B1; and Timing unit B2; In S2, on the directed graph: Sequential cell B1 is reduced to node B1; Sequential unit B2 is reduced to node B2; In S3.1.1, both Node B1 and Node B2 are identified as Group B; In S3.1.3: The clock model CB1 is inserted into node B1; The clock model CB1 is configured to include a data input terminal CB1, a data output terminal CB1, a user enable terminal CB1 and a clock input terminal CB1; Clock model CB2 is inserted into node B2; and The clock model CB2 is configured to include a data input terminal CB2, a data output terminal CB2, a user enable terminal CB2 and a clock input terminal CB2; S3.1 also includes: Set sampling unit CB1s for clock model CB1; A data input terminal CB1s, an enable terminal CB1s, a clock input terminal CB1s and a data output terminal CB1s are set for the sampling unit CBs1; Set sampling unit CB2s for clock model CB2; Setting a data input terminal CB2s, an enable terminal CB2s, a clock input terminal CB2s and a data output terminal CB2s for the sampling unit CB2s; Identify the anchor point to which the user enable terminal CB1 is connected; and If the user enabling terminal CB2 is connected to the anchor point: A clock detector E12 is provided for both the clock model CB1 and the clock model CB2; A user enable terminal E12, a clock input terminal E12 and a valid edge output terminal E12 are set for the clock detector E12; Connecting the user enable terminal E12 to the anchor point, the user enable terminal CB1 and the user enable terminal CB2; Connect the clock input terminal E12 to the clock input terminal CB1s, the clock input terminal CB1, the clock input terminal CB2s and the clock input terminal CB2; Connect the effective edge output terminal E12 to the enable terminal CB1s and the enable terminal CB2s; Connect the data input terminal CB1s to the data input terminal CB1; Connect the data output terminal CB1s to the data output terminal CB1; Connecting the data input terminal CB2s to the data input terminal CB2; and Connect the data output terminal CB2s to the data output terminal CB2.

17. The method according to claim 1, further comprising: S4) obtaining a modified IC design; S5) writing the modified IC design into the FPGA; and S6) Verifying the IC design on the FPGA into which the modified IC design is written.

18. The method according to claim 1, characterized in that S3.2 also includes: 3.2.1) identifying a path on the directed graph, and setting a phase offset for a master clock 'of a node connected to the path; 3.2.2) The K nodes on the path are numbered in sequence, the root node is node 1, and one of the leaf nodes is node K; Identify the nodes identified as group B on the path, including node M and node N, and 1≤N<M≤K; set the phase t of the master clock ' accessed by node M M The phase t that lags behind the master clock ′ accessed by node N N ; Identify the nodes identified as group A on the path, including node U; identify the nodes closest to node U and identified as group B, including node R and node S, wherein: R<U<S; set the phase of the master clock 'of node U to lag behind or be equal to the phase of the master clock 'of node R; set the phase of the master clock 'of node U to lead or be equal to the phase of the master clock 'of node S; 3.2.3) Identify other paths on the directed graph, and set phase offsets for the master clocks' of the nodes connected to the other paths.

19. A method for simulating an IC design on an FPGA, comprising: S1) Identify in IC design: the master clock; Subcircuit; Multiple generated clocks, the main clock is operated by sub-circuits to generate multiple generated clocks; and a plurality of timing units, wherein the user clock connected to the plurality of timing units is the master clock or the plurality of generated clocks; S2) reducing the IC design to a directed graph, including: 2.1) reducing the plurality of sequential units to a plurality of nodes, including: identifying a user clock input terminal and a data output terminal on each sequential unit; defining a logical path from the user clock input terminal to the data output terminal as a node; 2.2) connecting the multiple nodes to obtain a directed graph; S3) setting nodes on the directed graph, including: 3.1) Inserting a clock model into a node on the directed graph, including: 3.1.1) identifying all nodes on the directed graph as group A; 3.1.2) Modify the nodes identified as group A, including: i) setting a data input terminal CA, a data output terminal CA, a user enable terminal CA and a clock input terminal CA for the clock model CA; ii) Modify node A in the nodes identified as group A, insert clock model CA into node A, including: The data input terminal and the data output terminal of the node A are modified to the data input terminal CA and the data output terminal CA respectively; the user clock input terminal of the node A is modified to the user enable terminal CA; the master clock 'is connected to the clock input terminal CA, wherein: the frequency of the master clock 'is greater than or equal to the frequency of the master clock; setting the clock model CA includes: sampling the signal from the data input terminal CA at each valid edge of the master clock ', and obtaining the sampled data within a cycle of the master clock ' starting from the valid edge; when the user clock A has a valid edge for the Nth time, obtaining the sampled data of the master clock 'in the current cycle, and outputting the sampled data to the data output terminal CA until the user clock A has a valid edge for the N+1th time; 3.2) Set the phase offset for the master clock.

20. The method according to claim 19, wherein S3.1 further comprises: Setting a clock detector E1 and a sampling unit CAs for a clock model CA; A user enable terminal E1, a clock input terminal E1 and a valid edge output terminal E1 are set for the clock detector E1; Setting a data input terminal CAs, an enable terminal CAs, a clock input terminal CAs and a data output terminal CAs for the sampling unit CAs; Connect the user enable terminal E1 to the user enable terminal CA; Connect the clock input terminal E1 and the clock input terminal CAs to the clock input terminal CA; Connect the effective edge output terminal E1 to the enable terminal CAs; Connect the data input terminal CAs to the data input terminal CA; and Connect the data output terminal CAs to the data output terminal CA.

21. The method according to claim 20, wherein S3.1 further comprises: A first basic storage unit Re1, a second basic storage unit Re2 and a multiplexer MUX1 are provided for the sampling unit CAs; A clock input terminal Re1, a data input terminal Re1 and a data output terminal Re1 are provided for the first basic storage unit Re1; A clock input terminal Re2, a data input terminal Re2 and a data output terminal Re2 are provided for the second basic storage unit Re2; A first data input terminal MUX1, a second data input terminal MUX1, a signal selection terminal MUX1 and a data output terminal MUX1 are provided for the multiplexer MUX1; Connect the data input terminal Re1 to the data input terminal CAs; Connect the data output terminal MUX1 to the data output terminal CAs; Connect the clock input terminal Re1 and the clock input terminal Re2 to the clock input terminal CAs; Connect the data output terminal Re1 to the first data input terminal MUX1; Connect the data input terminal Re2 to the data output terminal MUX1; Connecting the data output terminal Re2 to the second data input terminal MUX1; and Connect the enable terminal CAs to the signal selection terminal MUX1.

22. The method according to claim 19, further comprising: S1, identifying multiple sequential units including: Sequential unit A1; and Timing unit A2; In S2, on the directed graph: Sequential unit A1 is reduced to node A1; Sequential unit A2 is reduced to node A2; In S3.1.1, both node A1 and node A2 are identified as group A; In S3.1.2: The clock model CA1 is inserted into node A1; The clock model CA1 is configured to include a data input terminal CA1, a data output terminal CA1, a user enable terminal CA1 and a clock input terminal CA1; Clock model CA2 is inserted into node A2; and The clock model CA2 is configured to include a data input terminal CA2, a data output terminal CA2, a user enable terminal CA2 and a clock input terminal CA2; S3.1 also includes: Set sampling unit CA1s for the bell model CA1; Setting a data input terminal CA1s, an enable terminal CA1s, a clock input terminal CA1s and a data output terminal CA1s for the sampling unit CAs1; Set sampling unit CA2s for clock model CA2; Setting a data input terminal CA2s, an enable terminal CA2s, a clock input terminal CA2s and a data output terminal CA2s for the sampling unit CA2s; Identify the anchor point to which the user enable terminal CA1 accesses; and If the user enabler CA2 is connected to the anchor point: A clock detector E12 is provided for both the clock model CA1 and the clock model CA2; A user enable terminal E12, a clock input terminal E12 and a valid edge output terminal E12 are set for the clock detector E12; Connecting the user enable terminal E12 to the anchor point, the user enable terminal CA1 and the user enable terminal CA2; Connect the clock input terminal E12 to the clock input terminal CA1s, the clock input terminal CA1, the clock input terminal CA2s and the clock input terminal CA2; Connect the effective edge output terminal E12 to the enable terminal CA1s and the enable terminal CA2s; Connect the data input terminal CA1s to the data input terminal CA1; Connect the data output terminal CA1s to the data output terminal CA1; Connecting the data input terminal CA2s to the data input terminal CA2; and Connect the data output terminal CA2s to the data output terminal CA2.

23. A method for simulating IC design on an FPGA, comprising: S1) Identify in IC design: the master clock; Subcircuit; Multiple generated clocks, the main clock is operated by sub-circuits to generate multiple generated clocks; and a plurality of timing units, wherein the user clock connected to the plurality of timing units is the master clock or the plurality of generated clocks; S2) reducing the IC design to a directed graph, including: 2.1) reducing the plurality of sequential units to a plurality of nodes, including: identifying a user clock input terminal and a data output terminal on each sequential unit; defining a logical path from the user clock input terminal to the data output terminal as a node; 2.2) connecting the multiple nodes to obtain a directed graph; S3) setting nodes on the directed graph, including: 3.1) Inserting a clock model into a node on the directed graph, including: 3.1.1) identifying all nodes on the directed graph as group B; 3.1.2) Modify the nodes identified as group B, including: i) setting a data input terminal CB, a data output terminal CB, a user enable terminal CB and a clock input terminal CB for the clock model CB; ii) modifying node B in the nodes identified as group B, inserting clock model CB in node B, including: The data input terminal and the data output terminal of the node B are connected to the data input terminal CB and the data output terminal CB respectively; the user clock input terminal of the node B is connected to the user enable terminal CB; the master clock 'is connected to the clock input terminal CB; the clock model CB is set to include: when the valid edge of the user clock B occurs and the valid edge of the master clock ' occurs: Sampling the signal from the data input terminal CB to obtain sampled data within a cycle of the master clock ' starting from the effective edge of the master clock '; outputting the sampled data to the data output terminal CB; 3.2) Set the phase offset for the master clock.

24. The method according to claim 23, wherein S3.1 further comprises: Setting a clock detector E2 and a sampling unit CBs for the clock model CB; A user enable terminal E2, a clock input terminal E2 and a valid edge output terminal E2 are set for the clock detector E2; Setting a clock input terminal CBs, an enable terminal CBs, a data input terminal CBs, and a data output terminal CBs for the sampling unit CBs; Connect the data input terminal CBs to the data input terminal CB; Connect the data output terminal CBs to the data output terminal CB; Connect the clock input terminal E2 and the clock input terminal CBs to the clock input terminal CB; Connect the user enable terminal E2 to the user enable terminal CB; and Connect the effective edge output terminal E2 to the enable terminal CBs.

25. The method according to claim 24, wherein: the sampling unit CBs is configured as a register having an enable terminal.

26. The method according to claim 24, further comprising: S1, identifying multiple sequential units including: Sequential unit B1; and Timing unit B2; In S2, on the directed graph: Sequential cell B1 is reduced to node B1; Sequential unit B2 is reduced to node B2; In S3.1.1, both Node B1 and Node B2 are identified as Group B; In S3.1.2: The clock model CB1 is inserted into node B1; The clock model CB1 is configured to include a data input terminal CB1, a data output terminal CB1, a user enable terminal CB1 and a clock input terminal CB1; Clock model CB2 is inserted into node B2; and The clock model CB2 is configured to include a data input terminal CB2, a data output terminal CB2, a user enable terminal CB2 and a clock input terminal CB2; S3.1 also includes: Set sampling unit CB1s for clock model CB1; A data input terminal CB1s, an enable terminal CB1s, a clock input terminal CB1s and a data output terminal CB1s are set for the sampling unit CBs1; Set sampling unit CB2s for clock model CB2; Setting a data input terminal CB2s, an enable terminal CB2s, a clock input terminal CB2s and a data output terminal CB2s for the sampling unit CB2s; Identify the anchor point to which the user enable terminal CB1 is connected; and If the user enabling terminal CB2 is connected to the anchor point: A clock detector E12 is provided for both the clock model CB1 and the clock model CB2; A user enable terminal E12, a clock input terminal E12 and a valid edge output terminal E12 are set for the clock detector E12; Connecting the user enable terminal E12 to the anchor point, the user enable terminal CB1 and the user enable terminal CB2; Connect the clock input terminal E12 to the clock input terminal CB1s, the clock input terminal CB1, the clock input terminal CB2s and the clock input terminal CB2; Connect the effective edge output terminal E12 to the enable terminal CB1s and the enable terminal CB2s; Connect the data input terminal CB1s to the data input terminal CB1; Connect the data output terminal CB1s to the data output terminal CB1; Connecting the data input terminal CB2s to the data input terminal CB2; and Connect the data output terminal CB2s to the data output terminal CB2.

27. A system for simulating an IC design on an FPGA, comprising a processor and a storage medium in communication with the processor, wherein: When the processor executes the program in the storage medium, the system can implement the method according to any one of claims 1 to 26.

28. A non-transitory computer-readable storage medium, wherein at least one instruction or at least one program is stored in the storage medium, wherein: The at least one instruction or the at least one program is loaded and executed by the processor to implement the method as claimed in any one of claims 1 to 26.

Citation Information

Patent Citations

  • Memory read data test circuit structure and design method thereof

    CN111370040A

  • Integrated Circuit Design Verification Through Forced Clock Glitches

    US20140325463A1