An Optimization Method for the Attribute Manager of an Integrated Circuit Database
By dividing attributes into sparse and dense categories in the EDA software database, and using appropriate data structures and containers for management, the problem of attribute management performance bottlenecks in the existing technology is solved, and efficient attribute management of ultra-large-scale integrated circuit databases is achieved.
Patent Information
- Application Number
- CN202411645559.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-18
- Publication Date
- 2025-06-24
- Estimated Expiration
- 2044-11-18
AI Technical Summary
When existing EDA software databases deal with hyperscale integrated circuit databases, there are performance bottlenecks in attribute management, especially when the data volume is huge, the conflicts and persistence of hash tables lead to poor time performance.
An attribute manager optimization method for integrated circuit database is adopted. By dividing attributes into sparse attributes and dense attributes, and using different data structures and containers for management, including the use of hash tables and arrays, combined with DJB hash algorithms and counter mechanisms, the attribute state is dynamically converted to optimize memory usage and runtime.
It significantly improves the access speed of element attributes, avoids multi-threaded data access conflicts, solves multi-threaded concurrency problems, and improves the performance of the entire process.
Smart Images

Figure CN119538815B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of Electronic Design Automation (EDA), and particularly to an optimization method for an attribute manager of an integrated circuit database. Background Art
[0002] With the rapid development of the semiconductor industry, the feature size of chips is getting smaller and smaller, and the number of transistors embedded in chips continues to increase exponentially. Correspondingly, the scale of the database for EDA tools also increases exponentially. For elements in the netlist of a database of very large scale integrated circuits, such as wires, ports of cell instances, etc., the number of elements reaches millions, tens of millions or even over hundreds of millions. Therefore, adding an attribute to them will have a certain impact on memory. Moreover, with the integration of various point tools (various software and hardware tools for designing and verifying integrated circuits), attributes will be gradually accumulated until it has a greater impact on memory. At the same time, due to the large scale, when accessing a certain attribute of a specific element, the search computational amount is extremely large. Once the access operation is too frequent, the time performance becomes a bottleneck. As the scale of the database in the EDA field becomes larger and the design process becomes more complex, the attribute management for the database needs to be designed in a refined manner, which not only needs to meet the functional requirements, but also needs to reasonably configure various basic data structures to make the time performance and storage performance reach the optimal.
[0003] The prior art takes into account that EDA software involves different attribute requirements, and due to the huge scale of the database, it is necessary to manage attributes in a customized manner. However, the EDA software database uses a single management mode for attribute management, so there are still performance bottlenecks. Specifically, the attribute management generally used in the current EDA software database modeling uses a key-value pair container based on a hash table. Such a container has acceptable performance when the amount of data is not much, but once the number of data entries reaches tens of millions, due to the increased possibility of hash table conflicts, it causes a bottleneck in the time performance of accessing attributes; and due to too much data, it takes more time for the persistence process. Therefore, for attribute management, how to ensure the time performance while supporting a huge amount of data needs to be deeply explored. How to optimize the design of attribute management in a database of very large scale integrated circuits is a problem of great value for improving the performance of the entire process. Summary of the Invention
[0004] To solve the deficiencies of the prior art, the purpose of the present invention is to provide an optimization method for the property manager of an integrated circuit database, to solve the performance problems encountered in the property management of the database used in EDA design, and to provide a user-friendly and performance-accelerated property manager optimization method. In particular, in the database of very large scale integrated circuits, the property management is optimized and designed, so that the performance of the whole process is significantly improved.
[0005] To achieve the above purpose, on the one hand, the present invention provides an optimization method for the property manager of an integrated circuit database, including the following steps:
[0006] Read the EDA database into memory;
[0007] According to the definition of the property, register each property item by item and record it in the definition data structure; the definition data structure uses the property serial number as the key and the meta-definition of the property as the value;
[0008] Create a value data structure and an array, which are respectively used to store the values of sparse properties and dense properties;
[0009] Access the properties of database elements;
[0010] Before exiting the program, persist the database and save the property values in the current memory to disk.
[0011] Further, it also includes:
[0012] According to the proportion of the number of database elements in the property scope to the total number of database elements, divide the properties into sparse properties and dense properties;
[0013] Store the values of sparse properties in the value data structure, and use the combination of the element identifier and the property serial number as the key of the value data structure, and the property value as the value of the value data structure;
[0014] Store the values of dense properties in the array.
[0015] Further, the step of accessing the properties of database elements further includes:
[0016] Obtain the value of the property through the name of the property and the database element;
[0017] Query through the definition data structure whether the definition of the property is registered. If so, take out the definition of the property and confirm whether it is a sparse property or a dense property. Otherwise, return "property undefined";
[0018] For sparse attributes, calculate their key values according to the element identifier and the attribute index, and determine whether there is a corresponding key-value pair in the value data structure. If so, return the key-value pair from the value data structure and obtain the corresponding attribute value;
[0019] For dense attributes, find the array pointer of the dense attribute, and find and return the attribute value in the corresponding dense attribute value array according to the element identifier.
[0020] Further, the step of calculating the key value of the sparse attribute according to the element identifier and the attribute index further includes:
[0021] Obtain two 32-bit integer values from the element identifier and the attribute index value respectively;
[0022] Through the DJB hash algorithm, starting from an initial hash value of 5381, shift the hash value 5 bits to the left and add the value of the element identifier, and update the obtained value as the new hash value;
[0023] Continue to shift the new hash value 5 bits to the left and add the attribute index value to obtain the final Key value.
[0024] Further, it also includes: converting sparse attributes into dense attributes or converting dense attributes into sparse attributes;
[0025] The step of converting sparse attributes into dense attributes includes: when setting the attribute value of an element, add a new record of the attribute value in the value data structure; increment the counter of the corresponding attribute by 1; compare the count value of the counter with the set upper threshold of the sparse attribute; if the count value of the counter exceeds the upper threshold, perform the conversion from sparse attributes to dense attributes;
[0026] The step of converting dense attributes into sparse attributes includes: when resetting the attribute value of an element, modify the corresponding record in the corresponding dense attribute array; decrement the counter of the corresponding attribute by 1; compare the count value of the counter with the set lower threshold of the dense attribute; if the count value of the counter is lower than the lower threshold, perform the conversion from dense attributes to sparse attributes.
[0027] Even further, the step of persisting the database and saving the attribute values in the current memory before exiting the program further includes: persisting the attribute manager; during the process of persisting the attribute manager, serialize the metadata of the attribute manager itself, and then persist the corresponding data structure and array respectively.
[0028] On the other hand, the present invention also provides an attribute manager for an integrated circuit database, which adopts the optimization method for the attribute manager of the integrated circuit database described in any one of claims 1-5.
[0029] On the other hand, the present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. The processor is configured to execute the computer program stored in the memory to implement the optimization method for the attribute manager of the integrated circuit database as described above.
[0030] On the other hand, the present invention also provides a computer-readable storage medium, in which a computer program is stored. The computer program is loaded and executed by a processor to implement the optimization method for the attribute manager of the integrated circuit database as described above.
[0031] The optimization method for the attribute manager of the integrated circuit database provided by the present invention has the following
[0032] beneficial effects as compared with the prior art:
[0033] By selecting different containers and specifically choosing data structures, the access speed to element attributes is significantly improved, and it is possible to avoid multi-threaded data access conflicts in most scenarios, thus solving the problem of multi-threaded concurrency.
[0034] Other features and advantages of the present invention will be described in the subsequent specification, and some of them will become obvious from the specification or can be understood by implementing the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] The drawings are used to provide further understanding of the present invention, and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention, but do not constitute a limitation to the present invention. In the drawings:
[0036] Figure 1 is a flowchart of the optimization method for the attribute manager of the integrated circuit database according to an embodiment of the present invention;
[0037] Figure 2 is a schematic structural diagram of the attribute manager of the integrated circuit database according to an embodiment of the present invention;
[0038] Figure 3 is a schematic flowchart of reading database elements according to an embodiment of the present invention;
[0039] Figure 4 is a flowchart of the method for converting sparse attributes into dense attributes according to an embodiment of the present invention;
[0040] Figure 5Flowchart of the method for converting dense attributes to sparse attributes according to an embodiment of the present invention;
[0041] Figure 6 Schematic structural diagram of an electronic device according to an embodiment of the present invention. Detailed implementation manners
[0042] The preferred embodiments of the present invention will be described below with reference to the accompanying drawings. It should be understood that the preferred embodiments described herein are only for the purpose of illustrating and explaining the present invention, and are not used to limit the present invention.
[0043] The embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although some embodiments of the present invention are shown in the drawings, it should be understood that the present invention can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. On the contrary, these embodiments are provided to more thoroughly and completely understand the present invention. It should be understood that the drawings and embodiments of the present invention are only for exemplary purposes and are not used to limit the protection scope of the present invention.
[0044] The term "including" and its variations used herein are open-ended, that is, "including but not limited to". The term "based on" is "at least partially based on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.
[0045] It should be noted that the modifications of "one" and "multiple" that may be mentioned in the present invention are illustrative rather than restrictive. Those skilled in the art should understand that unless otherwise clearly specified in the context, it should be understood as "one or more". "Multiple" should be understood as two or more.
[0046] To make the purpose, technical solutions and advantages of the present invention clearer, the embodiments of the present invention will be further described in detail below with reference to the accompanying drawings.
[0047] The present invention is directed to a design method for an attribute manager of a very large scale integrated circuit database, and provides an optimization method for an attribute manager of an integrated circuit database. The optimization method includes the following steps: reading an EDA database into memory; registering attributes one by one according to the definition of the attributes and recording them in a defined data structure; the defined data structure uses the attribute serial number as the key and the meta-definition of the attribute as the value; creating a value data structure and an array for storing the values of sparse attributes and dense attributes respectively; accessing and storing the attributes of database elements; before exiting the program, persisting the database and saving the attribute values in the current memory to disk.
[0048] Persistence is the process of saving data (such as objects in memory) to a storage device (such as a disk) that can be permanently stored.
[0049] Figure 1 It is a flowchart of an optimization method for an attribute manager of an integrated circuit database according to an embodiment of the present invention. Figure 2 It is a schematic structural diagram of an attribute manager of an integrated circuit database according to an embodiment of the present invention. The following will refer to Figure 1 and Figure 2 to describe the specific embodiments of the present invention in detail.
[0050] In step 101, the EDA database is read into memory.
[0051] In the embodiment of the present invention, first, the EDA tool reads its database into memory; next, according to the needs of the tool, the definitions of the attributes are registered item by item; after the attributes have definitions, in the optimization process, there will be settings for the attributes for specific database elements, and there will also be operations of frequently reading attribute values; finally, when the program needs to exit, an operation of persistently writing the database to the disk will be performed, and the attribute manager will also save the current attribute values in memory (store the data information on the disk).
[0052] In step 102, the attributes are registered according to the definitions of the attributes.
[0053] In the embodiment of the present invention, as Figure 2 shown, the attribute manager (AttrManager) respectively maintains multiple data structures (Map, including DefinitionMap201 and ValueMap202) and arrays (Array). The registration of the definitions of the attributes will be recorded in the definition data structure (DefinitionMap) 201. We use the attribute serial number as the key of this DefinitionMap201 (a character or a group of characters used to uniquely identify a data item), and use the meta-definition of the attribute (the definition of the attribute is the original definition information, and the meta-definition is the information describing and explaining these original definition information) as the value (Value) of DefinitionMap201. Each attribute will be characterized by a unique serial number, and this serial number has a mapping relationship with the name of the attribute. The application layer can quickly obtain the corresponding serial number through the name of the attribute.
[0054] According to the density of data elements on which an attribute takes effect, embodiments of the present invention classify attributes into two categories: sparse attributes and dense attributes. A more specific definition is that when the database elements within the scope of an attribute do not exceed 20% of the total amount, we consider its definition to be in a sparse state and thus classify it as a sparse attribute; while if it reaches 70% or more of the total amount of database elements, it is in a dense state and thus classified as a dense attribute. For those in between, further refinement is made according to the usage of the upper-layer application and the specific scenario.
[0055] As Figure 2 shown, if the value belongs to a sparse attribute, it is stored in the value data structure (ValueMap) 202. This ValueMap 202 needs to consider factors such as security and performance in a multi-threaded scenario. Using the combination of the element identifier and the attribute serial number as the key of ValueMap 202 and the attribute value as the value of ValueMap 202, conflicts are reduced and the position of the value corresponding to the sparse attribute in ValueMap 202 can be accurately located.
[0056] While if the value belongs to a dense attribute, it is stored in Figure 2 the Array203 in. The dense attribute creates a corresponding attribute record for each database element of this type. If it has not been set, it remains in an initial state, and the rest are modified according to the set state of the specific element.
[0057] By classifying attributes into sparse attributes and dense attributes according to their setting states in elements, and designing containers suitable for managing them for sparse and dense states respectively. Sparse attributes require less memory and have fast access speed; while dense attributes, although they occupy more memory, have even faster access speed and are convenient to manage, greatly improving the access speed to element attributes.
[0058] By selecting different containers and specifically choosing the algorithm for the Map key (data structure key), data access conflicts in most scenarios are avoided, and the problem of multi-threaded concurrency is solved.
[0059] In step 103, access a specific database element.
[0060] In the embodiments of the present invention, accessing a specific database element is an operation that is repeatedly and frequently used in the process. The process of reading specific attributes on a certain data element is expanded as Figure 3 shown, and further includes:
[0061] In step 301, obtain the value of the attribute through the name of the attribute and the database element.
[0062] In step 302, query DefinitionMap201 to check if there is a registered definition for the corresponding attribute. If there is, proceed to step 303; otherwise, return "Attribute not defined".
[0063] In step 303, retrieve the definition of the attribute and confirm whether it is a sparse attribute or a dense attribute. For a sparse attribute, calculate its Key value in ValueMap202 based on the element identifier and the attribute index to determine if there is a corresponding key-value pair (composed of a unique key and an associated value). If there is, return the key-value pair from ValueMap202 to obtain the corresponding attribute value. For a dense attribute, find the array pointer of the dense attribute and locate the attribute value in the corresponding dense attribute value array based on the element identifier and then return it.
[0064] In the embodiment of the present invention, for a sparse attribute, calculating its Key value in ValueMap202 based on the element identifier and the attribute index includes: obtaining two 32-bit integer values from the element identifier and the attribute index value; through the DJB hash algorithm, that is, starting from an initial hash value of 5381, shift the hash value 5 bits to the left and add the value of the element identifier, and update the obtained numerical value as the new hash value; continue to shift the new hash value 5 bits to the left and add the attribute index value to obtain the final Key value. The above Key value algorithm has a fast operation speed, is easy to implement, and has few hash conflicts, which can further improve the access speed to element attributes and can avoid multi-threaded data access conflicts in most scenarios, and is very suitable for optimizing the attribute manager of a very large scale integrated circuit database.
[0065] In the embodiment of the present invention, the sparse or dense state of the attribute value will change during the setting process, that is, as the operation of setting the attribute increases, the attribute may change from the original sparse state to a dense state, and conversely, if there are some operations to reset the attribute value, the state of the attribute may change from dense to sparse. For this scenario, the present invention provides a mechanism for converting sparse attributes and dense attributes into each other to optimize the performance of memory usage and running time.
[0066] Corresponding to step 303 above, for sparse attributes, calculate the Key value according to the element identifier and the attribute index, return the key-value pair from ValueMap202, modify the value in ValueMap202, and perform an incremental count according to the attribute index and the element type. Compare whether the count value exceeds the upper threshold of the set sparse attribute to determine whether to convert the sparse attribute to a dense attribute. For dense attributes, obtain the corresponding address of the dense attribute in Array203 according to the element identifier and the attribute index, modify the content in the address. If the modification method is to reset the value of the dense attribute, perform a decremental count, and compare whether the count value is lower than the lower threshold of the set dense attribute to determine whether to convert the dense attribute to a sparse attribute.
[0067] For example, Figure 4 is a flowchart of the method for converting sparse attributes into dense attributes according to an embodiment of the present invention. As Figure 4 shown, the steps for converting sparse attributes into dense attributes are as follows:
[0068] In step 401, set a certain attribute value of a certain element, and a new record of this attribute value is added to ValueMap202;
[0069] In step 402, increment the counter corresponding to this attribute by 1;
[0070] In step 403, compare the number of the counter with the upper threshold of the sparse attribute;
[0071] In step 404, if the number of the counter exceeds the upper threshold, convert the sparse attribute into a dense attribute.
[0072] Figure 5 is a flowchart of the method for converting dense attributes into sparse attributes according to an embodiment of the present invention. As Figure 5 shown, the steps for converting dense attributes into sparse attributes are as follows:
[0073] In step 501, reset a certain attribute value of an element, and modify the corresponding record in the corresponding dense attribute array;
[0074] In step 502, decrement the counter corresponding to this attribute by 1;
[0075] In step 503, compare the number of the counter with the lower threshold of this dense attribute;
[0076] In step 504, if the number of the counter is lower than the lower threshold, convert the dense attribute into a sparse attribute.
[0077] In a concise manner, it provides a mechanism for mutual conversion between the sparse and dense states of attributes, can make more use of the characteristics of the container, make the best use of advantages and avoid disadvantages, and improve the utilization rate of memory.
[0078] Continue to refer to Figure 1 and Figure 2 In step 104, before exiting the program, the property manager is persisted. During the process of persisting the property manager, the metadata of the property manager itself (data that describes and interprets the original data information) is serialized, and then the corresponding Map and Array are persisted respectively.
[0079] The method for optimizing the property manager of the integrated circuit database provided by the present invention supports the different requirements of various point tools in the EDA process for the properties of elements in the database. For the scenarios where the EDA database uses properties, the design of the property manager is carried out, taking into account the basic characteristics of the integrated circuit database and the different sizes of the data volumes of different properties, integrating two completely different container managements, namely linear arrays and hash key-value tables, and using different containers in a way that makes the best use of their advantages and avoids their disadvantages; a mechanism for converting sparse properties and dense properties is provided. Under this mechanism, the management of properties can be improved to a more optimal state in terms of memory usage and running time performance.
[0080] In an embodiment of the present invention, an electronic device is further provided. Figure 6 For the structural schematic diagram of the electronic device according to the embodiment of the present invention, as Figure 6 shown, the electronic device of the present invention includes a processor 601 and a memory 602. Among them,
[0081] The memory 602 stores a computer program. When the computer program is read and executed by the processor 601, the steps in the embodiment of the method for optimizing the property manager of the integrated circuit database described above are executed.
[0082] In an embodiment of the present invention, a computer-readable storage medium is further provided. A computer program is stored in the computer-readable storage medium. Among them, the computer program is set to execute the steps in the embodiment of the method for optimizing the property manager of the integrated circuit database described above when running.
[0083] In this embodiment, the above computer-readable storage medium may include, but is not limited to: various media such as USB flash drives, read-only memories (abbreviated as ROM), random access memories (abbreviated as RAM), mobile hard disks, magnetic disks, or optical discs that can store computer programs.
[0084] Those of ordinary skill in the art can understand that the above description is only the preferred embodiment of the present invention and is not intended to limit the present invention. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing embodiments or perform equivalent replacements for some of the technical features. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present invention shall be included within the protection scope of the present invention.
Claims
1. A method for optimizing an attribute manager of an integrated circuit database, characterized in that: The following steps are involved: Read the EDA database into memory; According to the definition of the attribute, register the attributes one by one and record them in the definition data structure; The definition data structure uses the attribute sequence number as a key and the attribute meta-definition as a value; According to the ratio of the number of database elements in the attribute scope to the total number of database elements, attributes are divided into sparse attributes and dense attributes; Creating a value data structure and an array, respectively for storing the values of the sparse attribute and the dense attribute; The value of the sparse attribute is stored in the value data structure, and the combination of the element identifier and the attribute serial number is used as the key of the value data structure, and the attribute value is used as the value of the value data structure; storing the value of the dense attribute in the array; Access the attributes of database elements; Before exiting the program, the database is persisted and the attribute values currently in the memory are saved.
2. The integrated circuit database property manager optimization method according to claim 1, characterized in that: The step of accessing the attributes of the database element further includes: obtaining the value of the attribute through the name of the attribute and the database element; querying whether the definition of the attribute is registered through the definition data structure, if so, taking out the definition of the attribute and confirming whether it is a sparse attribute or a dense attribute, otherwise returning "attribute undefined"; for sparse attributes, calculating its key value according to the element identifier and the attribute index, and judging whether there is a corresponding key-value pair in the value data structure, if so, returning the key-value pair from the value data structure to obtain the corresponding attribute value; for dense attributes, finding the array pointer of the dense attribute, finding the attribute value in the corresponding dense attribute value array according to the element identifier and returning it.
3. The integrated circuit database property manager optimization method according to claim 2, characterized in that: The step of calculating the key value of a sparse attribute based on an element identifier and an attribute index further includes: obtaining two 32-bit integer values from the element identifier and the attribute index value respectively; using the DJB hash algorithm, starting from an initial hash value 5381, shifting the hash value left by 5 bits, and adding the value of the element identifier, and updating the obtained value to a new hash value; further shifting the new hash value left by 5 bits and adding the attribute index value to obtain the final Key value.
4. The integrated circuit database property manager optimization method according to claim 1, characterized in that: It also includes: converting sparse attributes into dense attributes or converting dense attributes into sparse attributes; the step of converting sparse attributes into dense attributes includes: when setting the attribute value of an element, adding a record of the attribute value in the value data structure; adding 1 to the counter of the corresponding attribute; comparing the count value of the counter with the set upper limit threshold of the sparse attribute; if the count value of the counter exceeds the upper limit threshold, converting the sparse attribute to the dense attribute; the step of converting the dense attribute into the sparse attribute includes: when resetting the attribute value of an element, modifying the corresponding record in the corresponding dense attribute array; reducing 1 from the counter of the corresponding attribute; comparing the count value of the counter with the set lower limit threshold of the dense attribute; if the count value of the counter is lower than the lower limit threshold, converting the dense attribute to the sparse attribute.
5. The integrated circuit database property manager optimization method according to claim 1, characterized in that: The step of persisting the database and saving the attribute values currently in the memory before exiting the program further includes: persisting the attribute manager; in the process of persisting the attribute manager, serializing the metadata of the attribute manager itself, and then persisting the corresponding data structures and arrays respectively.
6. An attribute manager for an integrated circuit database, characterized in that: A property manager optimization method for an integrated circuit database according to any one of claims 1 to 5.
7. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: The processor is used to execute the computer program stored in the memory to implement the integrated circuit database property manager optimization method described in any one of claims 1-5.
8. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, which is loaded and executed by a processor to implement the property manager optimization method of an integrated circuit database as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Transaction data processing method and device based on block chain, equipment and storage medium
CN112148734A
Interconnection line management and design method in database modeling
CN117454833A