Trigger merging method, system, medium and product based on K-means clustering

By automatically selecting the initial clustering center and Manhattan distance threshold for clustering, the instability problem of K-mean clustering algorithm in integrated circuit design is solved, and more efficient flip-flop merging is achieved, reducing the area of ​​the clock network and Power consumption.

CN118886388BActive Publication Date: 2024-12-10NAT UNIV OF DEFENSE TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411356662.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-27
Publication Date
2024-12-10
Estimated Expiration
2044-09-27

AI Technical Summary

Technical Problem

In the physical design of integrated circuits, the K-mean clustering algorithm is sensitive to the selection of the initial clustering center, resulting in unstable clustering results, affecting the flip-flop merging effect, and thus increasing the area and power consumption of the clock network.

Method used

By automatically selecting and determining the number and location of the initial cluster center, using the Manhattan distance threshold to cluster the triggers, and merge the triggers after clustering, reducing the number of clock leaf nodes and clock buffers, and reducing the area and function of the clock network Consumption.

Benefits of technology

The processing accuracy of the K-mean clustering algorithm is improved, the number of flip-flop merges is maximized, the line length and power consumption of the clock network are reduced, and the clock deviation is better controlled.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118886388B_ABST
    Figure CN118886388B_ABST
Patent Text Reader

Abstract

The present invention discloses a trigger merging method, system, medium and product based on K-means clustering. The method of the present invention comprises obtaining all triggers in the same clock domain in the layout completed design and putting them into a list; taking a trigger from the list as the current cluster center, calculating the distance from other triggers to the trigger; if the distance is less than T1, adding the trigger to the class corresponding to the current cluster center; if the distance is less than T2, deleting the trigger from the list; repeating the above steps to finally obtain K Cluster centers are assigned to triggers according to the cost value. K The present invention aims to reduce the number of clock tree leaf nodes and thus reduce the line length of the clock network and the number of clock buffers required on the clock network, thereby reducing the area and power consumption of the clock network and better controlling the clock deviation by automatically selecting and determining the number and position of the initial cluster centers and merging the clustered triggers.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of integrated circuit digital circuit design, and in particular to a trigger merging method, system, medium and product based on K-means clustering. Background Art

[0002] In VLSI chips, power consumption has become a limiting factor in chip design. Clock power consumption is the main source of VLSI chip power consumption. Using multi-bit flip-flops in integrated circuit physical design has become an effective means of clock power consumption optimization. In the physical design process, merging a single-bit flip-flop into a multi-bit flip-flop can reduce the number of clock tree leaf nodes and thus reduce the line length of the clock network and the number of clock buffers required on the clock network, effectively reducing the area and power consumption of the clock network.

[0003] K-means clustering is an unsupervised machine learning method that can group similar objects into the same cluster to achieve a fully automatic classification. However, the execution of K-means clustering requires pre-specified K value, K The choice of value is often a difficult problem. K The selection of K-means values ​​will lead to different clustering results. In addition, K-means clustering is very sensitive to the selection of initial cluster centers, and different initial value selections will also lead to completely different clustering results. Therefore, how to improve the clustering effect of trigger merging based on K-means clustering in integrated circuit physical design has become a key technical problem that needs to be solved urgently. Summary of the invention

[0004] Technical problem to be solved by the present invention: In view of the above-mentioned problems in the prior art, a trigger merging method, system, medium and product based on K-means clustering are provided. The present invention aims to reduce the number of clock tree leaf nodes and thus reduce the line length of the clock network and the number of clock buffers required on the clock network, thereby reducing the area and power consumption of the clock network and better controlling clock deviation by automatically selecting and determining the number and positions of initial clustering centers and merging the clustered triggers.

[0005] In order to solve the above technical problems, the technical solution adopted by the present invention is:

[0006] A trigger merging method based on K-means clustering comprises the following steps:

[0007] S1, obtain all flip-flops in the same clock domain in a layout-completed design and put them into a list;

[0008] S2, a trigger is selected from the list as the current cluster center, its location coordinates are obtained and deleted from the list;

[0009] S3, select any trigger from the list, obtain its location coordinates and calculate the distance to the current cluster center;

[0010] S4, if the distance is less than a preset distance threshold T1, the trigger is added to the class corresponding to the current cluster center; if the distance is less than a preset distance threshold T2 which is smaller than the distance threshold T1, the trigger is deleted from the list;

