Layout file multi-thread reading method and device, equipment and storage medium
The multi-threaded reading of chip design files addresses the inefficiencies of single-threaded reading by utilizing multi-core processors, significantly improving read speed and efficiency.
Patent Information
- Application Number
- CN202510783038.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-12
- Publication Date
- 2025-07-15
- Estimated Expiration
- 2045-06-12
AI Technical Summary
In the prior art, the single-threaded mode is too slow to read large-scale layout files, and cannot fully utilize multi-core processor resources, resulting in waste of hardware performance and cannot meet the needs of fast processing and real-time verification.
The multi-threaded reading method is adopted, through block processing and multi-thread parallel computing, and the multi-core processor performance is used to allocate threads to decompress and read the blocks to be read and compressed to be blocked, and data completion is combined with the modal variable mechanism to form a complete layout file.
It greatly improves the reading speed of layout files, makes full use of multi-core processor resources, and provides more efficient file loading and operation solutions.
Smart Images

Figure CN120315896A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of integrated circuit design and manufacturing, and particularly relates to a multi-threaded method, device, equipment and storage medium for reading layout files. Background Art
[0002] With the continuous reduction of process nodes and the improvement of design complexity, the scale of layout files in modern chip design is increasing day by day. The size of a single layout file often reaches dozens of GB or even hundreds of GB, which poses a severe challenge to the file reading speed and processing efficiency. In the traditional single-threaded reading mode, the file opening speed is becoming increasingly inadequate and gradually unable to meet the current requirements of fast processing and real-time verification.
[0003] GDSII and OASIS are two important layout file formats in the semiconductor design field. Among them, OASIS (OpenArtwork System Interchange Standard) is a more efficient alternative to GDSII that emerged with the continuous development of semiconductor technology and can handle more complex and delicate chip designs. OASIS files describe layout information through a series of records, and each record has a specific purpose.
[0004] Currently, in semiconductor design, the reading mode of layout files mainly adopts the single-threaded mode. This traditional method can provide relatively stable performance when the file scale is small, but as the process nodes shrink and the design complexity increases, the volume of layout files gradually increases, and the limitations of the single-threaded reading method become increasingly obvious.
[0005] The main deficiencies of the single-threaded reading mode are as follows: 1) The performance bottleneck is obvious. The speed of reading files is limited by the computing power of a single CPU core. When faced with ultra-large files of dozens of GB or even hundreds of GB, the processing speed is too slow, resulting in a long file loading time and affecting the development efficiency of the design team; 2) It is impossible to make full use of processor resources. Most modern processors are equipped with multi-core architectures, but the single-threaded reading mode cannot effectively schedule these resources, resulting in waste of hardware performance.
[0006] Therefore, in order to meet the growing demand for reading layout files, especially for layout files in OASIS format, there is an urgent need for a reading method that can improve the reading speed of layout files and reduce the reading time of layout files, so as to provide a more efficient solution for file loading and operation in semiconductor design. Summary of the Invention
[0007] The present invention provides a multi-threaded method, device, computer equipment, and computer-readable storage medium for reading layout files, which can greatly improve the reading speed of layout files to solve all or part of the above-mentioned problems of the prior art.
[0008] In a first aspect, a multi-threaded method for reading layout files is provided in this embodiment, including: The layout file includes multiple records; Based on the record information, the layout file is block-processed to obtain blocks to be read and put into a queue to be read, and blocks to be block-compressed and put into a queue to be block-compressed; When it is monitored that there is a block to be block-compressed in the queue to be block-compressed and there are available idle threads, a thread is allocated to decompress and block-process the block to be block-compressed; When it is monitored that there is a block to be read in the queue to be read and there are available idle threads, a thread is allocated to read the block to be read to obtain the data of the block to be read; Post-process the data of all the blocks to be read obtained, and complete the reading of the layout file.
[0009] In some of these embodiments, the block-processing includes: Based on the record information and a preset block threshold, the multiple records of the layout file are divided into multiple blocks to be read and multiple blocks to be block-compressed; or, based on the record information and the preset block threshold, the decompressed blocks to be block-compressed are divided into multiple blocks to be read; wherein, the record information includes record length and record type.
[0010] In some of these embodiments, the block-processing further includes: Distinguish the record types of the records, and records of different record types are divided into different blocks to be read; Wherein, the record types include a first type and a second type; The first type is a record type for defining names, text information, and strings; The second type is a record type for defining graphic elements or structures.
[0011] In some of these embodiments, among the records of the second type, there is also a subtype: compressed block; When performing the block-processing, the blocks to be block-compressed put into the queue to be block-compressed are compressed blocks with a length greater than or equal to the block threshold before compression.
[0012] In some of these embodiments, among the records of the second type, there is also a subtype: relative coordinate mode; During the block processing, records in the layout file in multiple relative coordinate modes that belong to the same structure are grouped into the same block to be read.
[0013] In some of these embodiments, the layout file multi-threaded reading method supports multi-threaded parallel processing of the layout file reading. The threads include: A monitoring thread, which is used to monitor whether there are blocks to be read in the queue to be read and allocate processing, and is also used to monitor whether there are compressed blocks to be chunked in the queue to be chunked and allocate processing; A chunking thread, which is used to perform chunking processing on the layout file, and is also used to obtain the compressed blocks to be chunked in the queue to be chunked, perform decompression and chunking processing; A reading thread, which is used to obtain the blocks to be read in the queue to be read and perform reading.
[0014] In some of these embodiments, after the chunking thread performs decompression and chunking processing on the compressed blocks to be chunked, the obtained blocks to be read are inserted into the end of the queue to be read, and a locking control is performed during the insertion.
[0015] In some of these embodiments, a modal variable mechanism is set in the layout file; When the allocation thread performs reading processing on the blocks to be read to obtain the data of the blocks to be read, it further includes: marking the values of the modal variables in the read data as default; When performing post-processing on the data of all the blocks to be read obtained, it further includes: using the current modal variable updated with the data read from the previous block to be read to perform complement processing on the data marked as default read from the current block to be read.
[0016] In some of these embodiments, the using the modal variable updated with the data read from the previous block to be read to perform complement processing on the data marked as default read from the current block to be read specifically includes the steps of: Sequentially obtain the data read from the block to be read, denoted as the current data; determine whether there is a default mark in the current data: if there is no default mark, the current data is complete data and does not need to be complemented, and obtain the value of the modal variable in the current data, denoted as the current modal variable; if there is a default mark, use the current modal variable to complement the current data, and obtain the value of the modal variable in the current data to complement and / or update the current modal variable; Until the complement processing of all the read data is completed.
[0017] In some of these embodiments, the performing post-processing on the data of all the blocks to be read obtained to complete the reading of the layout file includes: Merging the structural data read in multiple blocks to be read to form a complete structure.
[0018] In a second aspect, in this embodiment, a multi-threaded layout file reading device is provided. The device includes: A chunking module, configured to perform chunking processing on the layout file based on record information, obtain chunks to be read and put them into a queue to be read, and obtain chunks to be chunked and compressed and put them into a queue to be chunked; the layout file includes multiple records; and, when it is monitored that there are chunks to be chunked and compressed in the queue to be chunked and there are available idle threads, allocate threads to perform decompression and chunking processing on the chunks to be chunked and compressed; A reading module, configured to, when it is monitored that there are chunks to be read in the queue to be read and there are available idle threads, allocate threads to perform reading processing on the chunks to be read to obtain the data of the chunks to be read; A post-processing module, configured to perform post-processing on the data of all the chunks to be read obtained, and complete the reading of the layout file.
[0019] In a third aspect, in this embodiment, a computer device is provided, including a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, the steps of the layout file multi-threaded reading method described in the first aspect above are implemented.
[0020] In a fourth aspect, in this embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the layout file multi-threaded reading method described in the first aspect above are implemented.
[0021] The above layout file multi-threaded reading method, through chunking processing and support for multi-threaded parallel computing, makes full use of the performance of multi-core processors, greatly improves the reading speed of layout files, and provides a more efficient solution for file loading and operation in semiconductor design. Further, a layout file multi-threaded reading device, a computer device, and a computer-readable storage medium are provided, each of which has the performance and beneficial effects of the aforementioned layout file multi-threaded reading method. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] In order to more clearly illustrate the technical solutions in the embodiments of the present application or in the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0023] Figure 1 It is a flowchart of the layout file multi-threaded reading method in an embodiment; Figure 2 It is an internal structure diagram of a computer device in an embodiment. Detailed implementation manners
[0024] To facilitate the understanding of the present application, the present application will be described more comprehensively below with reference to the relevant drawings. Embodiments of the present application are given in the drawings. However, the present application can be implemented in many different forms and is not limited to the embodiments described herein. On the contrary, these embodiments are provided to make the disclosure of the present application more thorough and comprehensive.
[0025] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the technical field to which this application belongs. The terms used in the description of this application herein are only for the purpose of describing specific embodiments and are not intended to limit this application.
[0026] It should also be understood that terms such as "comprising / including" or "having" etc. specify the presence of the stated features, wholes, steps, operations, components, parts or combinations thereof, but do not exclude the possibility of the presence or addition of one or more other features, wholes, steps, operations, components, parts or combinations thereof. At the same time, in this specification, the term "and / or" includes any and all combinations of the related listed items.
[0027] To improve the reading speed of the layout files in OASIS format, this embodiment provides a multi-threaded reading method for layout files as shown in Figure 1 the following, including: The layout file includes multiple records; Based on the record information, the layout file is block-processed to obtain the blocks to be read and put into the queue to be read, and the blocks to be block-compressed and put into the queue to be block-compressed; When it is monitored that there is a block to be block-compressed in the queue to be block-compressed and there are available idle threads, a thread is allocated to decompress and block-process the block to be block-compressed; When it is monitored that there is a block to be read in the queue to be read and there are available idle threads, a thread is allocated to read-process the block to be read to obtain the data of the block to be read; The data of all the blocks to be read obtained is post-processed to complete the reading of the layout file.
[0028] Specifically, the above multi-threaded reading method for layout files mainly includes three main processing stages: block processing, reading processing, and post-processing. First is block processing. Since the layout file consists of continuous records and the record length is uncertain, to perform block processing, each record needs to be scanned one by one to obtain the position of a specific record, and then a suitable position is selected as the block split point, thereby obtaining a series of information about the blocks to be read, including the position and size of the blocks. With this series of block information, a thread can be allocated to each block for reading to obtain the block data. After all blocks are read, it enters the post-processing stage, where the information of each block is summarized and merged to obtain the complete layout information, thus completing the reading. This method makes full use of the performance of multi-core processors through block processing and supporting multi-threaded parallel reading, greatly improving the reading speed of layout files and providing a more efficient solution for file loading and operation in semiconductor design.
[0029] In this embodiment, the block processing includes: dividing multiple records of the layout file into multiple blocks to be read based on the record information and a preset block threshold; or, dividing the compressed blocks to be blocked after decompression into multiple blocks to be read based on the record information and a preset block threshold; where the record information includes the record length and the record type. By presetting the block threshold, the length of the blocks to be read is set, and then the time for a subsequent reading thread to read a block to be read is adjusted; in a specific application, the block threshold can be set according to the performance of the multi-core processor and the current application scenario requirements, and then the layout file is block-processed based on the record information.
[0030] In this embodiment, the block processing further includes: distinguishing the record types of the records, and dividing records of different record types into different blocks to be read; where the record types include a first type (NameString type) and a second type (Cell type); the first type (NameString type) is a record type used to define names, text information, and strings; the second type (Cell type) is a record type used to define graphic elements or structures; The types of blocks include a first type (NameString type) and a second type (Cell type).
[0031] The OASIS file will use numbers to represent some strings, thereby reducing the space overhead caused by repeated use of these strings. Therefore, there are some records for recording the correspondence between strings and numbers. These records are generally at the front and back of the file, but may also appear between structures. When performing block processing, the positions of these records are found and recorded as blocks of the first type (NameString type), which are distinguished from the blocks of the second type (Cell type) and also placed in the waiting queue for reading threads to process.
[0032] That is, the record types of the OASIS file can be divided into the NameString type and the Cell type.
[0033] Common NameString type records include: CELLNAME record, used to specify the name of a cell; TEXTSTRING record, used to store layout-related text information, such as marks, comments, or labels; PROPNAME record, used to define the name of an attribute; PROPSTRING record, used to define the string in an attribute value; LAYERNAME record, used to specify the name of a certain layer in a design; XNAME record, used to provide an extended name for an element in a design.
[0034] Common Cell type records include: XYRELATIVE, a record in relative coordinate mode; XYABSOLUTE, a record in absolute coordinate mode; PLACEMENT, a record used to define the specific position and arrangement of a certain graphic or structure in a design; TEXT, a record used to represent a text string or literal information; RECTANGLE, a record used to describe a simple rectangular area; POLYGON, a record used to represent a polygonal graphic; PATH, a record used to represent a path graphic.
[0035] In this embodiment, among the records of the second type, there are also subtypes: compressed block (CBlock); When performing block processing, the to-be-blocked compressed block placed in the to-be-blocked queue is a compressed block whose length before compression is greater than or equal to the block threshold.
[0036] There is a special record type CBlock (subtype under the second type) in the OASIS file. CBlock includes information such as the length before compression and the length after compression. When a CBlock is encountered during scanning, the CBlock whose length before compression is greater than the block threshold can be placed in the to-be-blocked queue as a to-be-blocked compressed block; subsequently, the to-be-blocked compressed blocks in the to-be-blocked queue can be decompressed and block-processed by allocating a dedicated thread, and the divided to-be-read blocks are also placed in the to-be-read queue.
[0037] In this embodiment, the above multi-threaded reading method for the layout file supports multi-threaded parallel processing of reading the layout file. The threads include: A monitoring thread, used to monitor whether there are to-be-read blocks in the to-be-read queue and allocate processing, and to monitor whether there are to-be-blocked compressed blocks in the to-be-blocked queue and allocate processing; A block-processing thread, used to perform block processing on the layout file, and to obtain the to-be-blocked compressed blocks in the to-be-blocked queue for decompression and block processing; A reading thread for obtaining the to-be-read blocks in the to-be-read queue for reading.
[0038] Specifically, the parallel reading and chunking processing of the to-be-read blocks are carried out simultaneously. During the chunking processing by the chunking thread, the monitoring thread has been monitoring the to-be-read queue and the to-be-chunked queue. When the monitoring thread detects a new to-be-read block or a new to-be-chunked compressed block in the to-be-read queue, if there are idle worker threads, it allocates a reading thread to read the new to-be-read block, or allocates a chunking thread to decompress and chunk the to-be-chunked compressed block. Through such multi-thread parallel processing, the idle multi-core architecture processor resources are fully utilized, and when facing ultra-large layout files of dozens of GB or even hundreds of GB, the layout reading speed can be greatly improved.
[0039] In this embodiment, after the chunking thread decompresses and chunks the to-be-chunked compressed block, the obtained to-be-read block is inserted into the tail of the to-be-read queue, and a lock control is performed during the insertion to avoid conflicts when multiple chunking threads insert to-be-read blocks into the to-be-read queue simultaneously.
[0040] In this embodiment, a ModalVariable mechanism is set in the layout file; When the allocation thread reads and processes the to-be-read block to obtain the data of the to-be-read block, it further includes: marking the value of the modal variable in the read data as default; When post-processing the data of all the obtained to-be-read blocks, it further includes: using the current modal variable updated with the data read from the previous to-be-read block to complete the data marked as default read from the current to-be-read block.
[0041] The data completion in the post-processing specifically includes the steps of: sequentially obtaining the data read from the to-be-read block, denoted as the current data; determining whether there is a default mark in the current data: if there is no default mark, the current data is complete data and does not need to be completed, and the value of the modal variable in the current data is obtained, denoted as the current modal variable; if there is a default mark, the current data is completed using the current modal variable, and the value of the modal variable in the current data is obtained to complete and / or update the current modal variable; until the completion of the data completion processing for all the read data.
[0042] The OASIS file has a ModalVariable mechanism, which is a technology for reducing redundant data and improving file compression efficiency. By using modal variables (ModalVariable), OASIS files can represent recurring values more compactly. For example, the ModalVariable mechanism allows default values to be set for certain fields in the OASIS file. In a record, if the value of a field is the same as the value used last time, that field can be omitted, thus reducing data redundancy. ModalVariables are usually used for fields that often repeat, such as coordinates, layer numbers, data types, etc., which can avoid storing the same value repeatedly in each record.
[0043] In the ModalVariable mechanism, subsequent records may depend on the data in previous records. This leads to the situation that if a structure (Cell, also known as Structure or Library Element) is read in multiple blocks, due to the lack of data communication between blocks during parallel reading, the data dependency relationship cannot be established properly, and some data items cannot obtain values. When reading, these parts of data need to be set to the default state and completed in the post-processing stage. To achieve this, the final ModalVariable obtained for each block also needs to be saved for completing the data of the file blocks after the current block.
[0044] It should be noted that when the specific steps of data completion are executed, starting from the data read from the first block to be read, since there is no previously read block before the first read block, this data must be complete data, and the values of the modal variables in the data are also complete and do not need to be completed.
[0045] In this embodiment, in the records of the second type, there is also a subtype: relative coordinate mode (XYRELATIVE); During block processing, records of multiple relative coordinate modes (XYRELATIVE) that belong to the same structure in the layout file are grouped into the same block to be read. ModalVariable has a field for setting whether the current element coordinates are in absolute coordinate mode or relative coordinate mode. Records of the same structure in the relative coordinate mode interval cannot be read in multiple blocks.
[0046] The following uses a specific application embodiment to illustrate the block processing of the OASIS file, as Figure 1 shown, which specifically includes the steps: Step S1: Obtain the records of the layout file for scanning; record the currently scanned record as the current record, and the currently scanned block as the current block; Step S2: Obtain the record type of the current record and determine whether the current block has been marked with a type: If it is already marked, determine whether the type of the current block is the same as the record type of the current record: If they are the same, directly proceed to step S3 for processing; if they are different, end the scanning of the current block, put the current block into the queue of blocks to be read as a block to be read, start scanning a new block, and after marking the new block as the current block, proceed to step S3 for processing; If it is not marked, mark the current block as the same type as the current record, and then proceed to step S3 for processing; Step S3: Determine the subsequent processing method according to the record type of the current record: If the current record is of the first type (NameString type), proceed to step S4 for processing; If the current record is of the second type (Cell type), proceed to step S5 for processing; Step S4: Incorporate the current record into the current block and update the length of the current block: If the length of the current block is greater than or equal to the preset block division threshold, end the scanning of the current block, put the current block into the queue of blocks to be read as a block to be read, start scanning a new block, and after marking the new block as the current block, proceed to step S6 for processing; If the length of the current block is less than the preset block division threshold, directly proceed to step S6 for processing; Step S5: Determine the subsequent processing method according to the subtype of the current record: Method 1): If the current record is a compressed block (CBlock), determine whether the length before compression of the current record is greater than or equal to the preset block division threshold: If so, end the scanning of the current block, put the current block into the queue of blocks to be read as a block to be read, put the current record into the queue of blocks to be divided and compressed (block to be divided CBlock) as a block to be divided and compressed, start scanning a new block, and after marking the new block as the current block, proceed to step S6 for processing; If not, incorporate the current record into the current block and update the length of the current block: If the length of the current block is greater than or equal to the preset block division threshold, end the scanning of the current block, put the current block into the queue of blocks to be read as a block to be read, start scanning a new block, and after marking the new block as the current block, proceed to step S6 for processing; if the length of the current block is less than the preset block division threshold, directly proceed to step S6 for processing; Method 2): If the current record is in relative coordinate mode (XYRELATIVE), incorporate the current record into the current block, continue scanning the next record and incorporate the next record into the current block until the next record is in absolute coordinate mode (XYABSOLUTE) or a record indicating the end of the structure (Cell); If the next record is in the absolute coordinate mode (XYABSOLUTE), the scanning of the current block is ended, the current block is placed into the queue of blocks to be read as a block to be read, the scanning of a new block is started, the new block is marked as the current block, and after the record in the absolute coordinate mode is marked as the current record, the process proceeds to step S2 for processing; If the next record is a record indicating the end of a representation structure (Cell), the record indicating the end of the representation structure is classified into the current block, the scanning of the current block is ended, the current block is placed into the queue of blocks to be read as a block to be read, the scanning of a new block is started, and after the new block is marked as the current block, the process proceeds to step S6 for processing; Step S6: Determine whether the scanning of all records in the layout file has been completed: If the scanning of all records in the layout file has been completed, determine whether there are any records classified into the current block: If there are, the current block is placed into the queue of blocks to be read as a block to be read, and the block processing of the layout file is completed; If not, the block processing of the layout file is directly completed; If the scanning of all records in the layout file has not been completed, continue to scan the next record, mark the next record as the new current record, and then the process proceeds to step S2 for processing.
[0047] Specifically, during block division, starting from the first byte of the OASIS file, each record is scanned one by one, and corresponding judgments are made only based on the current record type without saving layout data, so as to achieve the fastest possible scanning speed. During the block processing stage, a queue of blocks to be read containing NameString blocks and Cell blocks and a queue of blocks to be divided containing overly long CBlocks will be obtained.
[0048] In this embodiment, post-processing is performed on the data of all blocks to be read obtained, and the reading of the layout file is completed, including: merging the data of the structures (Cells, also known as Structures or LibraryElements) read in multiple blocks to be read to form a complete structure.
[0049] Specifically, in the post-processing stage, if a structure is divided into multiple blocks for reading, these blocks need to be merged to form a complete structure.
[0050] Based on the same inventive concept, the embodiments of the present application also provide a layout file multi-threaded reading device for implementing the above-mentioned layout file multi-threaded reading method. The implementation solutions provided by this device to solve problems are similar to the implementation solutions described in the above method. Therefore, the specific limitations in one or more embodiments of the layout file multi-threaded reading device provided below can refer to the limitations on the layout file multi-threaded reading method in the above text, and will not be elaborated here.
[0051] In one embodiment, a multi-threaded layout file reading device is provided, including: a chunking module, a reading module, and a post-processing module, where: The chunking module is configured to perform chunking processing on the layout file based on the record information to obtain chunks to be read and put them into the queue to be read, and obtain chunks to be chunked and compressed and put them into the queue to be chunked; the layout file includes multiple records; and, when it is monitored that there are chunks to be chunked and compressed in the queue to be chunked and there are available idle threads, it is configured to allocate threads to perform decompression and chunking processing on the chunks to be chunked and compressed; The reading module is configured to, when it is monitored that there are chunks to be read in the queue to be read and there are available idle threads, allocate threads to perform reading processing on the chunks to be read and obtain the data of the chunks to be read; The post-processing module is configured to perform post-processing on the data of all the chunks to be read obtained, and complete the reading of the layout file.
[0052] Each functional module of the multi-threaded layout file reading device implements the steps in the above embodiments of the multi-threaded layout file reading method.
[0053] Each module in the above multi-threaded layout file reading device can be implemented in whole or in part by software, hardware, and their combination. The above modules can be embedded in the processor of the computer device in hardware form or be independent of it, or can be stored in the memory of the computer device in software form, so that the processor can call and execute the operations corresponding to the above respective modules.
[0054] In one embodiment, a computer device is provided. The computer device can be a terminal, and its internal structure diagram can be as Figure 2As shown in the figure. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit, and an input device. Among them, the processor, the memory, and the input / output interface are connected through a system bus, and the communication interface, the display unit, and the input device are connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and external devices. The communication interface of the computer device is used to communicate with external terminals in a wired or wireless manner, and the wireless manner can be achieved through WIFI, a mobile cellular network, NFC (Near Field Communication), or other technologies. When the computer program is executed by the processor, it implements a method for multi-threaded reading of layout files. The display unit of the computer device is used to form a visually visible picture, which can be a display screen, a projection device, or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen. The input device of the computer device can be a touch layer covering the display screen, or a button, a trackball, or a touchpad provided on the housing of the computer device, or an external keyboard, touchpad, or mouse, etc.
[0055] Those skilled in the art can understand that Figure 2 the structure shown in the figure is only a block diagram of some structures related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine some components, or have different component arrangements.
[0056] In one embodiment, a computer device is further provided, including a memory and a processor. A computer program is stored in the memory, and when the processor executes the computer program, the steps in the above-mentioned embodiments of the multi-threaded reading method for layout files are implemented.
[0057] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by the processor, the steps in the above-mentioned embodiments of the multi-threaded reading method for layout files are implemented.
[0058] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above methods. Among them, any reference to a memory, database, or other medium used in the embodiments provided in this application can include at least one of non-volatile and volatile memories. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc. The databases involved in the embodiments provided in this application can include at least one of relational databases and non-relational databases. Non-relational databases can include distributed databases based on blockchain, etc., without limitation. The processors involved in the embodiments provided in this application can be general-purpose processors, central processing units, graphics processors, digital signal processors, programmable logic devices, data processing logics based on quantum computing, etc., without limitation.
[0059] It should be understood that although the steps in the flowcharts involved in the above embodiments are shown in sequence according to the arrows, these steps do not necessarily need to be executed in the order indicated by the arrows. Unless there is a clear indication in this article, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, at least some of the steps in the flowcharts involved in the above embodiments can include multiple steps or multiple stages. These steps or stages do not necessarily need to be executed at the same time, but can be executed at different times. The execution order of these steps or stages does not necessarily need to be sequential, but can be executed alternately or in turn with at least some of the steps or stages in other steps or other steps.
[0060] In the description of this specification, the descriptions referring to terms such as "some embodiments", "other embodiments", "ideal embodiments", etc. mean that the specific features, structures, materials or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic descriptions of the above terms do not necessarily refer to the same embodiment or example.
[0061] The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity of description, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered as the scope described in this specification.
[0062] The above-described embodiments merely represent several implementation manners of the present application. The description is relatively specific and detailed, but it should not be construed as a limitation on the patent scope of the present application. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present application, several modifications and improvements can still be made, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the appended claims.
Claims
1. A method for multi-threaded reading of layout files, characterized in that, Including: The layout file includes multiple records; Based on the record information, perform block processing on the layout file to obtain blocks to be read and put them into the queue to be read, and obtain blocks to be block-compressed and put them into the queue to be block-compressed; When it is monitored that there are blocks to be block-compressed in the queue to be block-compressed and there are available idle threads, allocate a thread to perform decompression and block processing on the blocks to be block-compressed; When it is monitored that there are blocks to be read in the queue to be read and there are available idle threads, allocate a thread to perform reading processing on the blocks to be read to obtain the data of the blocks to be read; Perform post-processing on the data of all obtained blocks to be read to complete the reading of the layout file.
2. The method for multi-threaded reading of layout files according to claim 1, wherein The block processing includes: Based on the record information and a preset block threshold, divide the multiple records of the layout file into multiple blocks to be read and multiple blocks to be block-compressed; or, based on the record information and a preset block threshold, divide the decompressed blocks to be block-compressed into multiple blocks to be read; wherein, the record information includes record length and record type.
3. The method for multi-threaded reading of layout files according to claim 2, wherein The block processing further includes: Distinguish the record types of the records, and records of different record types are divided into different blocks to be read; Among them, the record types include a first type and a second type; The first type is a record type used to define names, text information, and strings; The second type is a record type used to define graphic elements or structures.
4. The method for multi-threaded reading of layout files according to claim 3, wherein Among the records of the second type, there is also a subtype: compressed block; During the block processing, the blocks to be block-compressed put into the queue to be block-compressed are compressed blocks whose length before compression is greater than or equal to the block threshold.
5. The method for multi-threaded reading of layout files according to claim 3, characterized in that, Among the records of the second type, there is also a subtype: relative coordinate mode; During the block processing, multiple records of relative coordinate mode belonging to the same structure in the layout file are divided into the same block to be read.
6. The method for multi-threaded reading of layout files according to claim 1, characterized in that Support multi-thread parallel processing for reading the layout file, and the threads include: A monitoring thread, which is used to monitor whether there are blocks to be read in the queue to be read and allocate processing, and is used to monitor whether there are blocks to be block-compressed in the queue to be block-compressed and allocate processing; A block thread, which is used to perform block processing on the layout file, and is used to obtain the blocks to be block-compressed in the queue to be block-compressed and perform decompression and block processing; A reading thread, which is used to obtain the blocks to be read in the queue to be read and perform reading.
7. The method for multi-threaded reading of layout files according to claim 6, wherein After the block thread performs decompression and block processing on the blocks to be block-compressed, insert the obtained blocks to be read into the end of the queue to be read, and perform locking control during insertion.
8. The method for multi-threaded reading of layout files according to claim 1, characterized in that A modal variable mechanism is set in the layout file; When the allocation thread performs reading processing on the blocks to be read to obtain the data of the blocks to be read, it further includes: making default marks on the values of the modal variables in the read data; When performing post-processing on the data of all obtained blocks to be read, it further includes: using the current modal variable updated with the data read from the previous block to be read to complete the complement processing on the data with default marks read from the current block to be read.
9. The method for multi-threaded reading of layout files according to claim 8, wherein The step of using the modal variable updated with the data read from the previous block to be read to complete the processing of the data with default tags read from the current block to be read specifically includes the following steps: Successively obtain the data read from the block to be read, denoted as the current data; determine whether there is a default tag in the current data: if there is no default tag, the current data is complete data and does not need to be completed, and obtain the value of the modal variable in the current data, denoted as the current modal variable; if there is a default tag, use the current modal variable to complete the current data, and obtain the value of the modal variable in the current data to complete and / or update the current modal variable; Until the processing of all the read data is completed.
10. The method for multi-threaded reading of layout files according to claim 1, wherein The post-processing of the data of all the blocks to be read obtained to complete the reading of the layout file includes: Merge the structural data read in multiple blocks to be read to form a complete structure.
11. A multi-threaded reading device for layout files, characterized in that The device includes: A block division module, configured to perform block division processing on the layout file based on the recorded information, obtain the blocks to be read and put them into the queue to be read, and obtain the blocks to be compressed and divided and put them into the queue to be divided and compressed; the layout file includes multiple records; and, when it is monitored that there are blocks to be compressed and divided in the queue to be divided and compressed and there are available idle threads, allocate a thread to perform decompression and block division processing on the blocks to be compressed and divided; A reading module, configured to, when it is monitored that there are blocks to be read in the queue to be read and there are available idle threads, allocate a thread to perform reading processing on the blocks to be read to obtain the data of the blocks to be read; A post-processing module, configured to perform post-processing on the data of all the blocks to be read obtained to complete the reading of the layout file.
12. A computer device, comprising a memory and a processor, the memory storing a computer program, characterized in that, When the processor executes the computer program, the steps of the layout file multi-threaded reading method according to any one of claims 1 to 10 are implemented.
13. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, the steps of the layout file multi-threaded reading method according to any one of claims 1 to 10 are implemented.
Citation Information
Patent Citations
Chip layout data processing method and device
CN117576249A
Chip layout cloud parallel rendering and rendering data scheduling method and device and cloud
CN118428288A
Method and system for rapidly analyzing compressed file content
CN119336718A
Method and device for processing layout
CN119514465A
Intellectual property block validation and design integration for integrated circuits
US10922462B1
Cited By
Distributed layout information reading method and system, storage medium and electronic equipment
CN121257459A
