A large-scale layout pattern drawing method, electronic equipment and storage medium

By employing a multi-threaded parallel drawing method in the layout design of large-scale integrated circuits, the layout area is divided into blocks and independent drawing contexts are created. This solves the problem of slow graphics refresh rate in traditional methods, achieves efficient drawing and optimized resource utilization, and improves user experience.

CN122133586APending Publication Date: 2026-06-02EMPYREAN TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
EMPYREAN TECH CO LTD
Filing Date
2026-02-09
Publication Date
2026-06-02

Smart Images

  • Figure CN122133586A_ABST
    Figure CN122133586A_ABST
Patent Text Reader

Abstract

The application provides a large-scale layout graph drawing method, an electronic device and a storage medium. The method comprises the following steps: taking an intersection area of an outer frame of a layout and a display window of a user view as a drawing area, and uniformly dividing the drawing area into a plurality of subblocks; for each subblock, extracting graph data of all layers of the layout falling within the range of the subblock, and defining a combination of each subblock and each layer as a drawing task unit; creating an independent thread working instance for each drawing task unit, and allocating an independent drawing context; submitting all thread working instances to a thread pool for scheduling and execution, so that each thread working instance completes graph drawing of the corresponding subblock and layer in the independent drawing context; and merging and displaying the drawing results of the thread working instances according to the subblock positions and layer sequences.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of large-scale integrated circuit layout design technology, and in particular to a method for drawing large-scale layout graphics, an electronic device, and a storage medium. Background Technology

[0002] In modern integrated circuit design, electronic design automation (EDA) tools are widely used for layout design and verification. With the continuous advancement of process nodes, the scale of layout design has increased dramatically, with a single layout often containing more than 50 layers and hundreds of millions of graphics. When viewing, editing, or analyzing layouts, especially when performing full-view, zooming, or panning operations, traditional layout drawing methods typically use a single-threaded loop to traverse all layers and graphics sequentially for rendering. This results in a significant decrease in graphics refresh rate, often requiring users to wait tens of seconds or even longer, severely impacting design efficiency and user experience.

[0003] In existing technologies, although some graphics drawing tools have attempted to use simple multi-threading acceleration, they usually only perform coarse-grained division of graphics data and do not combine the layer structure and spatial distribution characteristics of the layout to perform fine-grained task decomposition. This results in uneven thread load, intense resource competition, limited acceleration effect, and difficulty in meeting the real-time display requirements of ultra-large-scale layouts. Summary of the Invention

[0004] To address the shortcomings of existing technologies, the purpose of this application is to provide a method, electronic device, and storage medium for drawing large-scale layout graphics, which can fully utilize the parallel capabilities of multi-core processors to achieve efficient drawing of large-scale layout graphics.

[0005] To achieve the above objectives, this application provides a method for drawing large-scale layout graphics, comprising the following steps: The drawing area is the intersection of the outer border of the map and the display window of the user view, and it is evenly divided into multiple blocks. For each block, extract the graphic data that falls within the range of the block from all layers of the layout, and define the combination of each block and each layer as a drawing task unit; Each drawing task unit is given an independent thread worker instance and an independent drawing context. Submit all thread worker instances to the thread pool for scheduling and execution, so that each thread worker instance can complete the drawing of the corresponding block and layer in an independent drawing context; The drawing results of each thread's working instance are merged and displayed according to the block position and layer order.

[0006] Furthermore, in the step of dividing the intersection area of ​​the outer border of the layout and the display window of the user view into multiple blocks evenly, the boundaries of each block are aligned with the coordinate grid of the layout when dividing the blocks.

[0007] Furthermore, the step of extracting graphic data falling within the scope of the block from all layers of the layout for each block, and defining the combination of each block and each layer as a drawing task unit, further includes: retrieving graphic elements falling within the scope of each block through a spatial index structure.

[0008] Furthermore, in the step of creating an independent thread worker instance and allocating an independent drawing context for each drawing task unit, the independent drawing context includes a bitmap buffer or vector graphics cache, a drawing attribute set for the corresponding layer, a coordinate transformation matrix, and a graphics clipping region set to the corresponding block range.

[0009] Furthermore, the step of submitting all thread worker instances to the thread pool for scheduling and execution, so that each thread worker instance completes the drawing of the corresponding block and layer in an independent drawing context, also includes: adding all thread worker instances to the task waiting queue of the thread pool, and selecting thread worker instances from the task waiting queue for execution.