[0011] S5, determine whether the list is empty, if it is empty, get K The position coordinates of the initial cluster centers, each cluster center corresponds to a cluster, jump to step S6; otherwise jump to step S2;

[0012] S6, assign each trigger to a cluster, calculate the cost of the trigger, and update the position coordinates of the cluster center of the cluster;

[0013] S7, determine whether the cost value of each trigger has changed, if it has changed, jump to step S6; otherwise, get the trigger clustering K Clusters are found, jump to step S8;

[0014] S8, merge the triggers in each cluster.

[0015] Optionally, the distance in step S3 is Manhattan distance, and the calculation function expression of the Manhattan distance is:

[0016] ,

[0017] In the above formula, is the Manhattan distance, is the position coordinate of the trigger, is the location coordinate of the current cluster center.

[0018] Optionally, the function expression for calculating the cost value of the trigger in step S6 is:

[0019] ,

[0020] In the above formula, For the value of To obtain the minimum value, is the position coordinate of the trigger, For the k The location coordinates of the cluster centers of the clusters, K is the number of clusters.

[0021] Optionally, the function expression for updating the position coordinates of the cluster center of the cluster cluster in step S6 is:

[0022] ,

[0023] ,

[0024] In the above formula, For the k The location coordinates of the cluster centers of the clusters, To be assigned to k The first i The position coordinates of the triggers, To be assigned to k The number of triggers in the clusters, k ∈[1, K ], K is the number of clusters.

[0025] Optionally, step S8 includes:

[0026] S8.1, traverse and select a cluster;

[0027] S8.2, performing trigger merging for the cluster, merging multiple triggers of the same type into a multi-bit trigger;

[0028] S8.3, determine whether the clustering has been traversed. If so, jump to step S8.4; otherwise, jump to step S8.1;

[0029] S8.4, execute the unit legalization operation to fine-tune the position coordinates of the replaced multi-bit flip-flop so that there is no design rule violation between it and other units, and then end and exit.

[0030] Optionally, step S8.2 includes:

[0031] S8.2.1, traverse and select a trigger in the current cluster, and obtain its location coordinates and type;

[0032] S8.2.2, if the number of triggers of the same type as the selected trigger in the cluster is greater than or equal to 4, then obtain the three triggers of the same type that are closest to the selected trigger in Manhattan distance; replace the selected trigger and the above three triggers of the same type with a 4-bit trigger of the same type and place it at the center of the four triggers, remove the four triggers from the cluster, and jump to step S8.2.4; otherwise, jump to step S8.2.3;

[0033] S8.2.3, if the number of triggers of the same type as the selected trigger in the cluster is equal to 2 or 3, obtain a trigger of the same type that is closest to the selected trigger in Manhattan distance; replace the selected trigger and the above trigger with a 2-bit trigger of the same type and place it at the center of the two triggers, and remove the two triggers from the cluster, and jump to step S8.2.4; otherwise, it means that the number of triggers of the same type as the selected trigger in the cluster is equal to 0 or 1, directly, jump to step S8.2.4;

[0034] S8.2.4, determine whether the current cluster has been traversed. If not, jump to step S8.2.1; otherwise, enter the processing of the next cluster or exit.

[0035] Optionally, the calculation function expression of the center position of the four triggers is:

[0036] ,

[0037] ,

[0038] In the above formula, is the position coordinate of the center position, For the first of these four triggers i The position coordinates of the two triggers; the calculation function expression of the center position of the two triggers is:

[0039] ,

[0040] ,

[0041] In the above formula, is the position coordinate of the center position, and They are the position coordinates of the two triggers respectively.

[0042] Optionally, step S8 further includes inserting a clock buffer at the center of each cluster to connect the clock terminals of all triggers in the cluster to reduce clock power consumption.

[0043] In addition, the present invention also provides a trigger merging system based on K-means clustering, comprising a microprocessor and a memory connected to each other, wherein the microprocessor is programmed or configured to execute the trigger merging method based on K-means clustering.

[0044] In addition, the present invention also provides a computer-readable storage medium, in which a computer program or instruction is stored. The computer program or instruction is programmed or configured to execute the trigger merging method based on K-means clustering through a processor.

[0045] In addition, the present invention also provides a computer program product, including a computer program or an instruction, wherein the computer program or the instruction is programmed or configured to execute the trigger merging method based on K-means clustering through a processor.

[0046] Compared with the prior art, the present invention mainly has the following advantages:

[0047] 1. The present invention automatically determines the K-means clustering algorithm K Value and K The position of the initial cluster center is adjusted, which reduces the randomness of the initial value selection of the K-means clustering algorithm and improves the processing accuracy of the K-means clustering algorithm.

[0048] 2. The present invention automatically clusters the triggers according to their specific distribution after layout, and merges the single-bit triggers in the clustered trigger cluster, which can maximize the number of trigger mergers, reduce the number of clock tree leaf nodes, and thus reduce the line length of the clock network and the number of clock buffers required on the clock network, thereby achieving the purpose of reducing the area and power consumption of the clock network, and can better control clock deviation. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] Figure 1 Schematic diagram of the basic flow of the method of the embodiment of the present invention.

[0050] Figure 2 The figure is a flowchart of trigger merging in an embodiment of the present invention.

[0051] Figure 3 It is a schematic diagram of the process of merging into 2-bit and 4-bit triggers in an embodiment of the present invention.

[0052] Figure 4 Schematic diagram of the relationship between a trigger and two distance thresholds in the method of an embodiment of the present invention.

[0053] Figure 5 Schematic diagram of coordinates after the initial cluster center is determined in the method of an embodiment of the present invention.

[0054] Figure 6 Schematic diagram of allocating triggers to clusters in the method of an embodiment of the present invention.

[0055] Figure 7 A schematic diagram of trigger merging in the method of an embodiment of the present invention.

[0056] Figure 8 Schematic diagram of inserting a clock buffer to drive a trigger at the center of a cluster in the method of an embodiment of the present invention. DETAILED DESCRIPTION

[0057] like Figure 1As shown, the trigger merging method based on K-means clustering in this embodiment includes the following steps:

[0058] S1, obtain all flip-flops in the same clock domain in a layout-completed design and put them into a list;

[0059] S2, select a trigger from the list as the current cluster center, obtain its location coordinates and delete it from the list;

[0060] S3, select any trigger from the list, obtain its location coordinates and calculate the distance to the current cluster center;

[0061] S4, if the distance is less than the preset distance threshold T1, the trigger is added to the class corresponding to the current cluster center; if the distance is less than the preset distance threshold T2 which is smaller than the distance threshold T1, the trigger is deleted from the list (that is, the trigger is close enough to the current cluster center and cannot be used as a new cluster center);

[0062] S5, determine whether the list is empty, if it is empty, get K The position coordinates of the initial cluster centers, each cluster center corresponds to a cluster, jump to step S6; otherwise jump to step S2;

[0063] S6, assign each trigger to a cluster, calculate the cost of the trigger, and update the position coordinates of the cluster center of the cluster;

[0064] S7, determine whether the cost value of each trigger has changed, if it has changed, jump to step S6; otherwise, get the trigger clustering K Clusters are found, jump to step S8;

[0065] S8, merge the triggers in each cluster.

[0066] As an optional implementation, the distance in step S3 of this embodiment is Manhattan distance, and the calculation function expression of the Manhattan distance is:

[0067] ,

[0068] In the above formula, is the Manhattan distance, is the position coordinate of the trigger, is the location coordinate of the current cluster center.

[0069] In step S4 of this embodiment, if the distance Less than the preset distance threshold T1 ( ), then add the trigger to the class corresponding to the current cluster center; if the distance is smaller than a preset distance threshold T2 which is smaller than the distance threshold T1 ( and ), then delete the trigger from the list, that is, the trigger is close enough to the current cluster center and cannot be used as a new cluster center; Figure 4 As shown, the Manhattan distance between trigger FF1 and cluster center C is less than T1, so it is added to the class corresponding to C. It is further determined that this distance is less than T2, that is, the trigger is close enough to cluster center C, and it can no longer be used as a new cluster center, so it is deleted from the trigger list; the Manhattan distance between trigger FF2 and the cluster center is greater than T2 and less than T1, so it is only added to the class corresponding to C, and the trigger can still be used as a new cluster center.

[0070] In step S5 of this embodiment, if the trigger list is not empty, then the process jumps to and repeats steps S2 to S4 until the trigger list is empty, that is, K The initial center coordinates of clusters, each center corresponds to a cluster, K The coordinates of the cluster centers are expressed as follows: C 1 , C 2 , …, C K )express K Cluster centers, the coordinates of each cluster center are ( μ x ( C k ), μ y ( C k )) ( k ∈[1, K ]) indicates. Figure 5 Shown is a schematic diagram of the coordinates of the six initial cluster centers after they are determined.

