Object comparison method, device, storage medium, computer device and program product

By using custom comparison codes and functions in integrated circuit design and comparing based on object features, the problem of obfuscation of objects of the same name in TCL tools is solved, and design efficiency and accuracy are improved.

CN118627438BActive Publication Date: 2024-11-01INNODA (CHENGDU) ELECTRONIC TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

In integrated circuit design, since the TCL tool's support for data types is limited to string types, objects with the same name are confused when assigned to variables, resulting in errors in execution of related TCL scripts and fail to get the desired result. In order to distinguish different objects, it is necessary to Using complex object names increases design complexity and data volume and reduces design efficiency.

Method used

By adding custom comparison code to the command interpreter of the target tool, performing custom comparison functions to obtain object features, and comparing based on object features, avoiding direct comparison of object names, thereby reducing the complexity and data volume of object names.

Benefits of technology

It effectively reduces the complexity of object names in integrated circuit design, improves design efficiency, and ensures the accuracy and efficiency of object comparison.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118627438B_ABST
    Figure CN118627438B_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of integrated circuits, and provides an object comparison method, device, storage medium, computer equipment and program product. The object comparison method is applied to the command interpreter of a target tool, and the target tool includes integrated circuit electronic design automation software. The object comparison method includes: in response to a code editing operation, adding a custom comparison code, wherein the custom comparison code indicates that an object comparison based on object features is implemented by executing a custom comparison function, wherein the object features are used to distinguish different objects; receiving an object comparison command, wherein the object comparison command includes an object to be compared; in response to the object comparison command, executing the custom comparison code to obtain the object features of the object to be compared by executing the custom comparison function, and comparing the object to be compared according to the object features to obtain a comparison result. The method can bypass the name to compare different objects themselves, which can improve the design efficiency of integrated circuits.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application generally relates to the field of integrated circuit technology, and more specifically, to an object comparison method, apparatus, storage medium, computer device and program product. Background Art

[0002] When using EDA (Electronic Design Automation) tools, relevant personnel interact with EDA tools by writing and executing TCL (Tool Command Language) scripts. After the EDA tool reads the design, it often involves using some TCL commands to obtain objects in the design, such as using the get_port command to obtain the port, or using the get_net command to obtain the net, and then triggering certain judgment conditions based on the obtained objects to obtain the corresponding results.

[0003] As integrated circuit design becomes more and more complex, different objects often have the same name in the design. However, TCL's support for data types is limited to string types, that is, all command parameters are treated as strings. Although these objects with the same name have different attributes, because the names of these objects are the same string, when these objects are assigned to variables, the values ​​of the variables are only the names of these objects. Therefore, TCL will confuse the variables pointing to these objects with the same name, which will eventually lead to execution errors of related TCL scripts and fail to obtain the expected results.

[0004] At present, in order to obtain the desired results, different names can only be used for different objects when naming the objects, which increases the complexity of the object names and the amount of data, thereby reducing the design efficiency of the integrated circuit. Summary of the invention

[0005] The present application provides an object comparison method and an object comparison device, which are used to at least solve the problem of how to reduce the complexity of object names in integrated circuit design.

[0006] According to one aspect of the present application, an object comparison method is provided, which is applied to a command interpreter of a target tool, wherein the target tool includes integrated circuit electronic design automation software, and the object comparison method includes: in response to a code editing operation, adding a custom comparison code, wherein the custom comparison code indicates that an object comparison based on object features is achieved by executing a custom comparison function, and the object features are used to distinguish different objects; receiving an object comparison command, wherein the object comparison command includes an object to be compared; in response to the object comparison command, executing the custom comparison code to obtain the object features of the object to be compared by executing the custom comparison function, and comparing the object to be compared according to the object features to obtain a comparison result.

[0007] According to another aspect of the present application, an object comparison device is provided, which is applied to a command interpreter of a target tool, wherein the target tool includes integrated circuit electronic design automation software, and the object comparison device includes: an adding unit, configured to add a custom comparison code in response to a code editing operation, wherein the custom comparison code indicates that an object comparison based on object features is achieved by executing a custom comparison function, and the object features are used to distinguish different objects; a receiving unit, configured to receive an object comparison command, wherein the object comparison command includes an object to be compared; and a comparing unit, configured to execute the custom comparison code in response to the object comparison command, so as to obtain the object features of the object to be compared by executing the custom comparison function, and compare the object to be compared according to the object features to obtain a comparison result.

[0008] According to another aspect of the present application, a computer-readable storage medium is provided. When instructions in the computer-readable storage medium are executed by at least one processor, the at least one processor is prompted to perform the object comparison method as described above.

[0009] According to another aspect of the present application, a computer device is provided, comprising: at least one processor; and at least one memory storing computer executable instructions, wherein when the computer executable instructions are executed by the at least one processor, the at least one processor is prompted to execute the object comparison method as described above.

[0010] According to another aspect of the present application, a computer program product is provided, comprising computer instructions. When the computer instructions are executed by at least one processor, the at least one processor is prompted to perform the object comparison method as described above.

[0011] According to the object comparison method, apparatus, storage medium, computer device and program product of the exemplary embodiments of the present application, by adding a custom comparison code that can realize object comparison based on object features, when an object comparison command is received, the object features of the object to be compared can be first obtained with the help of the custom comparison code, and then the comparison is performed based on the obtained object features, thereby avoiding the command interpreter that only supports character-type data directly comparing the names of the objects to be compared when performing object comparison, thereby being able to bypass the names and compare different objects themselves, and thus eliminating the need to use complex object names to distinguish different objects in integrated circuit design, which can effectively reduce the complexity of object names in integrated circuit design, reduce the amount of data, and help improve the design efficiency of integrated circuits.

[0012] Other aspects and / or advantages of the general inventive concept of the present application will be set forth in part in the following description, and some will be clear from the description or may be learned through practice of the general inventive concept of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] These and / or other aspects and advantages of the present application will become clear and easier to understand from the following description of the embodiments in conjunction with the accompanying drawings.

[0014] Figure 1 is a flowchart illustrating an object comparison method according to an exemplary embodiment of the present application.

[0015] Figure 2 FIG. 1 is a schematic diagram showing a flow chart of executing script commands on the TCL side and the EDA side according to an exemplary embodiment of the present application.

[0016] Figure 3 is a block diagram illustrating an object comparison apparatus according to an exemplary embodiment of the present application.

[0017] Figure 4 is a block diagram illustrating a computer device according to an exemplary embodiment of the present application. DETAILED DESCRIPTION