[0010] Furthermore, the step of merging and displaying the drawing results of each thread's working instance according to the block position and layer order further includes: Write the completed graphics data of each thread's working instance to the shared results queue; The graphic data is extracted from the shared result queue and merged into the global frame buffer according to the block position and layer order. The updated buffer content is then transmitted to the display device.

[0011] To achieve the above objectives, the present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor is configured to execute the computer program stored in the memory to implement the large-scale layout graphics drawing method described above.

[0012] To achieve the above objectives, the present invention also provides a computer-readable storage medium storing a computer program, which is loaded and executed by a processor to implement the large-scale layout graphics drawing method described above.

[0013] The large-scale layout graphics drawing method provided in this application significantly improves the display and refresh efficiency in the large-scale layout graphics drawing process by using multi-threaded parallel drawing with spatial block division and layer separation.

[0014] Other features and advantages of this application will be set forth in the following description, and will be apparent in part from the description, or may be learned by practicing this application. Attached Figure Description

[0015] The accompanying drawings are provided to further illustrate the present application and form part of the specification. They, together with the embodiments of the present application, serve to explain the present application but do not constitute a limitation thereof. In the drawings: Figure 1 This is a flowchart of a large-scale layout graphic drawing method according to an embodiment of this application; Figure 2 This is a schematic diagram of an electronic device structure according to an embodiment of the present invention. Detailed Implementation

[0016] The preferred embodiments of this application are described below with reference to the accompanying drawings. It should be understood that the preferred embodiments described herein are for illustration and explanation only and are not intended to limit this application.

[0017] Embodiments of this application will now be described in more detail with reference to the accompanying drawings. While some embodiments of this application are shown in the drawings, it should be understood that this application can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of this application. It should be understood that the drawings and embodiments of this application are for illustrative purposes only and are not intended to limit the scope of protection of this application.

[0018] The term "comprising" and its variations as used in this application are open-ended, meaning "including but not limited to". The term "based on" means "at least partially based on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Definitions of other terms will be given in the description below.

[0019] It should be noted that the terms "one" and "more" used in this application are illustrative rather than restrictive, and those skilled in the art should understand that, unless explicitly stated otherwise in the context, they should be understood as "one or more". "More" should be understood as two or more.

[0020] Example 1 Figure 1 The following is a flowchart of a large-scale layout graphic drawing method according to an embodiment of this application, which will be referred to below. Figure 1 The specific implementation methods of this application are described in detail.

[0021] First, in step 101: determine the valid drawing area based on the outer border of the layout and the display window of the user view.

[0022] In this embodiment, the outer border information of the layout and the display window information of the user view are first obtained. Through intersection operations, the intersection area of ​​the outer border and the display window is obtained, and this intersection area is the area that actually needs to be drawn. The outer border information is represented by a minimum bounding rectangle area. This information is read from the layout data file (such as GDSII, OASIS, etc. formats) and calculated by traversing the coordinates of all graphics in the layout, represented as the lower left corner coordinates (x_min, y_min) and the upper right corner coordinates (x_max, y_max). Simultaneously, by monitoring the user view state and based on the translation and scaling parameters of the current display window, the rectangular area corresponding to the display window in the layout coordinate system is calculated, denoted as (vx_min, vy_min, vx_max, vy_max). By finding the intersection of the two rectangular areas, if the intersection is not empty, the effective drawing area (the area currently to be drawn) is obtained. The drawing area is also represented by a rectangle, and its coordinate range is: rx_min = max(x_min, vx_min), ry_min = max(y_min, vy_min), rx_max = min(x_max, vx_max), ry_max = min(y_max, vy_max). x_min and y_min represent the lower limit of the X-coordinate and the lower limit of the Y-coordinate of the rectangular area in the layout coordinate system, respectively, and x_max and y_max represent the upper limit of the X-coordinate and the upper limit of the Y-coordinate of the rectangular area in the layout coordinate system, respectively.

[0023] This step ensures that only graphic data within the user's field of view is processed when drawing the layout, avoiding performance loss caused by invalid drawing.

[0024] In step 102: Divide the drawing area into multiple blocks evenly.

[0025] The effective drawing area is uniformly divided into N×M rectangular blocks of equal area along the X and Y axes (N≥1, M≥1). The number of blocks can be preset (e.g., 4 or 16 blocks) or adaptively set according to the number of CPU cores. During division, the boundary of each block is aligned with the coordinate grid of the layout to ensure the consistency of the graphic data division. Each block has a unique number (Block_ID) and records its own coordinate range.