[0071] When each trigger is assigned to a cluster in step S6, the trigger may be assigned to the cluster with the smallest cost value first, such as Figure 6 As shown, the six triggers FF1, FF2, FF3, FF4, FF5 and FF6 are assigned to the cluster centers according to the Manhattan distance. C 1 , C 2 , C 3 、C 4 、C 5 and C 6 corresponding clusters.

[0072] As an optional implementation, let the coordinates of the trigger be ( x , y ), the cost value of the trigger calculated in step S6 of this embodiment is the Manhattan distance from the trigger to the center point of the cluster. The function expression for calculating the cost value of the trigger in step S6 of this embodiment is:

[0073] ,

[0074] In the above formula, For the value of To obtain the minimum value, is the position coordinate of the trigger, For the k The location coordinates of the cluster centers of the clusters, K is the number of clusters.

[0075] Without loss of generality, let cluster k ( k ∈[1, K ]) The number of triggers in M ,trigger i The coordinates of are ( x i , y i ), then the cluster k The updated center position coordinates are , the function expression for updating the position coordinates of the cluster center of the cluster cluster in step S6 of this embodiment is:

[0076] ,

[0077] ,

[0078] In the above formula, For the k The location coordinates of the cluster centers of the clusters, To be assigned to k The first i The position coordinates of the triggers, To be assigned to k The number of triggers in the clusters, k ∈[1, K ], K is the number of clusters. Finally, step S7 determines whether the cost value of each trigger has changed. If it has changed, jump to step S6; otherwise, get the trigger clustering. K If there are clusters, jump to step S8.

[0079] like Figure 2 As shown, step S8 includes:

[0080] S8.1, traverse and select a cluster;

[0081] S8.2, performing trigger merging for the cluster, merging multiple triggers of the same type into a multi-bit trigger;

[0082] S8.3, determine whether the clustering has been traversed. If so, jump to step S8.4; otherwise, jump to step S8.1;

[0083] S8.4, execute the unit legalization operation to fine-tune the position coordinates of the replaced multi-bit flip-flop so that there is no design rule violation between it and other units, and then end and exit.

[0084] In this embodiment, performing trigger merging for the cluster in step S8.2 includes: traversing and selecting a trigger in the current cluster and obtaining its position coordinates and type; and then merging the trigger according to the number of bits of the multi-bit trigger ( N ) Select the closest Manhattan distance N -1 trigger of the same type, connect the trigger and the closest Manhattan distance N -1 trigger of the same type (total N trigger) with one of the same type N bit flip-flop and place it here N The center position of the trigger, and then N The trigger is removed from the cluster.

[0085] It should be noted that most commercial standard cell libraries currently provide 2-bit and 4-bit flip-flops. Therefore, without loss of generality, the flip-flop merging method based on K-means clustering in this embodiment limits the number of bits of multi-bit flip-flops to 2 or 4, but the method in this embodiment can also be extended to apply to multi-bit flip-flops of any number of bits. Figure 3 As shown, based on the scenario of providing 2-bit and 4-bit flip-flops in the commercial standard cell library, step S8.2 in this embodiment includes:

[0086] S8.2.1, traverse and select a trigger in the current cluster, obtain its position coordinates and type, common trigger types include: D-flip-flop, D-flip-flop with reset terminal, D-flip-flop with set terminal, D-flip-flop with set-reset terminal, D-flip-flop with scan terminal, D-flip-flop with reset-scan terminal, D-flip-flop with set-scan terminal, and D-flip-flop with set-reset-scan terminal, etc.;

[0087] S8.2.2, if the number of triggers of the same type as the selected trigger in the cluster is greater than or equal to 4, then obtain the three triggers of the same type that are closest to the selected trigger in Manhattan distance; replace the selected trigger and the above three triggers of the same type with a 4-bit trigger of the same type and place it at the center of the four triggers, remove the four triggers from the cluster, and jump to step S8.2.4; otherwise, jump to step S8.2.3;

[0088] S8.2.3, if the number of triggers of the same type as the selected trigger in the cluster is equal to 2 or 3, obtain a trigger of the same type that is closest to the selected trigger in Manhattan distance; replace the selected trigger and the above trigger with a 2-bit trigger of the same type and place it at the center of the two triggers, and remove the two triggers from the cluster, and jump to step S8.2.4; otherwise, it means that the number of triggers of the same type as the selected trigger in the cluster is equal to 0 or 1, directly, jump to step S8.2.4;

