Simulation method, device, equipment and medium
By using automated scripts to process layout data and replace template parameters on the simulation platform, the problem of manual operations affecting simulation efficiency in the existing technology is solved, efficient automated simulation is achieved, and simulation efficiency and accuracy are improved.
Patent Information
- Application Number
- CN202510360500.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-25
- Publication Date
- 2025-06-24
AI Technical Summary
Existing electromagnetic simulation software requires manual settings of parameters and operations during chip design simulation, resulting in inefficient simulation, especially when handling multiple simulation tasks.
By implementing automated scripts on the simulation platform, automatically obtain and process layout data to be simulated, replace the specified parameters in the basic template, including graph coordinates, and call electromagnetic simulation software on the idle server node to perform simulation.
It reduces the impact of manual operation, improves the simulation efficiency of electromagnetic simulation software, realizes automatic completion of simulation tasks, and reduces the risk of manual errors.
Smart Images

Figure CN120197587A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of simulation technology, and in particular, to a simulation method, device, equipment and medium. Background Art
[0002] Currently, when performing chip design simulation work using simulation software such as Sonnet, since the Sonnet software is based on a desktop system interface operation method, it is necessary to manually set relevant parameters, import layout design files, and export simulation results, etc. Manual operation affects the simulation efficiency. If there are multiple simulation tasks, manual operation one by one will have a more serious impact on the simulation efficiency.
[0003] It can be seen that how to reduce the impact of manual operation and thus improve the simulation efficiency of electromagnetic simulation software is a problem that needs to be solved by those skilled in the art. Summary of the Invention
[0004] In view of this, the purpose of the present invention is to provide a simulation method, device, equipment and medium, which can reduce the impact of manual operation and thus improve the simulation efficiency of electromagnetic simulation software. The specific solutions are as follows:
[0005] In a first aspect, the present invention provides a simulation method, which is applied to a simulation platform and includes:
[0006] Obtain the layout data to be simulated of the target hardware submitted, and add the simulation task corresponding to the layout data to the database;
[0007] Obtain the target simulation task from the database, and when there are idle server nodes, allocate the target simulation task to the idle server nodes;
[0008] On the idle server node, replace the specified parameters in the basic template with the target layout data in the target simulation task through an automated script to obtain a template data file of the electromagnetic simulation software, and call the electromagnetic simulation software to perform simulation based on the template data file, where the specified parameters include graphic coordinates, and the replaced graphic coordinates are the coordinates obtained by moving the coordinate data in the target layout data to the coordinate range of the electromagnetic simulation software.
[0009] Optionally, moving the coordinate data in the target layout data to the coordinate range of the electromagnetic simulation software includes:
[0010] Search for the minimum horizontal axis coordinate value and the minimum vertical axis coordinate value of the coordinate data in the target layout data to obtain the point with the minimum coordinate value;
[0011] Find the maximum horizontal axis coordinate value and the maximum vertical axis coordinate value in the coordinate data to obtain the point with the largest coordinate value.
[0012] Based on the point with the smallest coordinate value and the point with the largest coordinate value, move the coordinate data to within the coordinate range of the electromagnetic simulation software.
[0013] Optionally, calling the electromagnetic simulation software to perform simulation based on the template data file includes:
[0014] Query whether there is an execution file of the electromagnetic simulation software that is currently being executed through a process query command;
[0015] If there is an execution file of the electromagnetic simulation software that is currently being executed, close the execution file of the currently executing electromagnetic simulation software based on the process identifier;
[0016] Reopen the execution file of the electromagnetic simulation software;
[0017] Based on the first script segment in the automation script, input the absolute path of the template data file by calling a keyboard event;
[0018] Based on the second script segment in the automation script, simulate a mouse event of clicking the open button to open the template data file;
[0019] Based on the third script segment in the automation script, simulate a mouse event of clicking the execute button to start executing the target simulation task.
[0020] Optionally, it further includes:
[0021] During the execution of the target simulation task, monitor the execution status of the target simulation task through the log file of the electromagnetic simulation software, and save the target key information corresponding to the execution status to the database, where the target key information includes error information.
[0022] Optionally, it further includes:
[0023] Monitor the pop-up error during the execution of the electromagnetic simulation software, capture the pop-up error through a preset pop-up error capture method, copy the information corresponding to the pop-up error to the clipboard, and save the information in the clipboard to the database.
[0024] Optionally, it further includes:
[0025] During the execution of the target simulation task, if the error information based on the log file or the information corresponding to the pop-up error accumulates to a preset number of times, stop the execution of the target simulation task.
[0026] Optionally, it further includes:
[0027] When the execution status in the log file of the electromagnetic simulation software is captured as simulation completed, it indicates that the target simulation task is correctly executed. The fourth script segment of the automation script is used to simulate a mouse event to select the simulation result type, and the result data corresponding to the simulation result type is saved as a simulation result file in a preset format.
[0028] Parse the simulation result file and save the parsed data to the database so that the user terminal can obtain the parsed data from the database and display it.
[0029] In a second aspect, the present invention provides a simulation device applied to a simulation platform, including:
[0030] A task adding module, configured to obtain the layout data to be simulated of the target hardware submitted and add the simulation task corresponding to the layout data to the database.
[0031] A task allocation module, configured to obtain a target simulation task from the database and, when there is an idle server node, allocate the target simulation task to the idle server node.
[0032] A task execution module, configured to, on the idle server node, replace the specified parameters in the basic template with the target layout data in the target simulation task through an automation script to obtain a template data file of the electromagnetic simulation software, and call the electromagnetic simulation software to perform simulation based on the template data file, where the specified parameters include graphic coordinates, and the replaced graphic coordinates are the coordinates obtained by moving the coordinate data in the target layout data to within the coordinate range of the electromagnetic simulation software.
[0033] In a third aspect, the present invention provides an electronic device, including:
[0034] A memory, configured to store a computer program.
[0035] A processor, configured to execute the computer program to implement the steps of the foregoing simulation method.
[0036] In a fourth aspect, the present invention provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, it implements the steps of the foregoing simulation method.
[0037] In a fifth aspect, the present invention provides a computer program product, including a computer program / instructions, and when the computer program / instructions are executed by a processor, it implements the steps of the foregoing disclosed simulation method.
[0038] As can be seen from the above solution, the present invention provides a simulation method applied to a simulation platform, including: obtaining the layout data to be simulated of the target hardware submitted, and adding the simulation task corresponding to the layout data to a database; obtaining a target simulation task from the database, and when there are idle server nodes, allocating the target simulation task to the idle server nodes; on the idle server nodes, replacing specified parameters in a basic template with the target layout data in the target simulation task through an automated script to obtain a template data file of an electromagnetic simulation software, and invoking the electromagnetic simulation software to perform simulation based on the template data file, where the specified parameters include graphic coordinates, and the replaced graphic coordinates are the coordinates obtained by moving all the coordinate data in the target layout data to within the coordinate range of the electromagnetic simulation software.
[0039] It can be seen that the beneficial effects of the present invention are as follows: adding the simulation task corresponding to the layout data to be simulated submitted by the user to the database, when there are idle server nodes, obtaining the corresponding target simulation task from the database and allocating it to the idle server nodes, automatically replacing the specified parameters in the basic template through an automated script, and moving all the coordinate data in the target layout data to within the coordinate range of the electromagnetic simulation software to obtain a template data file of the electromagnetic simulation software, ensuring that the electromagnetic simulation software performs the simulation correctly. In this way, the user can submit the layout data to automatically complete the simulation, which can reduce the influence of manual operations and thus improve the simulation efficiency of the electromagnetic simulation software. Description of the Drawings
[0040] In order to more clearly illustrate the embodiments of the present invention, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention, and those of ordinary skill in the art can also obtain other drawings based on these drawings without creative efforts.
[0041] Figure 1 It is a flowchart of a simulation method provided by an embodiment of the present invention;
[0042] Figure 2 It is a schematic diagram of a basic template provided by an embodiment of the present invention;
[0043] Figure 3 It is a schematic diagram of a template after replacement provided by an embodiment of the present invention;
[0044] Figure 4 It is a schematic diagram of the coordinate system of the sonnet software layout data provided by an embodiment of the present invention;
[0045] Figure 5 It is a schematic diagram of the loading of a template file provided by an embodiment of the present invention;
[0046] Figure 6 Schematic diagram of a template loading file dialog box provided by an embodiment of the present invention;
[0047] Figure 7 Schematic diagram of an execution log file of sonnet software provided by an embodiment of the present invention;
[0048] Figure 8 Schematic diagram of a pop-up error message provided by an embodiment of the present invention;
[0049] Figure 9 Schematic diagram of a selection of simulation result types provided by an embodiment of the present invention;
[0050] Figure 10 Schematic diagram of an export file dialog box provided by an embodiment of the present invention;
[0051] Figure 11 Schematic diagram of a simulation result data file format provided by an embodiment of the present invention;
[0052] Figure 12 Schematic diagram of the structure of a simulation device provided by an embodiment of the present invention;
[0053] Figure 13 Schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. Detailed implementation manners
[0054] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
[0055] The terms "including" and "having" in the specification of the present invention and any deformations related to "including" and "having" are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but may include steps or units not listed.
[0056] The superconducting quantum chip design simulation implementation method is a complex and delicate process that requires the comprehensive application of knowledge and technologies in multiple fields such as quantum physics, electronic engineering, and computer science. Through continuous research and practice, the accuracy and reliability of simulation technology can be continuously improved, providing strong support for the design and optimization of superconducting quantum chips. In the design process of superconducting quantum chips, simulation technology plays a crucial role. Through simulation, the properties of quantum bits and their interactions can be predicted, thereby guiding the design and optimization of the chip. Simulation technology can also help researchers evaluate the effects of different design schemes and thus select the optimal design scheme.
[0057] Currently, simulation software such as Sonnet is mainly used for chip design simulation work. The Sonnet software is based on the interface operation mode of the desktop system, and relevant parameters need to be manually set, the layout design file needs to be imported, and the simulation results need to be exported, etc. Chip designers use the Sonnet software to open the operation interface, import the layout design file, manually set relevant simulation parameters, and then run the simulation software and wait for the simulation software to output the results. Because a simulation task often takes a relatively long time, if there are multiple simulation tasks, the layout simulation tasks need to be carried out manually one by one, which seriously affects the efficiency of chip design simulation. Manually simulating the chip design layout file requires the operator to continuously adjust the control of the controlled object, which increases the labor intensity of the operator. For the simulation of large and complex systems, manual operation may lead to a significant extension of the calculation time and low efficiency. For a large number of simulation tasks, manually operating the Sonnet software frequently involves a relatively large workload. The server resources and simulation software cannot be used simultaneously by multiple users.
[0058] Therefore, the present invention provides a simulation scheme that can reduce the influence of manual operation and thus improve the simulation efficiency of electromagnetic simulation software.
[0059] In order to enable those skilled in the art to better understand the solution of the present invention, the present invention will be further described in detail below in conjunction with the drawings and specific embodiments.
[0060] Next, a simulation method provided by an embodiment of the present invention will be introduced in detail. Figure 1 The following is a flowchart of a simulation method provided by an embodiment of the present invention. The simulation method includes:
[0061] Step S11: Obtain the layout data to be simulated of the target hardware submitted, and add the simulation task corresponding to the layout data to the database.
[0062] Among them, the layout data is the design file of the target hardware, which may include the graphic shapes and coordinate data corresponding to each component in the target hardware. In the embodiment of the present invention, the layout data to be simulated is obtained, a corresponding simulation task is generated, and the simulation task is added to the database. The layout data is the layout data submitted by the user side, and the user can submit it through the user side.
[0063] Step S12: Obtain the target simulation task from the database, and when there is an idle server node, allocate the target simulation task to the idle server node.
[0064] Among them, the target simulation task can be the unexecuted simulation task ranked first in the database according to the storage order, or the unexecuted simulation task with the highest priority.
[0065] In the embodiment of the present invention, the status of the server node is monitored, and when there is an idle server node, the target simulation task is allocated to the idle server node. By monitoring the server status in the embodiment of the present invention, the reasonable scheduling of the simulation task is ensured.
[0066] Step S13: On the idle server node, based on the target layout data in the target simulation task, replace the specified parameters in the basic template through an automated script to obtain the template data file of the electromagnetic simulation software, and call the electromagnetic simulation software to perform simulation based on the template data file, where the specified parameters include graphic coordinates, and the replaced graphic coordinates are the coordinates obtained by moving the coordinate data in the target layout data to the coordinate range of the electromagnetic simulation software.
[0067] Among them, the automated script is a script for calling the electromagnetic simulation software created in advance. The electromagnetic simulation software can be integrated into the automated script or not. The target layout data is the layout data corresponding to the target simulation task. The basic template includes fixed data and dynamic parameters. The dynamic parameters are the specified parameters, and the specified parameters in the basic template are replaced with the actual data in the target layout data. The specified parameters can include graphic coordinates and simulation parameters. The simulation parameters can include simulation accuracy, occupied resources, etc., and the simulation parameters can be uploaded by the user. The coordinate data in the target layout data is the coordinate data of the graphics in the layout data, and the graphics are the graphics corresponding to the components in the hardware. By moving the coordinate data in the target layout data to the coordinate range of the electromagnetic simulation software, accurate simulation can be ensured. The electromagnetic simulation software can include Sonnet, etc.
[0068] In an alternative embodiment, moving all the coordinate data in the target layout data to within the coordinate range of the electromagnetic simulation software includes: finding the minimum horizontal axis coordinate value and the minimum vertical axis coordinate value of the coordinate data in the target layout data to obtain the point with the minimum coordinate value; finding the maximum horizontal axis coordinate value and the maximum vertical axis coordinate value of the coordinate data to obtain the point with the maximum coordinate value; and moving all the coordinate data to within the coordinate range of the electromagnetic simulation software based on the point with the minimum coordinate value and the point with the maximum coordinate value. In the embodiment of the present invention, the point with the minimum coordinate value and the point with the maximum coordinate value are found to determine the diagonal points of the figure, and through the diagonal points, the overall movement of the coordinate data can be achieved more quickly.
[0069] In an alternative embodiment, calling the electromagnetic simulation software to perform a simulation based on the template data file includes: querying, through a process query command, whether there is an execution file of the electromagnetic simulation software that is currently being executed; if there is an execution file of the electromagnetic simulation software that is currently being executed, closing the execution file of the currently executing electromagnetic simulation software based on the process identifier; reopening the execution file of the electromagnetic simulation software; inputting, through calling a keyboard event, the absolute path of the template data file based on the first script segment in the automation script; simulating a mouse event of clicking an open button to open the template data file based on the second script segment in the automation script; and simulating a mouse event of clicking an execution button based on the third script segment in the automation script to start executing the target simulation task.
[0070] Among them, if there is an execution file of the electromagnetic simulation software that is currently being executed, the process query command will query the corresponding process identifier. In the embodiment of the present invention, the execution file of the currently executing electromagnetic simulation software is first closed based on the process identifier to end the corresponding process, and then the execution file of the electromagnetic simulation software is reopened to start the process corresponding to the target simulation task. The first script segment, the second script segment, and the third script segment are pre-implemented in the automation script of the present invention, which are respectively used to input the absolute path of the template data file by calling a keyboard event, simulate a mouse event of clicking an open button, and simulate a mouse event of clicking an execution button. Among them, the absolute path is the storage path of the template data file. In the present invention, the absolute path of the template data file is input by calling a keyboard event through the automation script, a mouse event of clicking an open button is simulated, and a mouse event of clicking an execution button is simulated to start the simulation, without manual operation, improving the simulation efficiency.
[0071] In an alternative embodiment, during the execution of the target simulation task, the execution status of the target simulation task is monitored through the log file of the electromagnetic simulation software, and the target key information corresponding to the execution status is saved to the database, where the target key information includes error information.
[0072] Among them, the log file of the electromagnetic simulation software stores the execution status of the simulation task, and the execution status may include simulation completed, simulation in progress, etc. The log file will record the error information that appears during the simulation process.
[0073] In an alternative embodiment, monitor the pop-up error during the execution of the electromagnetic simulation software, capture the pop-up error through a preset pop-up error capture method, copy the information corresponding to the pop-up error to the clipboard, and save the information in the clipboard to the database.
[0074] The embodiment of the present invention captures the pop-up error through the preset pop-up error capture method in the automation script and records it in the database.
[0075] In an alternative embodiment, during the execution of the target simulation task, if the error information based on the log file or the information corresponding to the pop-up error accumulates to a preset number of times, the execution of the target simulation task is stopped.
[0076] It can be understood that a counter can be initialized. Whether the error information based on the log file or the information corresponding to the pop-up error appears, both are incremented by 1. When the count value of the counter reaches the preset value, the execution of the target simulation task is stopped. For example, 3 times. Since there are more problems, there may be problems with the layout data, and the simulation is stopped. In this way, increasing the limit of the error tolerance times can accommodate the problems of the stability of the simulation software itself and misoperations to a certain extent.
[0077] Further, in an alternative embodiment, when the execution status in the log file of the electromagnetic simulation software is captured as simulation completed, it indicates that the target simulation task has been correctly executed. The fourth script segment of the automation script is used to simulate a mouse event to select the simulation result type, and the result data corresponding to the simulation result type is saved as a simulation result file in a preset format; the simulation result file is parsed, and the parsed data is saved to the database so that the user terminal can obtain the parsed data from the database and display it.
[0078] That is, the embodiment of the present invention simulates a mouse event through an automation script, selects the simulation result type, and saves the corresponding result data so that the user terminal can view it. An accessible interface is provided for the layout design tool or the client through the web service method to realize the display of graphic or text data. The layout design tool or the client is installed on the user terminal.
[0079] Among them, the types of simulation results can include capacitance values, scattering parameters, and the characteristic impedance of transmission lines. For example, when the four types of data, namely Capacitance1, Capacitance2, S-Parameters, and Line Z0, required for simulation are all captured and parsed, the current sonnet software process is closed. Capacitance1 and Capacitance2 represent the capacitance values of capacitor components. Capacitance1 and Capacitance2 can be the capacitance values of two different capacitor components in a circuit, or the capacitance values of the same capacitor component measured under different conditions (such as different frequencies, different voltages, etc.). S-Parameters (scattering parameters) describe the electrical characteristics of linear passive devices, while Line Z0 represents the characteristic impedance of the transmission line. These data play an important role in the fields of electronic engineering and simulation, and are helpful for designing and optimizing circuit performance.
[0080] Furthermore, continue to poll the simulation task list in the database. If there are new simulation tasks, continue to perform the above operations.
[0081] In an alternative embodiment, the result data of the simulation can be compared with the preset physical parameters through an automated script to determine whether the result data meets the expectations. If it does not meet the expectations, the corresponding parameters in the layout data and the basic template are adjusted based on the comparison result between the result data and the preset physical parameters, and then the simulation is performed again, and the results are compared again until the expected results are obtained, achieving automatic adjustment.
[0082] Next, taking the interdigital capacitor simulation and dynamic adjustment process as an example, it is further elaborated: In an alternative embodiment, the layout data to be simulated includes an interdigital capacitor. The main graphic parameters related to the interdigital static capacitance include the number of finger pairs, finger width, finger spacing, finger length, etc. If the capacitance value in the captured simulation result is less than the expected value, the capacitance graphic parameters in the layout data are automatically adjusted to increase the finger width or decrease the finger spacing to increase the capacitance value. For example, if the original design has a finger width of 2μm and a spacing of 3μm, it can be tried to increase the finger width to 3μm and reduce the spacing to 2μm, and the capacitance value can be increased by about 20 - 30%. If the capacitance value is greater than the expected value, the width is reduced or the spacing is increased to reduce the capacitance value. The effective capacitance value can also be increased by increasing the coverage area of the intersection part, extending the finger length or increasing the number of branches. After the simulation scheduling module adjusts the graphic parameters of the interdigital capacitor, the simulation software is called again to perform the simulation process until the simulation result is within the range of the expected result error, and this simulation task is completed. Through dynamically adjusting the layout data and automatically calling the simulation, the integrated function of design and simulation is realized.
[0083] It can be seen that the beneficial effects of the present invention are as follows: adding the simulation task corresponding to the layout data to be simulated submitted by the user to the database, and when there are idle server nodes, retrieving the corresponding target simulation task from the database and allocating it to the idle server nodes, automatically replacing the specified parameters in the basic template through an automated script, and moving all the coordinate data in the target layout data to within the coordinate range of the electromagnetic simulation software to obtain the template data file of the electromagnetic simulation software, ensuring the correct execution of the simulation by the electromagnetic simulation software. In this way, when the user submits the layout data, the simulation can be automatically completed, reducing the impact of manual operations and thus improving the simulation efficiency of the electromagnetic simulation software.
[0084] Next, taking the electromagnetic simulation software Sonnet as an example, the automated simulation method provided by the present invention is further elaborated. The present invention realizes the integration of the Sonnet software through an automated script, and realizes the fully automated simulation execution and result acquisition in a way that completely eliminates manual intervention through programming scripts. The orderly execution and result verification of batch simulation tasks are realized through the background scheduling system. It supports the submission, operation and result query of multi-user and multi-task. It supports the query and comparison of historical data. The single-user and single-task execution software of the Sonnet simulation software is transformed into a multi-user and multi-task simulation software platform based on web or client operations. Through the pyautogui automated script execution simulation method, a large number of repetitive simulation tasks can be automatically executed, thus releasing human resources to do more important work. The automated simulation method reduces the interference of human factors and improves the accuracy and reliability of data. In the automated simulation method, the execution of the automated script is more objective and consistent, reducing the risk of human input parameter errors. The automated script can realize the dynamic conversion generation of the simulation data range and simulation data according to the design layout data, automatically execute the simulation task, automatically parse the simulation result and save it to the database, and the simulation result query and download can be realized through the web service. Among them, pyautogui is a Python module that can simulate the mouse and keyboard operations of the user on the screen and automate the mouse and keyboard input. Pyautogui provides a set of functions to control the mouse and keyboard, such as moving the mouse, clicking, double-clicking, right-clicking, pressing and releasing keys, etc., and also provides some additional functions, such as capturing screenshots, identifying colors and images, etc., as well as other utility tools, such as obtaining the screen size and mouse position. The specific embodiments of the present invention may include the following steps:
[0085] 1. The user submits the simulation task through means such as the layout design cloud platform and the layout design client, and submits the layout file to be simulated to the task scheduling and management module. The task scheduling and management module is a functional module of the simulation platform.
[0086] 2. The task scheduling and management module saves the simulation tasks containing the layout data to be simulated into the database table according to the submission order.
[0087] 3. The simulation scheduling and management module periodically polls the database to check if there are new simulation tasks.
[0088] 4. After the simulation scheduling and management module obtains a new simulation task each time, it determines whether there are idle server nodes. If there are, it assigns the task to be simulated to the idle server nodes to perform the simulation.
[0089] 5. Use the pyautogui automation script to simulate manual operation of the sonnet software to perform the simulation:
[0090] (a) Generate the template data file required for sonnet software simulation according to the layout data file: perform dynamic parameter replacement based on the basic template, and replace the variables between "##" according to the actual layout data. See Figure 2 、 Figure 3 shown in Figure 2 Figure 18 is a schematic diagram of a basic template provided by an embodiment of the present invention, Figure 3 Figure 20 is a schematic diagram of the template after replacement provided by an embodiment of the present invention.
[0091] (b) For the coordinate data in the layout file, in order to meet the data range required for sonnet software simulation execution, a coordinate movement operation in the real sonnet software coordinate system for all data is required. The following script segment can be used:
[0092] # Find the minimum value of the x coordinate
[0093] left_x = min(point[0] for point in polygon); where point[0] is the point in the coordinate data array point[]. That is, find the minimum x coordinate among the points in the coordinate data. Then find the minimum y coordinate at the minimum x coordinate.
[0094] Further, top_y = max(point[1] for point in polygon if point[0] == left_x), that is, find the maximum value of the y coordinate, and then find the maximum value of the x coordinate. All the data in the layout design file is translated in the x and y directions according to the above x and y coordinates to ensure that all the layout data is within the range of the Sonnet simulation software coordinate system. As Figure 4 shown in Figure 4 Figure 36 is a schematic diagram of the sonnet software layout data coordinate system provided by an embodiment of the present invention.
[0095] (c)After the template data is prepared, the sonnet.exe (executable file) program is called through pyautogui to execute. When the automated script starts to execute, it is necessary to use the dos command to check whether there is a running sonnet.exe currently. According to the process ID, close the running sonnet.exe and reopen the sonnet.exe program. Dos query process command: 'wmic process where "name=sonnet.exe" get processid'.
[0096] (d)After the sonnet.exe program is called by the pyautogui automated script, load the template file generated in step (a). Figure 5 This is a schematic diagram of template file loading provided by an embodiment of the present invention. Open the template loading dialog box by calling the keyboard events "Ctrl+N" and "Ctrl+O". Figure 6 This is a schematic diagram of the template loading file dialog box provided by an embodiment of the present invention. Enter the absolute path of the template file by calling the keyboard event and simulate the mouse event to click the "Open" button. The script segment in the automated script is as follows:
[0097] # Enter the absolute path of the file
[0098] dlg.child_window(title="File Name (N):", auto_id="1148", control_type="Edit").type_keys(absolute_path, with_spaces=True)
[0099] # Simulate the mouse event to open the template file
[0100] dlg.child_window(title="Open (O)", auto_id="1", control_type="Button").click_input()
[0101] (e)Simulate the mouse event to click the "run" button for the simulation task to start the execution of the simulation task.
[0102] (f)When the simulation task starts to execute, it is necessary to monitor the execution status of the simulation task in real time. By monitoring the update of the content of the log_response.log log file during the execution process, query the keyword to obtain the running status of the simulation task, and save the error information or the execution end information to the database. Such as Figure 7 , Figure 7 This is a schematic diagram of the sonnet software execution log file provided by an embodiment of the present invention.
[0103] (g) In addition, it is also necessary to monitor and capture pop-up errors during the execution of the Sonnet software. Capture the current error window through a custom pop-up capture method, simulate clicking the Copy text button, copy the error information to the clipboard, and then save the clipboard content to the database. See Figure 8 as shown Figure 8 which is a schematic diagram of a pop-up error reported provided by an embodiment of the present invention.
[0104] (h) The cancellation operation is supported during the execution of the simulation task. After the user submits the task, the ongoing simulation task can be actively cancelled. The automated script periodically queries the status of the currently executing task. When it is found that the status is the cancellation operation, the automated script closes the currently executing Sonnet process and cancels the execution of the current task.
[0105] (i) Increase the limit of the number of fault tolerances to 3 times to tolerate the stability of the Sonnet software itself and misoperations, etc. When an error is reported in the log file or a pop-up error occurs during the execution of the current task, the error count is recorded as 1. When the error count reaches 3, the task is no longer executed.
[0106] (j) When the status in the log file is captured as "Em simulation completed", the current simulation task is correctly executed, and the simulation results can be captured and parsed.
[0107] (k) Select the simulation result type by simulating mouse events:
[0108] # Through the tree control, select the drawing (data) type Capacitance1 capacitance data
[0109] dlg3.child_window(title="Capacitance1", control_type="TreeItem").click_input(). As Figure 9 shown Figure 9 which is a schematic diagram of a simulation result type selection provided by an embodiment of the present invention.
[0110] (l) Open the export file dialog box by simulating the mouse right-click menu, and save the data as a csv file. As Figure 10 shown Figure 10 which is a schematic diagram of an export file dialog box provided by an embodiment of the present invention.
[0111] (m) After reading and parsing the exported csv file, save it to the database table, and provide an accessible interface for the layout design tool or the client through the web service method to realize the display of graphic or text data. SeeFigure 11 As shown Figure 11 This is a schematic diagram of the format of the simulation result data file provided by the embodiment of the present invention.
[0112] (n)When the four types of data, namely Capacitance1, Capacitance2, S-Parameters, and Line Z0 required for the simulation, are all captured and parsed, close the current sonnet software process.
[0113] (o)Continue to poll the database simulation task table. If there is a new simulation task, continue to execute the above operations.
[0114] In the embodiment of the present invention, in order to improve the efficiency of chip design simulation, the pyautogui automation script method is used to integrate the Sonnet software to implement the scheduling and execution of batch simulation tasks, which can largely solve the complex problems of manual simulation. The chip design simulation software requires a high-configured server, mainly high memory and high CPU. When multiple people need to use the server, they cannot control the same server at the same time. By implementing the automated execution of the Sonnet software for simulation, the scheduling of simulation tasks and the use of server resources by multiple users can be achieved. The automation script realizes the start and stop of the sonnet software; the automation script realizes the monitoring of the execution process of the sonnet software; the automation script realizes the capture of log errors and pop-up errors of the sonnet software; the automation script realizes the dynamic generation of data templates for the sonnet simulation software; the cancellation operation during the execution of the sonnet software is realized through the database status; by setting the redundant error times, the misjudgment operation of the sonnet simulation execution is solved; various data results required for the simulation are dynamically captured; the simulation result file is parsed to realize the data parsing and saving to the database; the real-time query of the simulation results is realized through the direction of the web service interface; through the automation script and task scheduling, the software that realizes the execution of a single user and a single task realizes the execution of multiple users and multiple tasks.
[0115] See Figure 12 As shown, the embodiment of the present invention discloses a simulation device applied to a simulation platform, including:
[0116] A task adding module 121, configured to obtain the layout data to be simulated of the target hardware submitted, and add the simulation task corresponding to the layout data to the database;
[0117] A task allocation module 122, configured to obtain a target simulation task from the database, and allocate the target simulation task to the idle server node when there is an idle server node;
[0118] The task execution module 123 is used to: on the idle server node, replace the specified parameters in the basic template with the target layout data in the target simulation task through an automated script to obtain a template data file for the electromagnetic simulation software, and call the electromagnetic simulation software to perform simulation based on the template data file, where the specified parameters include graphic coordinates, and the replaced graphic coordinates are the coordinates obtained by moving the coordinate data in the target layout data to within the coordinate range of the electromagnetic simulation software.
[0119] Among them, the task execution module 123 includes a coordinate data movement sub-module for moving all the coordinate data in the target layout data to within the coordinate range of the electromagnetic simulation software. The coordinate data movement sub-module is specifically used to find the minimum horizontal axis coordinate value and the minimum vertical axis coordinate value of the coordinate data in the target layout data to obtain the point with the minimum coordinate value; find the maximum horizontal axis coordinate value and the maximum vertical axis coordinate value in the coordinate data to obtain the point with the maximum coordinate value; and move all the coordinate data to within the coordinate range of the electromagnetic simulation software based on the point with the minimum coordinate value and the point with the maximum coordinate value.
[0120] Among them, the task execution module 123 includes a simulation execution sub-module, which is specifically used to:
[0121] Query whether there is an execution file of the electromagnetic simulation software currently being executed through a process query command;
[0122] If there is an execution file of the electromagnetic simulation software currently being executed, close the execution file of the currently executing electromagnetic simulation software based on the process identifier;
[0123] Re-open the execution file of the electromagnetic simulation software;
[0124] Based on the first script segment in the automated script, input the absolute path of the template data file by calling a keyboard event;
[0125] Based on the second script segment in the automated script, simulate a mouse event of clicking the open button to open the template data file;
[0126] Based on the third script segment in the automated script, simulate a mouse event of clicking the execute button to start executing the target simulation task.
[0127] The device further includes a log monitoring module:
[0128] During the execution of the target simulation task, monitor the execution status of the target simulation task through the log file of the electromagnetic simulation software, and save the target key information corresponding to the execution status to the database, where the target key information includes error information.
[0129] The device further includes a pop-up error monitoring module for:
[0130] Monitoring the pop-up errors during the execution of the electromagnetic simulation software, capturing the pop-up errors through a preset pop-up error capture method, copying the information corresponding to the pop-up errors to the clipboard, and saving the information in the clipboard to the database.
[0131] The device further includes a task stop control module for:
[0132] During the execution of the target simulation task, if the error information based on the log file or the information corresponding to the pop-up error accumulates to a preset number of times, stop the execution of the target simulation task.
[0133] The device further includes a result acquisition module for:
[0134] When the execution status in the log file of the electromagnetic simulation software is captured as simulation completed, it indicates that the target simulation task is correctly executed. Simulate a mouse event through the fourth script segment of the automation script to select the simulation result type, and save the result data corresponding to the simulation result type as a simulation result file in a preset format;
[0135] Parse the simulation result file and save the parsed data to the database so that the user side can obtain the parsed data from the database and display it.
[0136] It can be seen that in the embodiment of the present invention, the simulation task corresponding to the to-be-simulated layout data submitted by the user is added to the database. When there are idle server nodes, the corresponding target simulation task is retrieved from the database and assigned to the idle server nodes. The specified parameters in the basic template are automatically replaced through an automation script, and the coordinate data in the target layout data are all moved within the coordinate range of the electromagnetic simulation software to obtain the template data file of the electromagnetic simulation software, ensuring the correct execution of the simulation by the electromagnetic simulation software. In this way, when the user submits the layout data, the simulation can be automatically completed, reducing the impact of manual operations and thus improving the simulation efficiency of the electromagnetic simulation software.
[0137] Figure 12 For the description of the features in the corresponding embodiments, reference can be made to Figure 1 the relevant descriptions of the corresponding embodiments, which will not be elaborated here one by one.
[0138] Figure 13 The following is a structural diagram of an electronic device provided by an embodiment of the present invention. As Figure 13 shown, the electronic device includes: a memory 130 for storing computer programs;
[0139] A processor 131, which is configured to implement the steps of the simulation method in the foregoing embodiments when executing a computer program.
[0140] Among them, the processor 131 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 131 may be implemented in at least one of the following hardware forms: digital signal processing (DSP), field-programmable gate array (FPGA), and programmable logic array (PLA). The processor 131 may also include a main processor and a coprocessor. The main processor is a processor used to process data in the wake state, also known as the central processing unit (CPU); the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, the processor 131 may be integrated with a graphics processing unit (GPU), and the GPU is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 131 may further include an artificial intelligence (AI) processor, and the AI processor is used to process computational operations related to machine learning.
[0141] The memory 130 may include one or more computer-readable storage media, and the computer-readable storage media may be non-transitory. The memory 130 may further include high-speed random access memory and non-volatile memory, such as one or more disk storage devices and flash storage devices. In this embodiment, the memory 130 is at least used to store the following computer program 1301. After the computer program is loaded and executed by the processor 131, it can implement the relevant steps of the simulation method disclosed in any of the foregoing embodiments. In addition, the resources stored in the memory 130 may further include an operating system 1302 and data 1303, etc., and the storage method may be temporary storage or permanent storage. Among them, the operating system 1302 may include Windows, Unix, Linux, etc. The data 1303 may include, but is not limited to, layout data, etc.
[0142] In some embodiments, the electronic device may further include a display screen 132, an input / output interface 133, a communication interface 134, a power supply 135, and a communication bus 136.
[0143] Those skilled in the art can understand that Figure 13 the structure shown in
[0144] It can be understood that if the simulation method in the above embodiments is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the current technology, or all or part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and executes all or part of the steps of the methods in the various embodiments of the present invention. The aforementioned storage medium includes: USB flash drives, mobile hard disks, read-only memories (ROMs), random access memories (RAMs), electrically erasable programmable ROMs, registers, hard disks, removable disks, CD-ROMs, magnetic disks, or optical discs, etc., all of which can store program codes.
[0145] Based on this, the embodiments of the present invention also provide a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the simulation method as described above are implemented.
[0146] The above has introduced in detail a simulation method, device, equipment, and medium provided by the embodiments of the present invention. The various embodiments in the specification are described in a progressive manner. Each embodiment focuses on the differences from other embodiments. For the same and similar parts among the various embodiments, reference can be made to each other. For the device disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple. For the relevant parts, reference can be made to the description in the method part.
[0147] Those skilled in the art can further realize that the units and algorithm steps of the examples described in combination with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of the two. To clearly illustrate the interchangeability of hardware and software, the components and steps of the examples have been generally described according to their functions in the above description. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present invention.
[0148] The above has introduced in detail a simulation method, apparatus, device and medium provided by the present invention. Specific examples are used in this article to elaborate on the principle and implementation manner of the present invention. The description of the above embodiments is only used to help understand the method and its core idea of the present invention. It should be noted that for those of ordinary skill in the art in this technical field, without departing from the principle of the present invention, several improvements and modifications can still be made to the present invention, and these improvements and modifications also fall within the protection scope of the claims of the present invention.
Claims
1. A simulation method, characterized in that: Applied to simulation platforms, including: Obtaining the layout data to be simulated of the submitted target hardware, and adding the simulation task corresponding to the layout data to the database; Acquire the target simulation task from the database, and if there is an idle server node, allocate the target simulation task to the idle server node; On the idle server node, the specified parameters in the basic template are replaced based on the target layout data in the target simulation task through an automated script to obtain a template data file of the electromagnetic simulation software, and the electromagnetic simulation software is called to perform simulation based on the template data file, wherein the specified parameters include graphic coordinates, and the replaced graphic coordinates are coordinates obtained by moving all coordinate data in the target layout data to within the coordinate range of the electromagnetic simulation software.
2. The simulation method according to claim 1, characterized in that: Moving the coordinate data in the target layout data into the coordinate range of the electromagnetic simulation software includes: Find the minimum horizontal axis coordinate value and the minimum vertical axis coordinate value of the coordinate data in the target layout data to obtain the minimum coordinate value point; Find the maximum horizontal axis coordinate value and the maximum vertical axis coordinate value in the coordinate data to obtain the point with the maximum coordinate value; The coordinate data are all moved into the coordinate range of the electromagnetic simulation software based on the minimum coordinate value point and the maximum coordinate value point.
3. The simulation method according to claim 1, characterized in that: Calling the electromagnetic simulation software to perform simulation based on the template data file includes: Querying, by a process query command, whether there is an execution file of the electromagnetic simulation software currently being executed; If there is an execution file of the electromagnetic simulation software currently being executed, closing the execution file of the electromagnetic simulation software currently being executed based on the process identifier; reopening the execution file of the electromagnetic simulation software; Based on the first script segment in the automation script, input the absolute path of the template data file by calling a keyboard event; Based on the second script segment in the automation script, simulating a mouse event of clicking an open button to open the template data file; Based on the third script segment in the automation script, a mouse event of clicking an execution button is simulated to start executing the target simulation task.
4. The simulation method according to claim 3, characterized in that: Also includes: During the execution of the target simulation task, the execution status of the target simulation task is monitored through the log file of the electromagnetic simulation software, and the target key information corresponding to the execution status is saved to the database, wherein the target key information includes error information.
5. The simulation method according to claim 4, characterized in that: Also includes: Monitor pop-up errors during the execution of the electromagnetic simulation software, capture the pop-up errors through a preset pop-up error capture method, copy information corresponding to the pop-up errors to a clipboard, and save the information in the clipboard to the database.
6. The simulation method according to claim 5, characterized in that: Also includes: During the execution of the target simulation task, if the error information based on the log file or the information corresponding to the pop-up window error accumulates to a preset number of times, the execution of the target simulation task is stopped.
7. The simulation method according to any one of claims 1 to 6, characterized in that: Also includes: When the execution status captured in the log file of the electromagnetic simulation software is simulation completion, it indicates that the target simulation task has been correctly executed, and the fourth script segment of the automation script simulates a mouse event to select a simulation result type, and saves the result data corresponding to the simulation result type as a simulation result file in a preset format; The simulation result file is parsed, and the parsed data is saved in the database, so that the user end can obtain the parsed data from the database and display it.
8. A simulation device, characterized in that: Applied to simulation platforms, including: A task adding module is used to obtain the layout data to be simulated of the submitted target hardware, and add the simulation task corresponding to the layout data to the database; A task allocation module, used for acquiring a target simulation task from the database and, if there is an idle server node, allocating the target simulation task to the idle server node; A task execution module is used to replace the specified parameters in the basic template based on the target layout data in the target simulation task on the idle server node through an automated script to obtain a template data file of the electromagnetic simulation software, and call the electromagnetic simulation software to perform simulation based on the template data file, wherein the specified parameters include graphic coordinates, and the replaced graphic coordinates are coordinates obtained by moving all coordinate data in the target layout data to within the coordinate range of the electromagnetic simulation software.
9. An electronic device, characterized in that: include: Memory for storing computer programs; A processor, configured to execute the computer program to implement the steps of the simulation method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the simulation method according to any one of claims 1 to 7 are implemented.