[0018] The following description with reference to the accompanying drawings is provided to assist in a comprehensive understanding of the embodiments of the present invention as defined by the claims and their equivalents. Various specific details are included to assist in understanding, but these details are considered to be exemplary only. Therefore, one of ordinary skill in the art will recognize that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present invention. In addition, descriptions of well-known functions and structures are omitted for clarity and brevity.

[0019] It should be noted that the phrase "at least one of the items" in this application includes three types of parallel situations: "any one of the items", "a combination of any number of the items", and "all of the items". For example, "including at least one of A and B" includes the following three parallel situations: (1) including A; (2) including B; (3) including A and B. Another example is "executing at least one of step 1 and step 2" which means the following three parallel situations: (1) executing step 1; (2) executing step 2; (3) executing step 1 and step 2.

[0020] TCL is an interpreted scripting language. It is a very important and practical tool in integrated circuit design and is widely compatible with EDA tools. Relevant personnel interact with EDA tools by writing and executing TCL scripts.

[0021] A TCL script can contain one or more commands, which must be separated by line breaks or semicolons. A TCL effective command line is formed by "command + string (combined with space separators)", and each command contains one or more words. The first word represents the command name, and the other words are the parameters of the command. Words must be separated by spaces or TAB keys.

[0022] TCL script execution depends on the interpreter (line-by-line execution). When analyzing commands, the TCL interpreter treats all command parameters as strings. The reason is that TCL does not support data types such as int, double, char, etc. in other languages. The only supported type is string. For example, the name and value of a simple variable are both strings.

[0023] Take the commands set x 10 and set y x+100 as examples. The former defines the variable x and assigns the value of x to 10, while the latter defines the variable y, and the value of y is x+100, instead of the expected 110. In the command set y x+100, x is regarded as part of the string x+100. If you want to use the value of x '10', you must use the substitution function provided in the TCL language to tell the TCL interpreter that the value of the variable x is expected here, not the character 'x'.

[0024] Tcl provides three forms of substitution: variable substitution, command substitution, and backslash substitution.

[0025] Variable substitution is done by a The symbol marker is used to insert the value of a variable into a word.

[0026] For example, set y x+100, the value of y is 10+100, here x is replaced by its value 10.

[0027] Command substitution is marked by square brackets [ ], which contain TCL commands and their parameters. It is used to replace all or part of the words in a command with the results of the command in the brackets.

[0028] For example, set y [expr x+100], the value of y is 110, that is, the command expr The result of x+100.