[0089] S8.2.4, determine whether the current cluster has been traversed. If not, jump to step S8.2.1; otherwise, enter the processing of the next cluster or exit.

[0090] like Figure 7 As shown, assuming that the selected trigger is trigger 1, find three triggers of the same type 2, 3, and 4 with the closest Manhattan distance to it in the same cluster, replace the four triggers with a 4-bit trigger MBFF4 of the same type, and place it at the center of triggers 1, 2, 3, and 4. The calculation function expression of the center position of the four triggers in this embodiment is:

[0091] ,

[0092] ,

[0093] In the above formula, is the position coordinate of the center position (of the 4 triggers), For the first of these four triggers i The position coordinates of the two triggers; the calculation function expression of the center position of the two triggers is:

[0094] ,

[0095] ,

[0096] In the above formula, is the position coordinate of the center position (of the 2 triggers), and They are the position coordinates of the two triggers respectively.

[0097] As an optional implementation, step S8 further includes inserting a clock buffer at the center of each cluster to connect the clock terminals of all triggers in the cluster to reduce clock power consumption. Figure 8 As shown, a clock buffer (gray triangle) is inserted at the center of each of the three clusters to connect the clock terminals of all triggers in each cluster. In this way, the clock wiring of each trigger in each cluster can be minimized, thereby reducing clock power consumption.

[0098] In summary, the trigger merging method based on K-means clustering in this embodiment uses the K-means clustering algorithm in machine learning to automatically cluster the layout triggers and then merge the one-bit trigger in each trigger cluster into 2-bit or 4-bit triggers, which can reduce the number of clock tree leaf nodes and thus reduce the line length of the clock network and the number of clock buffers required on the clock network, effectively reduce the area and power consumption of the clock network and better control the clock deviation, thereby achieving the purpose of reducing the area and power consumption of the clock network. The method automatically determines the K-means clustering algorithm. K Value and K The positions of the initial cluster centers are determined, which reduces the randomness of the initial value selection of the K-means clustering algorithm, improves the processing accuracy of the K-means clustering algorithm, and maximizes the number of merged triggers.

[0099] In addition, this embodiment also provides a trigger merging system based on K-means clustering, including a microprocessor and a memory connected to each other, and the microprocessor is programmed or configured to execute the trigger merging method based on K-means clustering.

[0100] In addition, this embodiment also provides a computer-readable storage medium, in which a computer program or instruction is stored. The computer program or instruction is programmed or configured to execute the trigger merging method based on K-means clustering through a processor.

[0101] In addition, this embodiment also provides a computer program product, including a computer program or instructions, which are programmed or configured to execute the trigger merging method based on K-means clustering through a processor.

[0102] Those skilled in the art should understand that the technical solutions provided by the embodiments of the present application may be in the form of methods, systems, or computer program products. Therefore, the present application may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present application may take the form of a computer program product implemented on one or more computer-readable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes. The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the process Figure 1 A process or multiple processes and / or boxes Figure 1 These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing device to work in a specific way, so that the instructions stored in the computer-readable memory produce a product including an instruction device, which implements the functions specified in the process. Figure 1 A process or multiple processes and / or boxes Figure 1 These computer program instructions can also be loaded onto a computer or other programmable data processing device, so that a series of operation steps are executed on the computer or other programmable device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable device provide for implementing the process in the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0103] The above is only a preferred embodiment of the present invention, and the protection scope of the present invention is not limited to the above embodiments. All technical solutions under the concept of the present invention belong to the protection scope of the present invention. It should be pointed out that for ordinary technicians in this technical field, some improvements and modifications without departing from the principle of the present invention should also be regarded as the protection scope of the present invention.

Claims

