A layout file multi-threaded reading method, device, equipment and storage medium
Through the multi-threaded reading method and modal variable mechanism, the problem of slow layout file reading in the traditional single-threaded mode is solved, and the layout file reading with efficient utilization of multi-core processor resources is realized, thereby improving the development efficiency of semiconductor design.
Patent Information
- Application Number
- CN202510783038.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-12
- Publication Date
- 2025-09-30
- Estimated Expiration
- 2045-06-12
AI Technical Summary
In the traditional single-threaded mode, the layout file reading speed is slow and the multi-core processor resources cannot be fully utilized, resulting in a long file loading time and affecting the efficiency of semiconductor design and development.
A multi-threaded reading method is adopted. Through block processing and multi-threaded parallel computing, the performance of multi-core processors is utilized to allocate threads to decompress and read the blocks to be read and the compressed blocks to be divided and divided. The modal variable mechanism is combined for data completion to achieve efficient reading of layout files.
It greatly improves the reading speed of layout files, fully utilizes multi-core processor resources, and provides more efficient file loading and operation solutions.
Smart Images

Figure CN120315896B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of integrated circuit design and manufacturing, and in particular relates to a multi-threaded reading method, device, equipment and storage medium for layout files. Background Art
[0002] With the continuous shrinking of process nodes and the increasing complexity of designs, layout files in modern chip designs are growing in size. A single layout file can easily reach tens or even hundreds of GB in size, posing a severe challenge to file reading speed and processing efficiency. Traditional single-threaded reading modes struggle to open files quickly, increasingly unable to meet today's demands for fast processing and real-time verification.
[0003] GDSII and OASIS are two important layout file formats in the semiconductor design field. OASIS (OpenArtwork System Interchange Standard) emerged as a more efficient alternative to GDSII with the continuous advancement of semiconductor technology, capable of handling more complex and sophisticated chip designs. OASIS files describe layout information through a series of records, each with a specific purpose.
[0004] Currently, in semiconductor design, layout files are primarily read using a single-threaded approach. This traditional approach provides relatively stable performance when file sizes are small, but as process nodes shrink and design complexity increases, layout file sizes gradually increase, and the limitations of this single-threaded approach become increasingly apparent.
[0005] The single-threaded reading method has the following main shortcomings: 1) It has a significant performance bottleneck. The speed of reading files is limited by the computing power of a single CPU core. When faced with extremely large files of tens or even hundreds of GB, the processing speed is too slow, resulting in excessively long file loading times, which affects the development efficiency of the design team; 2) It cannot fully utilize processor resources. Most modern processors are equipped with multi-core architectures, but the single-threaded reading mode cannot effectively schedule these resources, resulting in wasted hardware performance.
[0006] Therefore, in order to adapt to the growing demand for layout file reading, especially OASIS format layout files, there is an urgent need for a reading method that can improve the layout file reading speed and reduce the layout file reading time, thereby providing a more efficient solution for file loading and operation in semiconductor design. Summary of the Invention
[0007] In order to solve all or part of the problems of the above-mentioned prior art, the present invention provides a multi-threaded layout file reading method, device, computer equipment and computer-readable storage medium that can greatly improve the layout file reading speed.
[0008] In a first aspect, a multi-threaded reading method for a layout file is provided in this embodiment, comprising:
[0009] The layout file includes a plurality of records;
[0010] The layout file is divided into blocks based on the record information to obtain blocks to be read and put them into a queue to be read, and to obtain compressed blocks to be divided and put them into a queue to be divided;
[0011] When it is detected that there are compressed blocks to be divided in the queue to be divided and there are idle threads to be allocated, the allocated thread decompresses and divides the compressed blocks to be divided into blocks;
[0012] When it is detected that there is a block to be read in the queue to be read and there is an idle thread that can be allocated, the allocated thread reads the block to be read to obtain data of the block to be read;
[0013] Post-processing is performed on the acquired data of all blocks to be read to complete the reading of the layout file.
[0014] In some embodiments, the block processing includes:
[0015] Based on the record information and the preset block threshold, the multiple records of the layout file are divided into multiple blocks to be read and multiple compressed blocks to be divided; or, based on the record information and the preset block threshold, the decompressed compressed blocks to be divided are divided into multiple blocks to be read; wherein the record information includes the record length and the record type.
[0016] In some embodiments, the block processing further includes:
[0017] Distinguishing record types of the records, and dividing records of different record types into different blocks to be read;
[0018] Wherein, the record type includes a first type and a second type;
[0019] The first type is a record type used to define a name, text information, or a string of characters;
[0020] The second type is a record type used to define pixels or structures.
[0021] In some of these embodiments, the second type of record further includes subtypes: compressed block;
[0022] During the block processing, the compressed blocks to be segmented and put into the segmentation queue are compressed blocks whose length before compression is greater than or equal to the segmentation threshold.
[0023] In some of these embodiments, the second type of record further includes subtypes: relative coordinate mode;
[0024] During the block processing, multiple relative coordinate mode records belonging to the same structure in the layout file are divided into the same block to be read.
[0025] In some embodiments, the layout file multi-threaded reading method supports multi-threaded parallel processing of layout file reading, and the threads include:
[0026] A monitoring thread is used to monitor whether there are blocks to be read in the queue to be read and allocate them for processing, and to monitor whether there are blocks to be divided and compressed in the queue to be divided and allocate them for processing;
[0027] The block thread is used to process the layout file in blocks, and to obtain the compressed blocks to be divided in the queue for decompression and block processing;
[0028] The reading thread is used to obtain the blocks to be read in the waiting-to-read queue for reading.
[0029] In some embodiments, after decompressing and dividing the compressed block to be divided, the block thread inserts the obtained block to be read into the tail of the queue to be read and performs locking control during the insertion.
[0030] In some of the embodiments, a modal variable mechanism is provided in the layout file;
[0031] The allocation thread performs a read process on the block to be read to obtain data of the block to be read, and further comprises: marking a value of a modal variable in the read data as a default;
[0032] The post-processing of the acquired data of all the blocks to be read further includes: using the current modal variable updated by the data read from the previous block to be read to complete the default marked data read from the current block to be read.
[0033] In some embodiments, the method of using the modal variable updated by the data read from the previous block to be read to complete the default-marked data read from the current block to be read specifically includes the steps of:
[0034] Sequentially obtain the data read from the block to be read and record it 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 completed, and obtain the value of the modal variable in the current data and record it as the current modal variable; if there is a default mark, 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;
[0035] Until all read data is completed.
[0036] In some embodiments, the post-processing of the acquired data of all blocks to be read to complete the reading of the layout file includes:
[0037] The structure data divided into multiple blocks to be read are merged to form a complete structure.
[0038] In a second aspect, a multi-threaded layout file reading device is provided in this embodiment, the device comprising:
[0039] a block division module for performing block processing on the layout file based on the record information, obtaining blocks to be read and placing them in a queue to be read, and obtaining compressed blocks to be divided and placing them in a queue to be divided; the layout file includes a plurality of records; and, when detecting that there are compressed blocks to be divided in the queue to be divided and there are idle threads available to be allocated, assigning a thread to decompress and divide the compressed blocks to be divided;
[0040] The reading module is configured to, when it is detected that there is a block to be read in the queue to be read and there is an idle thread to be allocated, allocate a thread to read the block to obtain data of the block to be read;
[0041] The post-processing module is used to post-process the acquired data of all blocks to be read to complete the reading of the layout file.
[0042] In a third aspect, a computer device is provided in this embodiment, comprising a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps of the multi-threaded reading method of the layout file described in the first aspect are implemented.
[0043] In a fourth aspect, a computer-readable storage medium is provided in this embodiment, on which a computer program is stored. When the computer program is executed by a processor, the steps of the multi-threaded layout file reading method described in the first aspect are implemented.
[0044] The above-described multi-threaded layout file reading method, through block processing and support for multi-threaded parallel computing, fully utilizes the performance of multi-core processors, significantly improving the layout file reading speed and providing a more efficient solution for file loading and manipulation in semiconductor design. Furthermore, a multi-threaded layout file reading device, a computer device, and a computer-readable storage medium are provided, each of which has the performance and beneficial effects of the above-described multi-threaded layout file reading method. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the conventional technology, the following briefly introduces the drawings required for use in the embodiments or the conventional technology descriptions. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0046] Figure 1 A schematic flow chart of a multi-threaded layout file reading method according to an embodiment;
[0047] Figure 2 FIG. 1 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0048] To facilitate understanding of the present application, the present application will be described more fully below with reference to the accompanying drawings. The accompanying drawings provide embodiments of the present application. However, the present application may be implemented in many different forms and is not limited to the embodiments described herein. Rather, these embodiments are provided to make the disclosure of the present application more thorough and comprehensive.
[0049] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application pertains. The terms used herein in the specification of this application are for the purpose of describing specific embodiments only and are not intended to limit this application.
[0050] It should also be understood that the terms "include / comprising" or "having" etc. specify the presence of stated features, integers, steps, operations, components, parts or combinations thereof, but do not exclude the possibility of the presence or addition of one or more other features, integers, 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 relevant listed items.
[0051] In order to improve the reading speed of the layout file in OASIS format, this embodiment provides a method as follows: Figure 1 The multi-threaded layout file reading method shown includes:
[0052] The layout file includes multiple records;
[0053] The layout file is divided into blocks based on the record information, and blocks to be read are obtained and put into a queue to be read, and compressed blocks to be divided are obtained and put into a queue to be divided;
[0054] When it is detected that there are compressed blocks to be divided in the queue to be divided and there are idle threads to be allocated, the allocated thread decompresses and divides the compressed blocks to be divided into blocks;
[0055] When it is detected that there is a block to be read in the queue to be read and there is an idle thread that can be allocated, the thread is allocated to read the block to be read and obtain the data of the block to be read;
[0056] Post-processing is performed on the acquired data of all blocks to be read to complete the reading of the layout file.
[0057] Specifically, the above-mentioned multi-threaded reading method of the layout file mainly includes three main processing stages: block processing, reading processing and post-processing. The first is block processing. Because the layout file is composed of continuous records, and the record length is uncertain, the blocks must be scanned record by record to obtain the position of the specific record, and then the appropriate position is selected as the segmentation point of the block, 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 assigned to each block for reading to obtain the block data. After completing the reading of all blocks, the post-processing stage is entered to aggregate and merge the information of each block to obtain the complete layout information and complete the reading. This method fully utilizes the performance of multi-core processors through block processing and support for 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.
[0058] In this embodiment, block processing includes: dividing multiple records of a layout file into multiple blocks to be read based on record information and a preset block threshold; or dividing a decompressed compressed block to be divided into multiple blocks to be read based on record information and a preset block threshold; wherein the record information includes record length and record type. The preset block threshold is used to set the length of the block to be read, thereby adjusting the time it takes for subsequent read threads to read a block to be read. In specific applications, the block threshold can be set based on the performance of the multi-core processor and the current application scenario requirements, and the layout file can be divided into blocks based on the record information.
[0059] In this embodiment, the block processing further includes: distinguishing the record types of the records, and dividing the records of different record types into different blocks to be read;
[0060] Among them, the record type includes the first type (NameString type) and the 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 pixels or structures;
[0061] The types of blocks include a first type (NameString type) and a second type (Cell type).
[0062] OASIS files use numbers to represent some strings, thereby reducing the space overhead caused by the repeated use of these strings. Therefore, there are some records used to record the correspondence between strings and numbers. These records are generally in the front and back sections of the file, but may also appear between structures. During block processing, the locations of these records are found and recorded as blocks of the first type (NameString type), to distinguish them from blocks of the second type (Cell type). They are also placed in the waiting queue to wait for processing by the reading thread.
[0063] That is, the record types of OASIS files can be divided into NameString type and Cell type.
[0064] Commonly used 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 a property; PROPSTRING record, used to define the string in the property value; LAYERNAME record, used to specify the name of a layer in the design; XNAME record, used to provide an extended name for an element in the design.
[0065] Commonly used 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 graphic or structure in the design; TEXT, a record used to represent text strings or text information; RECTANGLE, a record used to describe a simple rectangular area; POLYGON, a record used to represent polygonal graphics; PATH, a record used to represent path graphics.
[0066] In this embodiment, the second type of record further includes subtypes: compressed block (CBlock);
[0067] During the block processing, the compressed block to be segmented and put into the segmentation queue is a compressed block whose length before compression is greater than or equal to the segmentation threshold.
[0068] OASIS files contain a special record type called CBlock (a subtype of the second type). CBlocks include information such as pre-compression length and post-compression length. When a CBlock is encountered during scanning, CBlocks with pre-compression lengths greater than the chunking threshold are placed in a queue as blocks to be chunked. Subsequently, dedicated threads are assigned to decompress and chunk the chunks in the queue, and the chunked blocks are also placed in the queue.
[0069] In this embodiment, the above-mentioned multi-threaded layout file reading method supports multi-threaded parallel processing of layout file reading, and the threads include:
[0070] A monitoring thread is used to monitor whether there are blocks to be read in the queue to be read and allocate them for processing, and to monitor whether there are blocks to be divided and compressed in the queue to be divided and allocate them for processing;
[0071] The block thread is used to process the layout file in blocks, and to obtain the compressed blocks to be divided in the queue for decompression and block processing;
[0072] The reading thread is used to obtain the blocks to be read in the waiting-to-read queue for reading.
[0073] Specifically, the parallel reading and block processing of the blocks to be read are carried out simultaneously. During the block processing by the block thread, the monitoring thread has been monitoring the queue to be read and the queue to be blocked. When the monitoring thread detects that there is a new block to be read in the queue to be read, or a new compressed block to be blocked, if there is an idle working thread, a reading thread is assigned to it to read the new block to be read, or a blocking thread is assigned to decompress and block the compressed block to be blocked. Through such multi-threaded parallel processing, idle multi-core architecture processor resources are fully utilized, which can greatly improve the layout reading speed when facing ultra-large layout files of tens of GB or even hundreds of GB.
[0074] In this embodiment, after decompressing and dividing the compressed block to be divided, the block thread inserts the obtained block to be read into the end of the queue to be read, and performs locking control during insertion to avoid conflicts caused by multiple block threads inserting the block to be read into the queue to be read at the same time.
[0075] In this embodiment, a modal variable (ModalVariable) mechanism is set in the layout file;
[0076] Assigning a thread to read the block to be read to obtain data of the block to be read, further comprising: marking the value of the modal variable in the read data as a default;
[0077] When post-processing the acquired data of all the blocks to be read, the method further includes: using the current modal variable updated by the data read from the previous block to be read to complete the default marked data read from the current block to be read.
[0078] The data completion in post-processing specifically includes the following steps: sequentially obtaining the data read from the block to be read and recording it 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 obtaining the value of the modal variable in the current data and recording it as the current modal variable; if there is a default mark, completing the current data using the current modal variable, and obtaining the value of the modal variable in the current data to complete and / or update the current modal variable; until the completion processing of all read data is completed.
[0079] OASIS files use the ModalVariable mechanism, a technique used to reduce redundant data and improve file compression efficiency. By using ModalVariables, OASIS files can more compactly represent recurring values. For example, the ModalVariable mechanism allows default values to be set for certain fields in OASIS files. In a record, if the value of a field is the same as the last value used, the field can be omitted, reducing data redundancy. ModalVariables are typically used for frequently repeated fields such as coordinates, layer numbers, and data types, to avoid storing the same value repeatedly in each record.
[0080] In the ModalVariable mechanism, subsequent records may depend on data in previous records. This results in that if a structure (Cell, also called Structure or Library Element) is divided into multiple blocks for reading, the data between blocks cannot be communicated during parallel reading, and the data dependency relationship cannot be established normally. Some data items cannot obtain values. During reading, this part of the data must be set to the default state and completed in the post-processing stage. To achieve this, the final ModalVariable obtained for each block must be saved to complete the data of the file block after the current block.
[0081] It should be noted that when the specific steps of data completion are executed, it starts from the data read from the first block to be read. Since there is no 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.
[0082] In this embodiment, the second type of record further includes subtypes: relative coordinate mode (XYRELATIVE);
[0083] During block processing, multiple XYRELATIVE records belonging to the same structure in the layout file are grouped into the same block to be read. A ModalVariable field is used to set whether the current element coordinates are in absolute or relative mode. Records of the same structure in the relative mode range cannot be read in multiple blocks.
[0084] The following is a specific application example to illustrate the block processing of OASIS files. Figure 1 As shown, the specific steps include:
[0085] Step S1: obtaining a record of the layout file and scanning it; recording the currently scanned record as the current record, and the currently scanned block as the current block;
[0086] Step S2: Get the record type of the current record and determine whether the current block has been marked with the type:
[0087] If it is 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, go directly to step S3; if they are not the same, end the scanning of the current block, put the current block into the queue to be read as the block to be read, start scanning the next new block, and mark the new block as the current block, and go to step S3;
[0088] If not marked, the current block is marked as the same type as the current record, and the process goes to step S3;
[0089] Step S3: Determine the subsequent processing method based on the record type of the current record:
[0090] If the current record is of the first type (NameString type), proceed to step S4;
[0091] If the current record is the second type (Cell type), proceed to step S5;
[0092] Step S4: Divide the current record into the current block and update the length of the current block:
[0093] If the length of the current block is greater than or equal to the preset block threshold, the scanning of the current block is terminated, the current block is placed in the queue as a block to be read, the scanning of the next new block is started, and the new block is recorded as the current block, and the process goes to step S6;
[0094] If the length of the current block is less than the preset block threshold, go directly to step S6;
[0095] Step S5: Determine the subsequent processing method based on the subtype of the current record:
[0096] Method 1): If the current record is a compressed block (CBlock), determine whether the length of the current record before compression is greater than or equal to the preset block threshold:
[0097] If so, the scanning of the current block is terminated, the current block is placed in the queue as a block to be read, the current record is placed in the queue as a compressed block to be divided (CBlock to be divided) and the scanning of the next new block is started. The new block is recorded as the current block and the process goes to step S6.
[0098] If not, the current record is divided into the current block and the length of the current block is updated. If the length of the current block is greater than or equal to the preset block threshold, the scanning of the current block is terminated, the current block is placed in the queue as the block to be read, the scanning of the next new block is started, and the new block is recorded as the current block, and the process goes to step S6. If the length of the current block is less than the preset block threshold, the process goes directly to step S6.
[0099] Method 2): If the current record is in relative coordinate mode (XYRELATIVE), the current record is divided into the current block, and the next record is scanned and divided into the current block until the next record is in absolute coordinate mode (XYABSOLUTE) or indicates the end of the structure (Cell):
[0100] If the next record is in absolute coordinate mode (XYABSOLUTE), the scanning of the current block is terminated, the current block is placed in the queue as a block to be read, the scanning of the next new block is started, and the new block is recorded as the current block. After the record in absolute coordinate mode is recorded as the current record, the process goes to step S2;
[0101] If the next record is a record indicating the end of the structure (Cell), the record indicating the end of the structure is added to the current block, the scanning of the current block is ended, the current block is placed in the queue as a block to be read, the scanning of the next new block is started, and the new block is recorded as the current block, and the process goes to step S6;
[0102] Step S6: Determine whether scanning of all records in the layout file has been completed:
[0103] If all records in the layout file have been scanned, determine whether there are records in the current block: if so, put the current block into the queue as a block to be read, and complete the block processing of the layout file; if not, directly complete the block processing of the layout file;
[0104] If the scanning of all records in the layout file is not completed, the next record will be scanned continuously, and the next record will be recorded as the new current record before proceeding to step S2.
[0105] Specifically, during block processing, we scan each record starting from the first byte of the OASIS file, making decisions based solely on the current record type without saving layout data to achieve the fastest possible scanning speed. During the block processing phase, we obtain a queue of pending reads containing NameString blocks and Cell blocks, as well as a queue of pending blocks containing overly long CBlocks.
[0106] In this embodiment, the acquired data of all blocks to be read are post-processed to complete the reading of the layout file, including: merging the structure (Cell, also called Structure or LibraryElement) data divided into multiple blocks to be read to form a complete structure.
[0107] 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.
[0108] Based on the same inventive concept, the present application also provides a layout file multi-threaded reading device for implementing the aforementioned layout file multi-threaded reading method. The solution provided by this device is similar to the solution described in the aforementioned method. Therefore, the specific limitations of one or more embodiments of the layout file multi-threaded reading device provided below can be found in the above-mentioned limitations of the layout file multi-threaded reading method, and will not be repeated here.
[0109] In one embodiment, a multi-threaded layout file reading device is provided, comprising: a block division module, a reading module, and a post-processing module, wherein:
[0110] a block division module for performing block processing on the layout file based on the record information, obtaining blocks to be read and placing them in a queue to be read, and obtaining compressed blocks to be divided and placing them in a queue to be divided; the layout file includes a plurality of records; and, when detecting that there are compressed blocks to be divided in the queue to be divided and there are idle threads available to be allocated, assigning a thread to decompress and divide the compressed blocks to be divided;
[0111] The reading module is configured to, when detecting that there is a block to be read in the queue to be read and there is an idle thread to be allocated, allocate a thread to read the block to be read and obtain data of the block to be read;
[0112] The post-processing module is used to post-process the data of all blocks to be read and complete the reading of the layout file.
[0113] The functional modules of the layout file multi-threaded reading device implement the steps in the above-mentioned layout file multi-threaded reading method embodiments.
[0114] Each module in the above-mentioned multi-threaded layout file reading device can be implemented in whole or in part through software, hardware, or a combination thereof. Each module can be embedded in or independent of the processor of the computer device in hardware form, or can be stored in the memory of the computer device in software form, so that the processor can call and execute the corresponding operations of each module.
[0115] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Figure 2 As shown. The computer device includes a processor, memory, an input / output interface, a communication interface, a display unit, and an input device. The processor, memory, and input / output interface are connected via a system bus, and the communication interface, display unit, and input device are connected to the system bus via the input / output interface. 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 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 via wired or wireless means, and the wireless means can be achieved via Wi-Fi, mobile cellular networks, NFC (near-field communication), or other technologies. When executed by the processor, the computer program implements a multi-threaded reading method for layout files. The display unit of the computer device is used to produce a visually visible image and 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, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device casing, or an external keyboard, touchpad or mouse.
[0116] Those skilled in the art will understand that Figure 2 The structure shown in the figure is only a block diagram of a part of the structure 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 shown in the figure, or combine certain components, or have a different component arrangement.
[0117] In one embodiment, a computer device is also provided, including a memory and a processor, wherein 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 of the layout file are implemented.
[0118] In one 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 in the above-mentioned embodiments of the multi-threaded reading method of the layout file are implemented.
[0119] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the 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 above-mentioned embodiments. In particular, any reference to memory, database, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. 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), magnetic 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 take various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The databases involved in the various embodiments provided herein may include at least one of a relational database and a non-relational database. Non-relational databases may include, but are not limited to, distributed databases based on blockchains. The processors involved in the various embodiments provided herein may be, but are not limited to, general-purpose processors, central processing units (CPUs), graphics processing units (GPUs), digital signal processors (DSPs), programmable logic devices (PLDs), data processing logic devices based on quantum computing, and the like.
[0120] It should be understood that, although the various steps in the flowcharts involved in the various embodiments described above are displayed in sequence according to the instructions of the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps can be executed in other orders. Moreover, at least a portion of the steps in the flowcharts involved in the various embodiments described above can include multiple steps or multiple stages, and these steps or stages are not necessarily executed and completed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a portion of steps or stages in other steps.
[0121] Throughout this specification, references to terms such as "some embodiments," "other embodiments," and "desired embodiments" indicate that a particular feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the present application. The schematic descriptions of these terms throughout this specification do not necessarily refer to the same embodiment or example.
[0122] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, 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, they should be considered to be within the scope of this specification.
[0123] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present application. It should be noted that a person of ordinary skill in the art may make various modifications and improvements without departing from the spirit of the present application, and these modifications and improvements fall within the scope of protection of the present application. Therefore, the scope of protection of the present application shall be determined by the appended claims.
Claims
1. A multi-threaded reading method for layout files, characterized in that: include: The layout file is an OASIS format layout file, and the layout file includes multiple records; The layout file is divided into blocks based on the record information to obtain blocks to be read and place them in a queue to be read, and the compressed blocks to be divided into blocks and place them in a queue to be divided into blocks; wherein the block processing includes: dividing multiple records of the layout file into multiple blocks to be read and multiple compressed blocks to be divided into blocks based on the record information and a preset block threshold; or dividing the decompressed compressed blocks to be divided into multiple blocks to be read based on the record information and a preset block threshold; When it is detected that there are compressed blocks to be divided in the queue to be divided and there are idle threads that can be allocated, the allocated thread decompresses and divides the compressed blocks to be divided into blocks; When it is detected that there is a block to be read in the queue to be read and there is an idle thread that can be allocated, the allocated thread reads the block to be read to obtain data of the block to be read; Post-processing the acquired data of all blocks to be read to complete the reading of the layout file; The layout file includes a modal variable mechanism; the allocation thread reads the block to be read to obtain data of the block to be read, further comprising: marking the value of the modal variable in the read data as default; and the post-processing of the acquired data of all blocks to be read further comprises: using the current modal variable updated by the data read from the previous block to be read to complete the default-marked data read from the current block to be read; The multi-threaded layout file reading method supports multi-threaded parallel processing of layout file reading, and the threads include: A monitoring thread is used to monitor whether there are blocks to be read in the queue to be read and allocate them for processing, and to monitor whether there are blocks to be divided and compressed in the queue to be divided and allocate them for processing; The block thread is used to process the layout file in blocks, and to obtain the compressed blocks to be divided in the queue for decompression and block processing; The reading thread is used to obtain the blocks to be read in the waiting-to-read queue for reading.
2. The multi-threaded layout file reading method according to claim 1, characterized in that: The record information includes record length and record type.
3. The multi-threaded reading method of layout file according to claim 2, characterized in that: The block processing further includes: Distinguishing record types of the records, and dividing records of different record types into different blocks to be read; Wherein, the record type includes a first type and a second type; The first type is a record type used to define a name, text information, or a string of characters; The second type is a record type used to define pixels or structures.
4. The multi-threaded reading method of layout file according to claim 3, characterized in that: The second type of record further includes subtypes: compressed block; During the block processing, the compressed blocks to be segmented and put into the segmentation queue are compressed blocks whose length before compression is greater than or equal to the segmentation threshold.
5. The multi-threaded reading method of layout file according to claim 3, characterized in that: The second type of record further includes subtypes: relative coordinate mode; During the block processing, multiple relative coordinate mode records belonging to the same structure in the layout file are divided into the same block to be read.
6. The multi-threaded reading method of layout file according to claim 1, characterized in that: After decompressing and dividing the compressed block to be divided, the block thread inserts the obtained block to be read into the tail of the queue to be read and performs locking control during the insertion.
7. The multi-threaded layout file reading method according to claim 1, characterized in that: The method of using the modal variable updated by the data read from the previous block to be read to complete the default-marked data read from the current block to be read specifically includes the following steps: Sequentially obtain the data read from the block to be read and record it 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 completed, and obtain the value of the modal variable in the current data and record it as the current modal variable; if there is a default mark, 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 all read data is completed.
8. The multi-threaded reading method of layout file according to claim 1, characterized in that: The post-processing of the acquired data of all blocks to be read to complete the reading of the layout file includes: The structure data divided into multiple blocks to be read are merged to form a complete structure.
9. A layout file multi-threaded reading device, characterized in that: The device comprises: The block division module is used to divide the layout file into blocks based on the record information, obtain the blocks to be read and place them in the queue to be read, and obtain the compressed blocks to be divided and place them in the queue to be divided; the layout file is an OASIS format layout file, the layout file includes multiple records, and a modal variable mechanism is set in the layout file; and when it is detected that there are compressed blocks to be divided in the queue to be divided and there are idle threads that can be allocated, the thread is allocated to decompress and divide the compressed blocks to be divided into blocks; wherein the block division includes: based on the record information and a preset block division threshold, dividing the multiple records of the layout file into multiple blocks to be read and multiple compressed blocks to be divided into blocks; or, based on the record information and the preset block division threshold, dividing the decompressed compressed blocks to be divided into multiple blocks to be read; The reading module is configured to, when it is detected that there is a block to be read in the queue to be read and there is an idle thread to be allocated, allocate a thread to read the block to obtain data of the block to be read, and further includes: marking the value of the modal variable in the read data as a default; A post-processing module is used to post-process the data of all blocks to be read, and further includes: using the current modal variable updated by the data read from the previous block to be read to complete the default marked data read from the current block to be read; so as to complete the reading of the layout file; The block module and the reading module support multi-threaded parallel processing of layout file reading, and the threads include: A monitoring thread is used to monitor whether there are blocks to be read in the queue to be read and allocate them for processing, and to monitor whether there are blocks to be divided and compressed in the queue to be divided and allocate them for processing; The block thread is used to process the layout file in blocks, and to obtain the compressed blocks to be divided in the queue for decompression and block processing; The reading thread is used to obtain the blocks to be read in the waiting-to-read queue for reading.
10. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: 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 8 are implemented.
11. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the multi-threaded layout file reading method according to any one of claims 1 to 8 are implemented.
Citation Information
Patent Citations
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