[0026] Step 103: Extract the graphic data falling into each block by layer, and define the combination of each block and each layer as a drawing task unit.

[0027] For each block, all layers of the layout are traversed, and all graphic elements falling within the block's range are quickly retrieved from the layout data index structure. The retrieval process is accelerated using spatial index structures (such as R-trees or quadtrees), extracting only graphic data that intersects with or is contained within the block. The graphic data extracted in this step refers to the original definition data describing the geometry and attributes of the graphics, read from the layout data file, such as vector coordinates, boundaries, and layer attributes.

[0028] Each block and each layer is defined as a drawing task unit; that is, one layer in a block corresponds to one drawing task unit. Each drawing task unit contains a list of all graphic objects in that block within that layer and their attributes (such as coordinates, width, style, etc.); a unique task identifier is generated for each drawing task unit (e.g., Task1(Block_ID records the drawing objects of this drawing task unit).

[0029] In step 104: Create a threaded worker instance for each drawing task unit and assign an independent drawing context.

[0030] In the embodiments of this application, an independent thread worker instance is created for each drawing task unit, and each instance is only responsible for the drawing task of a certain layer in a certain block. When each instance is initialized, an independent drawing context (a logical unit in the drawing software used for graphics generation and management) is allocated. The drawing context includes: a dedicated bitmap buffer or vector graphics cache; the drawing attribute set corresponding to the layer (such as color, line type, fill mode); a coordinate transformation matrix (used to handle view scaling and translation); and a graphics clipping region (set as the range of the block).

[0031] This step ensures that threads do not need to share drawing state, eliminating resource contention and thus achieving true parallel rendering.

[0032] Step 105: Thread pool scheduling and parallel graphics rendering.

[0033] In the embodiments of this application, a thread pool is maintained, the size of which is configurable and preferably set to 1 to 2 times the number of CPU logical cores (e.g., 32 threads). All thread worker instances are added to the task waiting queue of the thread pool, and then the thread worker instances in the task waiting queue are scheduled and executed, so that each thread worker instance completes the graphic drawing of the corresponding block and layer in an independent drawing context.

[0034] Step 106: Incrementally merge and display the graphics drawn by each thread's working instance in real time.

[0035] In the embodiments of this application, each thread worker instance writes its graphics data to a thread-safe shared result queue during and after the drawing process. The graphics data in this step refers to the output result generated after rendering processing by the thread worker instance in its drawing context. The main thread merges and manages the threads to continuously monitor this shared result queue. Whenever a new drawing result is written, it is merged into the global framebuffer according to the block position and layer order.

[0036] In the embodiments of this application, a two-layer buffering mechanism is adopted during merging: one buffer is used for background merging, and the other buffer is used for foreground display. After merging is completed, the updated buffer content is quickly refreshed to the display device through hardware-accelerated bitmap transfer. During the merging process, even if some thread worker instances have not yet completed, the merged parts can be displayed first. This incremental merging and progressive display method allows users to perceive the drawing progress in advance.

[0037] This application employs an incremental merging mechanism, unlike the full merging method which waits for all threads to complete drawing. Incremental merging means that the merging management thread does not wait for all thread worker instances to complete, but instead periodically initiates a merging operation after all completed drawing data from all thread worker instances has been output, updating the corresponding position in the global frame buffer with the newly added graphic data. In this way, the screen content gradually accumulates and refreshes as threads complete, achieving a progressive effect of completing a portion, merging a portion, and displaying a portion, significantly reducing the perceived latency for the user from operation to seeing partial results.

[0038] In step 107: In response to the view operation command, redraw according to the display window of the current view.

[0039] In the embodiments of this application, when the user performs view operations such as zooming or panning, the coordinates of the display window change, and the following redrawing process is immediately triggered: pausing all current drawing threads (if they are being executed); clearing the task queue and result queue; re-executing steps 101 to 106, generating new drawing tasks based on the new view area and submitting them to the thread pool.

[0040] The large-scale layout graphic drawing method of this application has the following beneficial effects: Significantly improve drawing speed: Based on fine-grained task decomposition of region and layer information, multi-threaded parallel drawing is adopted, which reduces the refresh time of large-scale maps from tens of seconds to several seconds, improving efficiency by at least one order of magnitude.

[0041] Optimize resource utilization: By combining block partitioning and independent drawing context, the computing power of multi-core CPUs is fully reused, avoiding thread contention and achieving load balancing and stable acceleration.

[0042] Improved interactive experience: By adopting an incremental merging and display mechanism, the screen can be updated without waiting for all parallel drawing tasks to complete, allowing users to see the real-time refresh of the drawn area before the overall drawing is completed, greatly improving the immediacy of the interaction.

[0043] It combines scalability and accuracy: parameters (such as the number of blocks and the number of threads) can be flexibly configured to adapt to different hardware; through a strict coordinate alignment and merging mechanism, it ensures that the drawing results are completely consistent with the serial output without any loss of precision.

[0044] This method significantly solves the industry problem of lag in large-scale layout interaction, providing an efficient and smooth graphics drawing solution for EDA tools.

[0045] Example 2 In embodiments of the present invention, an electronic device is also provided. Figure 2 This is a schematic diagram of the structure of an electronic device according to an embodiment of the present invention, such as... Figure 2 As shown, the electronic device of the present invention includes a processor 201 and a memory 202, wherein, The memory 202 stores a computer program, which, when read and executed by the processor 201, performs the steps described above in the embodiment of the large-scale layout graphics drawing method.

[0046] Example 3 In embodiments of the present invention, a computer-readable storage medium is also provided, wherein a computer program is stored therein, wherein the computer program is configured to execute the steps described above in the embodiments of the large-scale layout graphics drawing method.

[0047] In this embodiment, the aforementioned computer-readable storage medium may include, but is not limited to, various media capable of storing computer programs, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.

[0048] It will be understood by those skilled in the art that the above descriptions are merely preferred embodiments of this application and are not intended to limit this application. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing embodiments or make equivalent substitutions for some of the technical features. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.

Claims

1. A method for drawing large-scale map graphics, characterized in that, Includes the following steps: The drawing area is the intersection of the outer border of the map and the display window of the user view, and it is evenly divided into multiple blocks. For each block, extract the graphic data that falls within the range of the block from all layers of the layout, and define the combination of each block and each layer as a drawing task unit; Each drawing task unit is given an independent thread worker instance and an independent drawing context. Submit all thread worker instances to the thread pool for scheduling and execution, so that each thread worker instance can complete the drawing of the corresponding block and layer in an independent drawing context; The drawing results of each thread's working instance are merged and displayed according to the block position and layer order.

2. The method for drawing large-scale map graphics according to claim 1, characterized in that, In the step of dividing the area into multiple blocks by using the intersection of the outer border of the layout and the display window of the user view as the drawing area, the boundaries of each block are aligned with the coordinate grid of the layout during the division.

3. The method for drawing large-scale map graphics according to claim 1, characterized in that, The step of extracting graphic data falling within the scope of each block from all layers of the layout and defining each block and each layer as a drawing task unit further includes: retrieving graphic elements falling within the scope of each block through a spatial index structure.

4. The method for drawing large-scale map graphics according to claim 1, characterized in that, In the step of creating an independent thread worker instance and allocating an independent drawing context for each drawing task unit, the independent drawing context includes a bitmap buffer or vector graphics buffer, a drawing attribute set for the corresponding layer, a coordinate transformation matrix, and a graphics clipping region set to the corresponding block range.

5. The method for drawing large-scale map graphics according to claim 1, characterized in that, The step of submitting all thread worker instances to the thread pool for scheduling and execution, so that each thread worker instance completes the drawing of the corresponding block and layer in an independent drawing context, further includes: adding all thread worker instances to the task waiting queue of the thread pool, and selecting thread worker instances from the task waiting queue for execution.

6. The method for drawing large-scale map graphics according to claim 1, characterized in that, The step of merging and displaying the drawing results of each thread's working instance according to the block position and layer order further includes: Write the completed graphics data of each thread's working instance to the shared results queue; The graphic data is extracted from the shared result queue and merged into the global frame buffer according to the block position and layer order. The updated buffer content is then transmitted to the display device.

7. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, The processor is configured to execute the computer program stored in the memory to implement the large-scale layout graphics drawing method as described in any one of claims 1-6.

8. A computer-readable storage medium, characterized in that, The storage medium stores a computer program, which is loaded and executed by a processor to implement the large-scale layout graphics drawing method as described in any one of claims 1-6.