[0029] Backslash replacement is marked by a \ symbol and is used to replace newline, space, [, The characters treated as special symbols by the TCL interpreter are replaced with their original appearance.

[0030] For example, set y \ The values ​​of x,y are x, here \ will Replace with ordinary characters.

[0031] In addition to backslashes, TCL also supports the use of double quotes " " and curly braces {} to make the interpreter treat special characters such as delimiters and substitution characters as ordinary characters without making any special processing. Among them, although the TCL interpreter will not make any special processing for the delimiters in double quotes and curly braces, it will make special processing for newline characters and and [ ] are processed as usual.

[0032] When using EDA tools, relevant personnel interact with EDA tools by writing and executing TCL scripts. After the EDA tool reads the design, it often involves using some TCL commands to obtain objects in the design, such as using the get_port command to obtain a port, or using the get_net command to obtain a net, and then triggering certain judgment conditions based on the obtained objects to obtain the corresponding results.

[0033] As integrated circuit design becomes more and more complex, different objects often have the same name in the design. However, TCL's support for data types is limited to string types, that is, all command parameters are treated as strings. Although these objects with the same name have different attributes, because the names of these objects are the same string, when these objects are assigned to variables, the values ​​of the variables are only the names of these objects. Therefore, TCL will confuse the variables pointing to these objects with the same name, which will eventually lead to execution errors of related TCL scripts and fail to obtain the expected results.

[0034] For example, suppose a TCL script contains the following command:

[0035] “set P1 [get_port n1] #Get port n1 and assign it to variable P1

[0036] set P2 [get_net n1] #Get net n1 and assign it to variable P2

[0037] if { P1 == P2} { #Compare the values ​​of P1 and P2 to see if they are equal

[0038] puts "XXX" #If the values ​​of P1 and P2 are equal, print XXX

[0039] }".

[0040] Based on the existing characteristics of the TCL language, the values ​​of variables P1 and P2 in the above example are both string n1, which results in XXX being printed after the script is executed. However, since port n1 and net n1 are essentially two different objects, the expected result of executing the script is that XXX is not printed.

[0041] At present, in order to solve the above problems and obtain the expected comparison results, the relevant technology can often only use different names for different objects when naming objects. For example, the port n1 in the above example is named portn1, and the line net n1 is named netn1, which increases the complexity of the object name and the amount of data, thereby reducing the design efficiency of the integrated circuit.

[0042] The present application adds a custom comparison code that can implement object comparison based on object features. When an object comparison command is received, the custom comparison code can be used to first obtain the object features of the object to be compared, and then compare them accordingly. This avoids the command interpreter that only supports character-type data from directly comparing the names of the objects to be compared when performing object comparison, thereby bypassing the names to compare different objects themselves. There is no need to use complex object names to distinguish different objects in integrated circuit design, which can effectively reduce the complexity of object names in integrated circuit design, reduce the amount of data, and help improve the design efficiency of integrated circuits.

[0043] Refer to the following Figures 1 to 4 The object comparison method, apparatus, storage medium, computer device, and program product according to exemplary embodiments of the present application are described in detail.

[0044] Figure 1: is a flow chart showing an object comparison method according to an exemplary embodiment of the present application. The object comparison method according to the exemplary embodiment of the present application can be implemented in a computer device with sufficient computing power, and is specifically applied to a command interpreter of a target tool. The target tool includes integrated circuit electronic design automation software, and the command interpreter is specifically a command interpreter that only supports character-type data, such as the above-mentioned TCL interpreter, or other command interpreters. As long as the command interpreter only supports character-type data, resulting in the inability to distinguish variables pointing to objects with the same name, the object comparison method of the exemplary embodiment of the present application can be used.

[0045] Reference Figure 1 , in step S101, in response to a code editing operation, a custom comparison code is added.

[0046] The custom comparison code indicates that the object comparison based on the object characteristics is realized by executing the custom comparison function. The object characteristics are used to distinguish different objects. By adding the custom comparison code, the command interpreter can be provided with the object comparison capability based on the object characteristics. The custom comparison code will be further introduced below, which will not be expanded here.

[0047] All information that can be used to distinguish different objects can be used as object features. For example, in integrated circuit design, it can include the type of object (such as wire nets, ports), and the module instance to which the object is connected, so that these features can be combined with the object name to distinguish different objects. In addition, this information will be stored centrally, and each object has a unique storage address. Therefore, the storage address is unique to each object. Optionally, the object feature includes the storage address of the corresponding object, which can not only reliably distinguish different objects, but also use a unified information acquisition method for different objects to obtain their storage addresses, which helps to improve the efficiency of obtaining object features.

[0048] In step S102, an object comparison command is received, wherein the object comparison command includes an object to be compared.

[0049] The object comparison command is a command that involves comparing objects. It can be a command that is the same as the existing object comparison method, as long as it can indicate that the purpose of the command is to compare objects and specify the objects to be compared. It should be understood that the number of objects to be compared is at least two to achieve the comparison. Still taking the TCL interpreter as an example, the object comparison command can include the if command in the aforementioned TCL script example, and can also include the string compare command, which is used to compare two strings and return the result according to the dictionary order: if the first string precedes the second string in the dictionary, return -1; if the first string is after the second string in the dictionary, return 1; if the two are the same, return 0.

[0050] It should be noted that the object to be compared in the object comparison command can appear in the form of a variable, and it is not necessary to directly input the object to be compared itself. Referring to the aforementioned TCL script example, the object pointed to by variable P1 is port n1, and the object pointed to by variable P2 is line net n1. The if command directly compares variable P1 and variable P2, which actually compares the two objects of port n1 and line net n1. Therefore, the objects to be compared here are port n1 and line net n1.

[0051] In step S103, in response to the object comparison command, the custom comparison code is executed to obtain the object characteristics of the object to be compared by executing the custom comparison function, and the object to be compared is compared according to the object characteristics to obtain a comparison result.

[0052] When an object comparison command is received, by executing a custom comparison code, it is possible to first obtain the object characteristics of the object to be compared and then perform a comparison based on this. This avoids the situation where a command interpreter that only supports character-type data directly compares the names of the objects to be compared when performing an object comparison. This allows the names to be bypassed to compare different objects themselves, and there is no need to use complex object names to distinguish different objects in integrated circuit design. This can effectively reduce the complexity of object names in integrated circuit design, reduce the amount of data, and help improve the design efficiency of integrated circuits.

[0053] As mentioned above, the object to be compared in the object comparison command may appear in the form of a variable. Optionally, the object comparison command includes a pointer to be compared, and the pointer to be compared is used to point to the data to be compared, that is, the object to be compared specifically appears in the form of a pointer variable, and the variables P1 and P2 in the above examples are both pointer variables. It should be understood that a pointer often has a data type, and a pointer of a certain type can only point to data of that type, and the object comparison command, such as the if command and the string compare command, is a comparison command to be precise, which can not only compare data of the object type, but also compare data of other types, but often only the data of the object type has the problem that different data have the same name. At this time, the operation of obtaining the object characteristics of the object to be compared includes: when it is determined that the data type of the pointer to be compared is a specified data type, obtaining the object characteristics of the object to be compared pointed to by the pointer to be compared. By first verifying the number type of the pointer to be compared in the object comparison command, and obtaining its object characteristics only when it is determined to be a specified data type, it is possible to use a comparison method based on object characteristics only for data with demand, and for data of other data types, the existing string-based comparison method can be used, which can fully simplify the comparison calculation. It should be understood that the specified data type includes, for example, object types, such as the list type in TCL, and may also include other data types in which different data have the same name, and the present application does not limit this. As an example, when judging whether the data type of the pointer to be compared is the specified data type, the judgment conditions may simultaneously include whether the pointer variable is empty, whether the data type of the pointer variable is empty (i.e., whether the data type is defined for the pointer variable), whether the name of the data type is empty, and whether the name of the data type is the specified data type, so that when it is determined that the data type of the pointer to be compared is not the specified data type, the reason can be specifically analyzed. In addition, still taking the list type as an example, since EDA tools often make adaptive modifications to the general list type data according to the needs of integrated circuit design, when the specified data type is the list type, the directly obtained storage address needs to be converted in order to parse the data, and then the obtained storage address is used as the object feature.

[0054] Next, we will further introduce the custom comparison code.

[0055] The command interpreter has pre-stored original comparison codes. As the name implies, the original comparison codes are the codes originally used by the command interpreter to perform object comparison. The codes implement comparison based on the characters of the variables, so the comparison results may be different from those of the custom comparison codes.

[0056] In some embodiments, optionally, in step S101, when the custom comparison code is added, the original comparison code is deleted, which is equivalent to replacing the original comparison code with the custom comparison code, or equivalent to rewriting the original comparison code into the custom comparison code.

[0057] In other embodiments, in order to achieve compatibility between the custom comparison code and the original comparison code, optionally, the comparison results of the custom comparison code and the original comparison code are selected and adopted, and the adoption priority of the comparison result of the custom comparison code is higher than the adoption priority of the comparison result of the original comparison code. By retaining the original comparison code and adding the custom comparison code additionally, rather than directly rewriting the original comparison code into the custom comparison code, the destruction of the original comparison code can be avoided. On this basis, by selecting and adopting the comparison results of the custom comparison code and the original comparison code, the contradiction caused by the different results of the two comparisons can be avoided, and the reliable implementation of object comparison is guaranteed. In addition, by making the comparison result of the custom comparison code have a higher adoption priority, the custom comparison code can be used preferentially, that is, the object comparison is preferentially realized based on the object feature. On the one hand, the name can be bypassed as much as possible to compare different objects themselves. On the other hand, the original comparison code can be used as a bottom line when the object comparison fails using the object feature, and the smooth progress of the object comparison is guaranteed.

[0058] It should be noted that here, from the perspective of the code execution result, it is limited to only one code comparison result in the end, but there is no limitation on the code implementation process, which means that you can choose to execute one of the original comparison code and the custom comparison code, or you can execute both the original comparison code and the custom comparison code, but only adopt one of the comparison results.

[0059] Optionally, the execution priority of the custom comparison code is higher than the execution priority of the original comparison code, and the execution condition of the original comparison code is that a clear comparison result cannot be obtained by executing the custom comparison code. By specifically limiting the custom comparison code to have a higher execution priority, the custom comparison code can be preferentially executed in the actual execution of the code to achieve object comparison based on object characteristics. In addition, the original comparison code is executed only when the custom comparison code that is preferentially executed fails to obtain a clear comparison result. On the one hand, the original comparison code can be used as a bottom line to ensure the smooth progress of the object comparison. On the other hand, when the custom comparison code obtains a clear comparison result, the original comparison code will no longer be executed, which can fully reduce the amount of code executed and reduce the computational load.

[0060] As an example, the additional custom comparison code can be placed in front of the original comparison code, so that the custom comparison code is executed first, and the return value and break command are used at the same time. If a clear comparison result (such as equality or inequality) is obtained when executing the custom comparison code, the comparison result is used as the return value of the object comparison, and the subsequent original comparison code is no longer executed; if a clear comparison result is not obtained when executing the custom comparison code (such as failure to obtain at least one object feature of the object to be compared), the break command is executed to jump out of the custom comparison code, execute the original comparison code, and use the comparison result of the original comparison code as the return value of the object comparison.

[0061] Regarding the editing and execution of the custom comparison code, optionally, the custom comparison function is pre-written into the target tool, and step S101 includes: in response to the code editing operation, adding a custom comparison code containing a custom function pointer, wherein the custom function pointer is used to point to the custom comparison function. Since the custom comparison code needs to be executed by the command interpreter, it is necessary to perform a code editing operation on the command interpreter side to write the custom comparison code so that the command interpreter has the function of realizing object comparison based on object features. On this basis, by writing the custom comparison function that plays a core role in the custom comparison code into the target tool, the control right of the custom comparison function can be attributed to the target tool, which is convenient for managing and maintaining the custom comparison function on the target tool side. At the same time, using the custom function pointer pointing to the custom comparison function on the command interpreter side can realize the call of the custom comparison function and meet the realization of the corresponding function. It should be understood that the custom function pointer needs to be defined and declared in the header file of the command interpreter to ensure its normal use.

[0062] Further optionally, when executing the custom comparison code, the object characteristics of the object to be compared are obtained by executing the custom comparison function, and the object to be compared is compared according to the object characteristics, and the operation of obtaining the comparison result includes: when the custom function pointer is not null, the object characteristics of the object to be compared are obtained by executing the custom comparison function, and the object to be compared is compared according to the object characteristics to obtain the comparison result. By configuring the precondition that the custom function pointer is not null, the corresponding function can be executed only when the custom function pointer points to a clear point, reducing the risk of failing to smoothly implement object comparison due to unclear custom function pointer pointing, and reducing unnecessary code execution.

[0063] Further optionally, the object comparison method according to the exemplary embodiment of the present application also includes: in response to a start command of a custom comparison function (i.e., an object comparison function based on object features), assigning a custom function pointer to a custom comparison function, wherein the initial value of the custom function pointer is null. On the one hand, by configuring the initial value of the custom function pointer to be null, the risk of causing object comparison errors when pointing to other functions can be reduced; on the other hand, assigning a value to the custom function pointer when starting the custom comparison function can keep the custom function pointer as a null pointer when the custom comparison function is not started. Combined with the above, the custom comparison function will not be executed at this time, that is, no clear comparison result can be obtained, and the original comparison function will be executed, realizing the free selection of the comparison function.

[0064] As an example, for EDA tools, the startup command of the custom comparison function can be configured using the custom command of EDA, such as configuring the compare_obj command and configuring the obj option for the command. At this time, the command compare_obj –objtrue means that the value of the obj option in the custom compare_obj command is true, and the command can be used as the startup command of the custom comparison function. Similarly, the command compare_obj –obj false means that the value of the obj option in the custom compare_obj command is false, and the command can be used as the shutdown command of the custom comparison function. At this time, the custom compare_obj command needs to be registered in the command interpreter, and in the case where the custom comparison function is pre-written into the target tool, the response logic of the command can be written into the target tool, and the target tool assigns the custom comparison function to the custom function pointer. In other words, the assignment operation can be specifically performed by the target tool. In actual execution, in addition to directly using the compare_obj command, you can also enter a system command (such as a Linux command) for calling and executing the target script, and the target script contains the compare_obj command. These are all implementation methods of the present application and fall within the scope of protection of the present application.

[0065] Optionally, when executing the custom comparison code, the object characteristics of the object to be compared are obtained by executing the custom comparison function, and the object to be compared is compared according to the object characteristics, and the operation of obtaining the comparison result may also include: obtaining the object characteristics of the object to be compared by executing the custom comparison function when the custom comparison function is started, and comparing the object to be compared according to the object characteristics to obtain the comparison result. By configuring the prerequisite for starting the custom comparison function (i.e., the object comparison function based on the object characteristics), the core comparison operation in the custom comparison function (i.e., the operation of obtaining the object characteristics and performing object comparison based on them) can be executed only when the function is started, reducing the risk of the custom comparison function being called and executed by mistake, and ensuring the reliable performance of the object comparison. It should be understood that if the custom comparison function is not started, even if the custom comparison function is called and executed, the core comparison operation will not be executed, so the custom comparison code will not be able to obtain a clear comparison result, and the original comparison code will continue to be executed, ensuring that the object comparison process is carried out reliably according to the specified function. Based on this, after assigning a value to the custom function pointer in response to the start command of the custom comparison function, if the custom comparison function is turned off, the value of the custom function pointer can be restored to empty or remain the same, both of which can ensure the reliable implementation of the object comparison process, so this application does not impose any restrictions on this.

[0066] Further optionally, the object comparison method according to the exemplary embodiment of the present application further includes: creating a custom switch flag; in response to the start command of the custom comparison function, setting the custom switch flag to on; accordingly, the above-mentioned operation of obtaining the object characteristics of the object to be compared and comparing the object to be compared according to the object characteristics by executing the custom comparison function in the case of starting the custom comparison function, and obtaining the comparison result includes: obtaining the object characteristics of the object to be compared and comparing the object to be compared according to the object characteristics by executing the custom comparison function in the case of determining that the custom switch flag is on, and obtaining the comparison result. By configuring the custom switch flag, it is possible to conveniently indicate the start and stop state of the custom comparison function, without repeatedly confirming the specific content of the start and stop command of the custom comparison function, which helps to simplify the operation and reduce the amount of calculation in the code execution process. As an example, in response to the start command of the aforementioned custom comparison function, the target tool can set the custom switch flag to the on state (for example, true), and assign the custom function pointer to the custom comparison function. The target tool can also set the custom switch flag to the off state (for example, false) in response to the shutdown command of the custom comparison function. Accordingly, the custom comparison function can be configured to perform the core comparison operation only when the custom switch flag is set to on.

[0067] Regarding the execution of the custom comparison function, optionally, the objects to be compared include a first comparison object and a second comparison object, wherein the custom comparison function is used to perform the following steps: determine a custom switch flag; when the custom switch flag is set to on, obtain a first object feature of the first comparison object and a second object feature of the second comparison object; perform a first comparison between the first object feature and the second object feature; if the first object feature is equal to the second object feature, return a first target value to the target variable in the custom comparison code; if the first object feature is not equal to the second object feature, return the second target value to the target variable; and, when the custom switch flag is set to off, return a third target value to the target variable. By first determining whether the custom switch flag is set to on when executing the custom comparison function, it is possible to ensure that the core comparison operation of the custom comparison function is only executed when the custom comparison function is turned on. By returning different target values ​​to the target variable in the custom comparison code for different situations, the comparison result of the object comparison can be clarified according to the value of the target variable when executing the custom comparison code. As an example, referring to the aforementioned string compare command, the first target value may be 0, the second target value may include -1 and 1, to respectively indicate that the first object feature is less than the second object feature and the first object feature is greater than the second object feature, and the third target value may be, for example, -2, and of course, may also be other values ​​other than 0, -1, and 1, and this application does not limit this. As an example, when the object feature of at least one object to be compared cannot be obtained, the third target value may also be returned to the target variable.

[0068] Accordingly, the custom comparison code can be used to perform the following steps: determine a preset custom function pointer, wherein the custom function pointer is used to point to or not point to the custom comparison function; when the custom function pointer points to the custom comparison function, obtain the value of the target variable through the custom comparison function; if the target variable is assigned a first target value or a second target value, use the first target value or the second target value as the comparison result, wherein the first target value indicates that the first comparison object is equal to the second comparison object, and the second target value indicates that the first comparison object is not equal to the second comparison object; if the target variable is assigned a third target value, or when the custom function pointer does not point to the custom function, terminate the execution of the first comparison to directly perform the second comparison on the first comparison object and the second comparison object. By first determining whether the custom function pointer points to the custom comparison function before executing the custom comparison function, the corresponding function can be executed only when the custom function pointer points to the custom comparison function, thereby reducing the risk of affecting the smooth implementation of object comparison due to incorrect pointing of the custom function pointer, thereby ensuring reliability and reducing unnecessary code execution. After determining to execute the custom comparison function, combined with the value of the target variable returned by the custom comparison function, the result of the object comparison can be clarified, or the execution of the custom comparison code can be promptly jumped out, that is, the first comparison corresponding to the custom comparison function is terminated, and the original comparison code is executed instead, and the original string-based second comparison is executed as a bottom line to ensure the smooth progress of the object comparison.

[0069] Next, taking the target tool as an EDA tool and the command interpreter as a TCL interpreter as an example, an object comparison method of an exemplary embodiment of the present application is introduced. This method adds a custom comparison function to the EDA tool by modifying the underlying TCL source code, which is used to compare two variables pointing to different objects in TCL, not limited to comparing the strings of the object names, but to achieve comparison between the objects themselves pointed to by the pointers of the variables.

[0070] This embodiment involves an interaction end, an implementation end, and a function end, which correspond to a user side, a TCL side, and an EDA side, respectively, and these three ends are executed on a terminal whose operating system is a Linux system. The implementation of this embodiment on the three ends is as follows.

[0071] 1. Interactive end: Enter the target command in the terminal of the Linux system.

[0072] Various tasks of EDA software are usually performed directly on the terminal tool of the Linux system. Relevant personnel enable or disable the custom comparison function by entering the target command in the terminal.

[0073] Specifically, the target command can be a Linux command for calling and executing a target TCL script (the script contains a compare_obj command as a start and stop command of the custom comparison function), or can be a compare_obj command directly, so that the terminal tool can enable tclsh (Simple shell containing TCL interpreter) to read and evaluate the compare_obj command to enable or disable the custom comparison function.

[0074] For example, a Linux command is: . / test.tcl, which means executing the test.tcl script. In the Linux command line, the directory ends with a forward slash " / ", and "." indicates the current directory. The combination of the two symbols ". / " itself is not a command, but it allows the shell to run executable files directly from the terminal without double-clicking the file in the graphical file manager. In the above example, "test.tcl" is the file name of the target TCL script, and ". / test.tcl" is equivalent to indicating the file path of the target TCL script.

[0075] The compare_obj command is, for example, compare_obj -obj true, which is the start command of the custom comparison function; another example is compare_obj -obj false, which is the close command of the custom comparison function. Wherein, compare_obj is the command name, obj is the option in the command, true or false is the option value, and the custom comparison function is enabled when the option value is true, and the custom comparison function is disabled when the option value is false. It should be understood that the command name compare_obj and the option obj are only exemplary descriptions, and the present application is not limited thereto. The specific form of the command can be determined according to actual conditions. For example, the command can also be compare_tcl_obj -by_object, where the command name is compare_tcl_obj and the option is by_object.

[0076] 2. Implementation: After enabling the custom comparison function through compare_obj -obj true, when executing the if command or string compare command in the target TCL script to compare two variables, the comparison is performed based on the object characteristics of the objects pointed to by the variables.

[0077] Specifically, if command and string compare command are TCL commands, and both can involve comparison between objects. Object characteristics can be, for example, the storage address of the object. The principle is that different types of objects are generally stored in different storage areas, while the same type of objects are generally stored in the same storage area.

[0078] Still taking the target TCL script containing the following command as an example:

[0079] "set P1 [get_port n1]

[0080] set P2 [get_net n1]

[0081] if { P1 == P2} {

[0082] puts "XXX"

[0083] }".

[0084] After turning on the target function, use the expression " P1 == When comparing variables P1 and P2, the original assignment of the names of port n1 and net n1 (both are string n1) to P1 and P2 for comparison is adjusted to assigning the object characteristics of port n1 and net n1 to P1 and P2 for comparison. For example, the address of port n1 is 0X0060 and the address of net n1 is 0X0070. The two are assigned to P1 and P2 for comparison. At this time, the values ​​of variables P1 and P2 are not equal, so the expression " P1 == P2" evaluates to 0, XXX will not be printed, and the expected result is obtained.

[0085] 3. Function side: In response to the compare_obj -obj true command, the EDA tool registers the pre-written custom comparison function into TCL, and makes the custom function pointer in TCL point to the newly registered custom comparison function, so that when TCL executes the if command or the string compare command, it compares the two variables according to the logic in the custom comparison function.

[0086] Specifically, EDA tools embed TCL into EDA tools by linking tcl.so, so that relevant personnel can interact with EDA tools through TCL scripts. tcl.so is a dynamic link library (DLL), which allows the process of EDA tools to call functions that are not part of its executable code, while the executable code of the function is located in the tcl.so file.

[0087] Script commands are usually divided into two types: one is TCL's own commands (such as if or string compare), and the other is custom commands registered to TCL by EDA tools (such as compare_obj). The execution process of the two commands is not exactly the same. Figure 2 The flow of executing script commands on the TCL side and the EDA side is shown.

[0088] Reference Figure 2 Generally speaking, the execution of script commands is divided into the EDA side and the TCL side. After the EDA tool starts running, when the TCL side obtains the script command provided by the user, it will first parse the command and determine whether the command is a custom command registered in TCL by the EDA tool. If so, the EDA tool obtains the parsing result of the command from the TCL side, and based on the parsing result, executes the command with the execution logic defined in the EDA tool, and returns the execution result to TCL, so that the TCL side displays the execution result to the user. If not, TCL obtains the parsing result of the command, and based on the parsing result, executes the command with TCL's own execution logic, and displays the execution result to the user.

[0089] When executing script commands line by line, after each command is executed, it will be confirmed whether the command is the last command. If so, the process ends. If not, the TCL side continues to parse the next script command. It should be noted that the operation of confirming whether the current command is the last command can be as follows: Figure 2 The following is executed by TCL side, and can also be executed by EDA side. Figure 2 Just an example.

[0090] In particular, for the object comparison method of the exemplary embodiment of the present application, after the comparison function is enabled by compare_obj -obj true, the EDA tool will register the compare function in TCL, and the function pointer in TCL will automatically point to the compare function. Therefore, although the if command and the string compare command are both TCL commands, the if command and the string compare command will be executed with the execution logic of the compare function defined in the EDA tool to solve the problem that TCL treats all parameters as strings and cannot accurately compare objects.

[0091] For the implementation of the function, first, create the start and stop commands of the custom comparison function in the EDA tool, that is, the compare_obj command, and create a custom comparison function that implements the new comparison method, and register the compare_obj command in TCL. Then, when the EDA tool responds to the compare_obj command, it can modify the comparison logic of the TCL object through a specific function process.

[0092] For this function process, in the EDA tool, it specifically includes the response logic of the compare_obj command and the execution logic of the compare function.

[0093] First, create a custom switch flag and set its initial value to off. The response logic of the compare_obj command is that when receiving the command, first determine whether the command has the obj option and the option value is true. If it is satisfied, set the custom switch flag to on and assign the custom function pointer to the custom comparison function. If it is not satisfied, set the custom switch flag to off. After completion, return the function value 1 to let the EDA tool know that the function has been successfully executed to ensure the normal operation of the program.

[0094] The input parameters of compare function are passed in by TCL, for example, the variables P1 and P2 compared by the if command in the previous text, and these two pointer variables each point to an object to be compared. The execution logic of compare function is to first determine whether the custom switch flag is set to on. If it is on, two untyped pointers with an initial value of null are created, and then the custom macros in the EDA tool are used to obtain the storage addresses of the objects to be compared pointed to by the two pointer variables in the object comparison command (such as the if command), obtain the object characteristics of the two objects to be compared, and assign them to the two untyped pointers respectively. Then, when both untyped pointers are not null pointers, the size relationship of the two untyped pointers is determined, and different return values ​​are used to represent the determined size relationship. Specifically, if the two are equal, the return value is 0, if the first untyped pointer is greater than the second untyped pointer, the return value is 1, and if the first untyped pointer is less than the second untyped pointer, the return value is -1. If the custom switch flag is set to off, or at least one untyped pointer is a null pointer, the return value is -2, and the comparison ends.

[0095] On the TCL side, the function process specifically includes two parts. One part is to define and declare the registration function in tcl.h (header file), which is the basis for the interaction between EDA tools and TCL. The other part is to insert the custom comparison code in the complete code TclStringCmp that implements string comparison before the original comparison code that executes the specific comparison function.

[0096] The execution logic of the custom comparison code is to first determine whether the custom function pointer is empty. If it is empty, the subsequent code will not be executed and the original comparison code will be executed directly. If it is not empty, the target variable is created and the function value of the custom function pointer is assigned to the target variable, that is, the return value of the compare function is assigned to the target variable, and the conditional judgment is performed with the target variable as the reference value. If the target variable is -2, the comparison ends, the subsequent code is no longer executed, and the original comparison code is directly executed; otherwise, the value of the target variable is returned to TclStringCmp, and the original comparison code is no longer executed. Since the value judgment logic of the target variable corresponds to the return value judgment logic of the original comparison code in TclStringCmp, that is, TclStringCmp also uses 0 for equality, 1 for greater than, and -1 for less than, the value of the target variable can be directly used as the comparison result. It can be seen that the return values ​​0, 1, and -1 of the compare function will first be returned to the custom comparison code and then returned to TclStringCmp itself, and the return value -2 of the compare function will only be returned to the custom comparison code.

[0097] In a specific embodiment, an object comparison command can be used to perform an object search task, that is, to search for the required object from the object library. When executing a task, first determine a target object, then traverse all objects in the library file, and compare them with the target object in turn. If it is determined that a certain object is equal to the target object, the search for the target object is achieved. According to experiments, for an open source object library containing 8.63 million objects, before enabling the custom comparison function of the exemplary embodiment of the present application, it takes 62 seconds to complete the task. After enabling the custom comparison function of the exemplary embodiment of the present application, the new custom comparison takes only 6 seconds, which is more than 10 times faster.

[0098] The principle is that the original comparison of TCL is essentially a string comparison, and the variables need to be converted to ASCII (American Standard Code for Information Interchange) code during the process. After the custom comparison function is enabled, the underlying physical address (hexadecimal number) of the object can be directly used for comparison in the new custom comparison process without ASCII code conversion, thereby improving the comparison efficiency. It can be seen that the object comparison method of the exemplary embodiment of the present application can not only realize the comparison between the objects themselves, so as to obtain the expected comparison results, but also accelerate the comparison process and improve the execution efficiency of the program.

[0099] Figure 3 1 is a block diagram showing an object comparison device according to an exemplary embodiment of the present application. The object comparison device is applied to a command interpreter of a target tool, and the target tool includes integrated circuit electronic design automation software.

[0100] Reference Figure 3 The object comparison device 300 includes an adding unit 301, a receiving unit 302, and a comparing unit 303.

[0101] The adding unit 301 may add a custom comparison code in response to a code editing operation, wherein the custom comparison code indicates that object comparison based on object features is implemented by executing a custom comparison function, and the object features are used to distinguish different objects.

[0102] The receiving unit 302 may receive an object comparison command, wherein the object comparison command includes an object to be compared.

[0103] The comparison unit 303 may execute the custom comparison code in response to the object comparison command, so as to obtain the object characteristics of the object to be compared by executing the custom comparison function, and compare the object to be compared according to the object characteristics to obtain the comparison result.

[0104] Optionally, the command interpreter pre-stores the original comparison code, and the comparison results of the custom comparison code and the original comparison code are selectively adopted, and the adoption priority of the comparison result of the custom comparison code is higher than the adoption priority of the comparison result of the original comparison code.

[0105] Optionally, the execution priority of the custom comparison code is higher than the execution priority of the original comparison code, and the execution condition of the original comparison code is that no clear comparison result can be obtained by executing the custom comparison code.

[0106] Optionally, the custom comparison function is pre-written into the target tool, and the adding unit 301 can also add a custom comparison code including a custom function pointer in response to a code editing operation, wherein the custom function pointer is used to point to the custom comparison function.

[0107] Optionally, when the custom function pointer is not empty, the comparison unit 303 may also obtain the object characteristics of the objects to be compared by executing the custom comparison function, and compare the objects to be compared according to the object characteristics to obtain a comparison result.

[0108] Optionally, the object comparison device 300 further includes an assignment unit (not shown in the figure), which can assign the custom function pointer to a custom comparison function in response to a start command of the custom comparison function, wherein the initial value of the custom function pointer is empty.

[0109] Optionally, the comparison unit 303 may also execute a custom comparison function to obtain object features of the objects to be compared when the custom comparison function is started, and compare the objects to be compared according to the object features to obtain a comparison result.

[0110] Optionally, the object comparison device 300 also includes a switch unit (not shown in the figure), which can create a custom switch flag and set the custom switch flag to on in response to a start command of a custom comparison function; the comparison unit 303 can also obtain object characteristics of the object to be compared by executing a custom comparison function when it is determined that the custom switch flag is on, and compare the object to be compared according to the object characteristics to obtain a comparison result.

[0111] Optionally, the objects to be compared include a first comparison object and a second comparison object, wherein the custom comparison function is used to perform the following steps: determine a custom switch flag; when the custom switch flag is set to on, obtain a first object feature of the first comparison object and a second object feature of the second comparison object; perform a first comparison between the first object feature and the second object feature; if the first object feature is equal to the second object feature, return a first target value to a target variable in the custom comparison code; if the first object feature is not equal to the second object feature, return the second target value to the target variable; and, when the custom switch flag is set to off, return a third target value to the target variable.

[0112] Optionally, the custom comparison code is used to perform the following steps: determine a pre-set custom function pointer, wherein the custom function pointer is used to point to or not point to a custom comparison function; when the custom function pointer points to the custom comparison function, obtain the value of the target variable through the custom comparison function; if the target variable is assigned to a first target value or a second target value, use the first target value or the second target value as the comparison result, wherein the first target value indicates that the first comparison object is equal to the second comparison object, and the second target value indicates that the first comparison object is not equal to the second comparison object; if the target variable is assigned to a third target value, or when the custom function pointer does not point to the custom function, terminate the execution of the first comparison to directly perform a second comparison on the first comparison object and the second comparison object.

[0113] Optionally, the object comparison command includes a pointer to be compared, which is used to point to the data to be compared, wherein the operation of obtaining the object characteristics of the object to be compared includes: when it is determined that the data type of the pointer to be compared is a specified data type, obtaining the object characteristics of the object to be compared pointed to by the pointer to be compared.

[0114] Optionally, the object characteristics include a storage address.

[0115] Regarding the device in the above embodiment, the specific manner in which each unit performs the operation has been described in detail in the embodiment of the method, and will not be elaborated here.

[0116] Figure 4 is a block diagram showing a computer device according to an exemplary embodiment of the present application. Figure 4 As shown, the computer device 400 includes at least one processor 401 and at least one memory 402 storing computer executable instructions. Here, when the computer executable instructions are executed by the processor 401, the processor 401 is prompted to perform the object comparison method described in the above exemplary embodiment.

[0117] As an example, the computer device 400 is not necessarily a single device, but may be any collection of devices or circuits that can execute the above instructions (or instruction sets) individually or in combination. The computer device 400 may also be part of an integrated control system or system manager, or may be configured as a server that is interconnected with a local or remote (e.g., via wireless transmission) interface.

[0118] In computer device 400, processor 401 may include a central processing unit (CPU), a graphics processing unit (GPU), a programmable logic device, a dedicated processor system, a microcontroller, or a microprocessor. By way of example and not limitation, processor 401 may also include an analog processor, a digital processor, a microprocessor, a multi-core processor, a processor array, a network processor, etc.

[0119] The processor 401 may execute instructions or codes stored in the memory 402, wherein the memory 402 may also store data. Instructions and data may also be sent and received over a network via a network interface device, wherein the network interface device may employ any known transmission protocol.

[0120] The memory 402 may be integrated with the processor 401, for example, by placing RAM or flash memory within an integrated circuit design microprocessor or the like. In addition, the memory 402 may include a separate device, such as an external disk drive, a storage array, or any other storage device that can be used by a database system. The memory 402 and the processor 401 may be operationally coupled, or may communicate with each other, such as through an I / O port, a network connection, etc., so that the processor 401 can read files stored in the memory 402.

[0121] In addition, the computer device 400 may also include a video display (such as a liquid crystal display) and a user interaction interface (such as a keyboard, a mouse, a touch input device, etc.) All components of the computer device 400 may be connected to each other via a bus and / or a network.

[0122] In an exemplary embodiment, a computer-readable storage medium may also be provided. When the instructions in the computer-readable storage medium are executed by the processor, the processor is enabled to perform the object comparison method as described in the above exemplary embodiment. The computer-readable storage medium may be, for example, a memory including instructions. Optionally, the computer-readable storage medium may be: a read-only memory (ROM), a random access memory (RAM), a random access programmable read-only memory (PROM), an electrically erasable programmable read-only memory (EEPROM), a dynamic random access memory (DRAM), a static random access memory (SRAM), a flash memory, a non-volatile memory, a CD-ROM, a CD-R, a CD+R, a CD-RW, a CD+RW, a DVD-ROM, a DVD-R, a DVD+R, a DVD-RW, a DVD+RW, a DVD-RAM, a BD-ROM, a BD-R, a BD-R LTH, BD-RE, Blu-ray or optical disk storage, hard disk drive (HDD), solid state drive (SSD), card storage (such as, multimedia card, secure digital (SD) card or extreme digital (XD) card), magnetic tape, floppy disk, magneto-optical data storage device, optical data storage device, hard disk, solid state disk and any other device, any other device is configured to store computer programs and any associated data, data files and data structures in a non-transitory manner and provide the computer programs and any associated data, data files and data structures to a processor or computer so that the processor or computer can execute the computer program. The computer program in the above-mentioned computer-readable storage medium can be run in an environment deployed in a computer device such as a client, a host, an agent device, a server, etc. In addition, in one example, the computer program and any associated data, data files and data structures are distributed on a networked computer system, so that the computer program and any associated data, data files and data structures are stored, accessed and executed in a distributed manner by one or more processors or computers.

[0123] In an exemplary embodiment, a computer program product may also be provided, including computer instructions. When the computer instructions are executed by a processor, the processor is prompted to perform the object comparison method as described in the above exemplary embodiments.

[0124] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any variations, uses or adaptations of the present application, which follow the general principles of the present application and include common knowledge or customary techniques in the art that are not disclosed in the present application. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present application are indicated by the claims.

[0125] In addition, it should be noted that although several examples of each step are described above with reference to specific drawings, it should be understood that the implementation methods of the present application are not limited to the combinations given in the examples, and the steps appearing in different drawings may be combined, which are not exhaustively listed here.

[0126] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the claims.

Claims

1. An object comparison method, characterized in that: The object comparison method is applied to a command interpreter of a target tool, wherein the target tool includes integrated circuit electronic design automation software, and the object comparison method includes: In response to the code editing operation, a custom comparison code is added, wherein the custom comparison code indicates that object comparison based on object features is implemented by executing a custom comparison function, and the object features are used to distinguish different objects; Create custom switch flags; In response to a start command of the custom comparison function, setting the custom switch flag to on; receiving an object comparison command, wherein the object comparison command includes an object to be compared; In response to the object comparison command, the custom comparison code is executed to obtain the object feature of the object to be compared when it is determined that the custom switch flag is on by executing the custom comparison function, and the object to be compared is compared according to the object feature to obtain a comparison result; The objects to be compared include a first comparison object and a second comparison object, wherein the custom comparison function is used to perform the following steps: Determining the custom switch flag; When the custom switch flag is set to on, obtaining a first object feature of the first comparison object and a second object feature of the second comparison object; performing a first comparison between the first object feature and the second object feature; If the first object characteristic is equal to the second object characteristic, returning a first target value to a target variable in the custom comparison code; If the first object characteristic is not equal to the second object characteristic, returning a second target value to the target variable; and, When the custom switch flag is turned off, a third target value is returned to the target variable.

2. The object comparison method according to claim 1, characterized in that: The command interpreter pre-stores an original comparison code, and the comparison results of the custom comparison code and the original comparison code are selectively adopted, and the adoption priority of the comparison result of the custom comparison code is higher than the adoption priority of the comparison result of the original comparison code.

3. The object comparison method according to claim 2, characterized in that: The execution priority of the custom comparison code is higher than the execution priority of the original comparison code, and the execution condition of the original comparison code is that no clear comparison result can be obtained by executing the custom comparison code.

4. The object comparison method according to claim 1, characterized in that: The custom comparison function is pre-written in the target tool, and the adding of the custom comparison code in response to the code editing operation includes: In response to the code editing operation, the custom comparison code including a custom function pointer is added, wherein the custom function pointer is used to point to the custom comparison function.

5. The object comparison method according to claim 4, characterized in that: The step of executing the custom comparison function to obtain the object feature of the object to be compared when it is determined that the custom switch flag is on, and comparing the object to be compared according to the object feature to obtain a comparison result includes: When the custom function pointer is not empty, the custom comparison function is executed to obtain the object characteristics of the object to be compared when it is determined that the custom switch flag is on, and the objects to be compared are compared according to the object characteristics to obtain a comparison result.

6. The object comparison method according to claim 5, characterized in that: The object comparison method further comprises: In response to a start command of the custom comparison function, the custom function pointer is assigned to the custom comparison function, wherein an initial value of the custom function pointer is empty.

7. The object comparison method according to claim 1, characterized in that: The custom comparison code is used to perform the following steps: Determine a preset custom function pointer, wherein the custom function pointer is used to point to or not point to the custom comparison function; In the case where the custom function pointer points to the custom comparison function, obtaining the value of the target variable through the custom comparison function; If the target variable is assigned the first target value or the second target value, the first target value or the second target value is used as the comparison result, wherein the first target value indicates that the first comparison object is equal to the second comparison object, and the second target value indicates that the first comparison object is not equal to the second comparison object; If the target variable is assigned the third target value, or if the user-defined function pointer does not point to the user-defined function, the first comparison is terminated to directly perform a second comparison on the first comparison object and the second comparison object.

8. The object comparison method according to any one of claims 1 to 7, characterized in that: The object comparison command includes a pointer to be compared, and the pointer to be compared is used to point to the data to be compared, wherein obtaining the object feature of the object to be compared includes: When it is determined that the data type of the pointer to be compared is the specified data type, the object feature of the object to be compared pointed to by the pointer to be compared is obtained.

9. The object comparison method according to any one of claims 1 to 7, characterized in that: The object characteristics include a storage address.

10. An object comparison device, characterized in that: The object comparison device is applied to a command interpreter of a target tool, wherein the target tool includes integrated circuit electronic design automation software, and the object comparison device includes: an adding unit, configured to add a custom comparison code in response to a code editing operation, wherein the custom comparison code indicates that object comparison based on object features is implemented by executing a custom comparison function, and the object features are used to distinguish different objects; a switch unit configured to create a custom switch flag and, in response to a start command of a custom comparison function, set the custom switch flag to on; A receiving unit, configured to receive an object comparison command, wherein the object comparison command includes an object to be compared; a comparison unit configured to execute the custom comparison code in response to the object comparison command, so as to obtain the object feature of the object to be compared when it is determined that the custom switch flag is on by executing the custom comparison function, and compare the object to be compared according to the object feature to obtain a comparison result; The objects to be compared include a first comparison object and a second comparison object, wherein the custom comparison function is used to perform the following steps: Determining the custom switch flag; When the custom switch flag is set to on, obtaining a first object feature of the first comparison object and a second object feature of the second comparison object; performing a first comparison between the first object feature and the second object feature; If the first object characteristic is equal to the second object characteristic, returning a first target value to a target variable in the custom comparison code; If the first object characteristic is not equal to the second object characteristic, returning a second target value to the target variable; and, When the custom switch flag is turned off, a third target value is returned to the target variable.

11. A computer-readable storage medium, characterized in that: When the instructions in the computer-readable storage medium are executed by at least one processor, the at least one processor is prompted to perform the object comparison method according to any one of claims 1 to 9.

12. A computer device, characterized in that: include: at least one processor; at least one memory storing computer executable instructions, Wherein, when the computer executable instructions are executed by the at least one processor, the at least one processor is prompted to perform the object comparison method according to any one of claims 1 to 9.

13. A computer program product comprising computer instructions, characterized in that: When the computer instructions are executed by at least one processor, the at least one processor is prompted to perform the object comparison method according to any one of claims 1 to 9.