1. A trigger merging method based on K-means clustering, characterized in that: The steps include: S1, obtain all flip-flops in the same clock domain in a layout-completed design and put them into a list; S2, select a trigger from the list as the current cluster center, obtain its location coordinates and delete it from the list; S3, select any trigger from the list, obtain its location coordinates and calculate the distance to the current cluster center; S4, if the distance is less than a preset distance threshold T1, the trigger is added to the class corresponding to the current cluster center; if the distance is less than a preset distance threshold T2 which is smaller than the distance threshold T1, the trigger is deleted from the list; S5, determine whether the list is empty, if it is empty, get K The position coordinates of the initial cluster centers, each cluster center corresponds to a cluster, and then jump to step S6; Otherwise, jump to step S2; S6, assign each trigger to a cluster, calculate the cost of the trigger, and update the position coordinates of the cluster center of the cluster; S7, determine whether the cost value of each trigger has changed, if it has changed, jump to step S6; otherwise, get the trigger clustering K Clusters are found, jump to step S8; S8, merge the triggers in each cluster.

2. The trigger merging method based on K-means clustering according to claim 1, characterized in that: The distance in step S3 is the Manhattan distance, and the calculation function expression of the Manhattan distance is: , In the above formula, is the Manhattan distance, is the position coordinate of the trigger, is the position coordinate of the current cluster center; the function expression for calculating the cost value of the trigger in step S6 is: , In the above formula, For the value of To obtain the minimum value, is the position coordinate of the trigger, For the k The location coordinates of the cluster centers of the clusters, K is the number of clusters.

3. The trigger merging method based on K-means clustering according to claim 1, characterized in that: The function expression for updating the position coordinates of the cluster center of the cluster in step S6 is: , , In the above formula, For the k The location coordinates of the cluster centers of the clusters, To be assigned to k The first i The position coordinates of the triggers, To be assigned to k The number of triggers in the clusters, k ∈[1, K ], K is the number of clusters.

4. The trigger merging method based on K-means clustering according to claim 1, characterized in that: Step S8 includes: S8.1, traverse and select a cluster; S8.2, performing trigger merging for the cluster, merging multiple triggers of the same type into a multi-bit trigger; S8.3, determine whether the clustering has been traversed. If so, jump to step S8.4; otherwise, jump to step S8.1; S8.4, execute the unit legalization operation to fine-tune the position coordinates of the replaced multi-bit flip-flop so that there is no design rule violation between it and other units, and then end and exit.

5. The trigger merging method based on K-means clustering according to claim 4, characterized in that: Step S8.2 includes: S8.2.1, traverse and select a trigger in the current cluster, and obtain its location coordinates and type; S8.2.2, if the number of triggers of the same type as the selected trigger in the cluster is greater than or equal to 4, then obtain the three triggers of the same type that are closest to the selected trigger in Manhattan distance; replace the selected trigger and the above three triggers of the same type with a 4-bit trigger of the same type and place it at the center of the four triggers, remove the four triggers from the cluster, and jump to step S8.2.4; otherwise, jump to step S8.2.3; S8.2.3, if the number of triggers of the same type as the selected trigger in the cluster is equal to 2 or 3, obtain a trigger of the same type that is closest to the selected trigger in Manhattan distance; replace the selected trigger and the above trigger with a 2-bit trigger of the same type and place it at the center of the two triggers, and remove the two triggers from the cluster, and jump to step S8.2.4; otherwise, it means that the number of triggers of the same type as the selected trigger in the cluster is equal to 0 or 1, directly, jump to step S8.2.4; S8.2.4, determine whether the current cluster has been traversed. If not, jump to step S8.2.1; otherwise, enter the processing of the next cluster or exit.

6. The trigger merging method based on K-means clustering according to claim 5, characterized in that: The calculation function expression of the center position of the four triggers is: , , In the above formula, is the position coordinate of the center position, For the first of these four triggers i The position coordinates of the two triggers; the calculation function expression of the center position of the two triggers is: , , In the above formula, is the position coordinate of the center position, and They are the position coordinates of the two triggers respectively.

7. The trigger merging method based on K-means clustering according to claim 1, characterized in that: Step S8 also includes inserting a clock buffer at the center of each cluster to connect the clock terminals of all triggers in the cluster to reduce clock power consumption.

8. A trigger merging system based on K-means clustering, comprising a microprocessor and a memory connected to each other, characterized in that: The microprocessor is programmed or configured to execute the trigger merging method based on K-means clustering as described in any one of claims 1 to 7.

9. A computer-readable storage medium having a computer program or instruction stored therein, characterized in that: The computer program or instruction is programmed or configured to execute the trigger merging method based on K-means clustering described in any one of claims 1 to 7 through a processor.

10. A computer program product comprising a computer program or instructions, characterized in that The computer program or instruction is programmed or configured to execute the trigger merging method based on K-means clustering described in any one of claims 1 to 7 through a processor.