Interactive debugging method and device, electronic equipment, storage medium and program

By creating interactive debugging threads in software simulation tools, receiving user instructions and debugging the target simulation threads, the problems of fewer interactive debugging functions and poor flexibility in the existing technology are solved, and more rich and flexible interactive debugging capabilities are achieved.

CN119623368APending Publication Date: 2025-03-14S2C
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411674767.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-21
Publication Date
2025-03-14

AI Technical Summary

Technical Problem

The interactive debugging tool in existing software simulation tools has fewer functions and is difficult to meet the diverse interactive debugging needs. It can only intervene in interactive debugging when the emulation main thread executes a system call event.

Method used

In the simulation debugging tool, when the target simulation thread is started, an interactive debugging thread is created, and the thread receives interactive debugging instructions input by the user through the thread, and in response to these instructions, the target simulation thread is interactively debugged.

Benefits of technology

It enriches the functions of interactive debugging, improves the flexibility of interactive debugging, and enables users to interactively debug with them at any stage of the simulation program.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119623368A_ABST
    Figure CN119623368A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses an interactive debugging method and device, electronic equipment, a storage medium and a program.The method comprises the steps that under the condition that it is determined that a target simulation thread is started, an interactive debugging thread is created; receiving an interactive debugging instruction input by a user through the interactive debugging thread; and responding to the interactive debugging instruction through the interactive debugging thread, and carrying out interactive debugging on the target simulation thread. According to the technical scheme of the embodiment of the invention, the function of interactive debugging can be enriched, so that the flexibility of interactive debugging is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the field of computer software application technology, and in particular to an interactive debugging method, device, electronic device, storage medium and program. Background Art

[0002] Software simulation has always been an important part of chip design. As the scale of chip design increases, the importance of software simulation is also increasing. Software simulation tools are a type of software tool used to simulate the behavior of electronic systems and circuits. After the circuit design code is completed, it can help circuit design engineers simulate the logic behavior of the circuit, including signal transmission, logical operations, and timing control, to verify whether the function and timing constraints of the circuit are correct. As the complexity of chip design increases, the difficulty of verifying the correctness of chip design also increases. In order to more fully verify the correctness of chip design, the application of software simulation is becoming more and more extensive.

[0003] The implementation of software simulation tools is similar to that of other language compilers and is divided into three parts: front-end, back-end, and runtime. The front-end mainly includes lexical analysis, syntax analysis, semantic analysis, and semantic optimization, parsing the original code into a syntax tree. The back-end is mainly responsible for intermediate code generation, converting the syntax tree into intermediate code. The intermediate code is a low-level language similar to assembly language, which expresses the control flow, data flow, and calculation process of the program in a machine-independent way. The runtime is mainly responsible for library loading, memory management, instruction execution, and exception handling. The interactive debugging tool is a debugging tool in the software simulation tool, which allows developers to interact directly with the debugger to control and debug the program, so that users can better understand and debug the behavior of the design.

[0004] In the process of implementing the present invention, the inventors found that the prior art has the following defects: At present, the interactive debugging tool adapted in the software simulation tool can only intervene for interactive debugging when the simulation main thread in the software simulation tool executes a system call event, and the interactive debugging function is relatively small, making it difficult to meet diverse interactive debugging needs. Summary of the invention

[0005] The embodiments of the present invention provide an interactive debugging method, device, electronic device, storage medium and program, which can enrich the functions of interactive debugging and thus improve the flexibility of interactive debugging.

[0006] According to one aspect of the present invention, there is provided an interactive debugging method, which is applied to a simulation debugging tool, comprising:

[0007] When it is determined that the target simulation thread is started, an interactive debugging thread is created;

[0008] Receiving interactive debugging instructions input by a user through the interactive debugging thread;

[0009] The target simulation thread is interactively debugged by the interactive debugging thread in response to the interactive debugging instruction.

[0010] According to another aspect of the present invention, there is provided an interactive debugging device, which is configured in a simulation debugging tool, and comprises:

[0011] An interactive debugging thread creation module is used to create an interactive debugging thread when it is determined that the target simulation thread is started;

[0012] An interactive debugging instruction receiving module, used for receiving interactive debugging instructions input by a user through the interactive debugging thread;

[0013] The interactive debugging module is used to interactively debug the target simulation thread in response to the interactive debugging instruction through the interactive debugging thread.

[0014] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:

[0015] at least one processor; and

[0016] a memory communicatively connected to the at least one processor; wherein,

[0017] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the interactive debugging method described in any embodiment of the present invention.

[0018] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the interactive debugging method described in any embodiment of the present invention when executed.

[0019] According to another aspect of the present invention, a computer program product is provided, including a computer program, wherein when the computer program is executed by a processor, the interactive debugging method according to any embodiment of the present invention is implemented.

[0020] The embodiment of the present invention creates an interactive debugging thread when the simulation debugging tool determines that the target simulation thread is started, and receives interactive debugging instructions input by the user through the interactive debugging thread, so that the interactive debugging thread responds to the interactive debugging instructions and interactively debugs the target simulation thread, thereby solving the problems of the interactive debugging tools in the existing simulation debugging tools, such as the lack of interactive debugging functions and poor flexibility, and can enrich the functions of interactive debugging, thereby improving the flexibility of interactive debugging.

[0021] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0023] Figure 1 is a flow chart of an interactive debugging method provided by Embodiment 1 of the present invention;

[0024] Figure 2 is a flow chart of an interactive debugging method provided by Embodiment 2 of the present invention;

[0025] Figure 3 It is a schematic diagram of the normal execution flow of a software simulation tool when it is running in the prior art;

[0026] Figure 4 is a schematic diagram of an interactive simulation debugging process provided by Embodiment 2 of the present invention;

[0027] Figure 5 is a schematic diagram of an interactive debugging device provided by Embodiment 3 of the present invention;

[0028] Figure 6 A schematic diagram of the structure of an electronic device provided in Embodiment 4 of the present invention. DETAILED DESCRIPTION

[0029] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0030] It should be noted that the terms "include", "have" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or apparatus comprising a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to these processes, methods, products or apparatus.

[0031] Embodiment 1

[0032] Figure 1 This is a flowchart of an interactive debugging method provided by the first embodiment of the present invention. This embodiment is applicable to the case where a simulation debugging tool executes user input instructions by creating an interactive debugging thread to implement interactive debugging. The method can be executed by an interactive debugging device, which can be implemented by software and / or hardware and can generally be integrated in an electronic device. The electronic device can be a terminal device or a server device. As long as it can run the simulation debugging tool to execute the interactive debugging method, the embodiment of the present invention does not limit the specific device type of the electronic device. Accordingly, Figure 1 As shown, the method includes the following operations:

[0033] S110: When it is determined that the target simulation thread is started, create an interactive debugging thread.

[0034] Among them, the simulation debugging tool can be any type of software simulation debugging tool, as long as the debugging program can be executed in the form of a thread, and the embodiment of the present invention does not limit the tool type of the simulation debugging tool. Exemplarily, the simulation debugging tool can be a logic simulation tool for chip design language in the field of EDA (Electronic Design Automation), which can be used to verify the correctness of the chip design. The target simulation thread can be the main thread used for simulation verification in the simulation debugging tool, which can execute the operation logic of the simulation program, and the simulation program can be used to simulate and verify a certain design object (such as chip design or software program, etc.). The interactive debugging thread can be a thread used by the simulation debugging tool to interactively debug the target simulation thread, which belongs to a thread type unique to the interactive debugging tool. The interactive debugging tool is a tool in the runtime stage in software simulation. It can be understood that the target simulation thread and the interactive debugging thread are two different threads, and their operation execution processes are independent of each other.

[0035] In an embodiment of the present invention, when the simulation debugging tool starts the target simulation thread in the runtime phase in the software simulation, when executing the simulation program through the target simulation thread, it can be determined that the target simulation thread is in the startup state. At this moment, before the target simulation thread starts to execute the simulation program, a thread independent of the target simulation thread can be created as an interactive debugging thread. It is understandable that, since the target simulation thread and the interactive debugging thread are two independent threads, the simulation debugging tool cannot execute the target simulation thread and the interactive debugging thread simultaneously.

[0036] In the interactive debugging tool, the memory between the target simulation thread and the interactive debugging thread is shared, so the memory in the target simulation thread can be read and written in the interactive debugging thread. In the implementation of the three types of commands, the memory of the target simulation thread can be accessed and modified through the VPI (Verilog Process Interface) on the interactive debugging thread to achieve various functions.

[0037] S120: receiving an interactive debugging instruction input by a user through the interactive debugging thread.

[0038] The interactive debugging instruction may be an instruction for instructing to interactively debug the simulation program executed by the target simulation thread.

[0039] The so-called interactive debugging can be understood as intervening in the simulation debugging process of the simulation program during the simulation debugging of the simulation program through the target simulation thread, thereby interacting with the simulation program. Exemplarily, the interactive debugging function may include, but is not limited to, viewing or modifying signal values ​​in the simulation program, setting breakpoints, and dumping waveforms (referring to displaying the spectrum distribution of the signal in the form of a waveform graph), etc.

[0040] Accordingly, after the interactive debugging thread is created, the interactive debugging thread can be started first, and a command line interface is provided to the user through the interactive debugging thread to receive interactive debugging instructions input by the user through the command line interface to meet the user's interactive debugging needs for the simulation program.

[0041] Optionally, the user can input any type of interactive debugging instructions as needed, such as but not limited to simulation control commands, information display commands, and memory modification commands. Among them, simulation control commands can be used to control the simulation program, such as setting breakpoints, controlling thread blocking or waking up, and ending the simulation process. Information display commands can be used to view relevant information of the simulation program, such as various types of information, scopes, and source codes in the simulation. Memory modification commands can be used to modify signals, etc.

[0042] S130. Responding to the interactive debugging instruction through the interactive debugging thread, interactively debugging the target simulation thread.

[0043] Accordingly, after the simulation debugging tool creates and starts an interactive debugging thread, the interactive debugging thread can respond to the interactive debugging instruction and interact with the target simulation thread according to the parsing result of the interactive debugging instruction to implement interactive debugging of the simulation program.

[0044] It can be seen that the embodiment of the present invention creates and executes an interactive debugging thread when the target simulation thread of the simulation program is started, so that the interactive debugging thread interacts with the entire process of the simulation program according to the interactive debugging instructions input by the user, which is not affected by the execution process of the simulation program, and can be interactively debugged with the simulation program at any stage, thereby improving the flexibility of interactive debugging. At the same time, the user can input any type of interactive debugging instructions to the simulation program based on the interactive debugging thread, so the interactive debugging function of the interactive debugging tool can be enriched.

[0045] The embodiment of the present invention creates an interactive debugging thread when the simulation debugging tool determines that the target simulation thread is started, and receives interactive debugging instructions input by the user through the interactive debugging thread, so that the interactive debugging thread responds to the interactive debugging instructions and interactively debugs the target simulation thread, thereby solving the problems of the interactive debugging tools in the existing simulation debugging tools, such as the lack of interactive debugging functions and poor flexibility, and can enrich the functions of interactive debugging, thereby improving the flexibility of interactive debugging.

[0046] Embodiment 2

[0047] Figure 2 is a flowchart of an interactive debugging method provided by Embodiment 2 of the present invention. This embodiment is specific based on the above embodiment. In this embodiment, multiple specific optional implementation methods for determining the start of a target simulation thread and interactively debugging the target simulation thread are provided. Figure 2 As shown, the method of this embodiment may include:

[0048] S210: Determine the implementation method of the simulator in the simulation debugging tool.

[0049] S220: When it is determined that the compiled simulation object is loaded into the simulator according to the implementation mode of the simulator in the simulation debugging tool, it is determined that the target simulation thread is started and an interactive debugging thread is created.

[0050] The simulation object may be an object suitable for simulation debugging by a simulation debugging tool, for example, it may include chip design and software program, etc. As long as it can be simulated and debugged by a simulation debugging tool, the embodiment of the present invention does not limit the specific type of the simulation object.

[0051] Figure 3 Schematic diagram of the normal execution flow of software simulation tools in the prior art. In a specific example, the simulation flow of chip design is used as an example. Figure 3 As shown, the normal execution flow of the software simulation tool used to simulate the chip design may include the following operations when it is running:

[0052] (1) Start simulation: The simulation program is started. Depending on the simulator implementation method, it may be necessary to load the compiled design simulation object into the simulator. This process may include instantiating modules, connecting signals, and setting simulation clocks.

[0053] (2) Simulation initialization: Execute the initialization process. This process may include instantiating each instance, setting initial values, initializing registers and variables, etc., to ensure that the simulation object is in the correct state when the simulation starts.

[0054] (3) Execute simulation: Once the initialization is completed, the simulator starts to execute the design. The operation logic in the simulation object is continuously executed in an event-based manner.

[0055] (4) Simulation end: The simulation program will continue to run until the specified simulation time is reached or the end condition is triggered.

[0056] When it is necessary to interactively debug the simulation program, after the simulation debugging tool starts simulating, it is no different from the normal simulation flow of the simulation debugging tool without including the interactive debugging process. That is, the simulation program starts, and according to its simulator implementation mode, the compiled simulation object is loaded into the simulator. The loading process of the simulation object may include but is not limited to instantiating modules, connecting signals, and setting simulation clocks, etc. After the simulation object is loaded, an interactive debugging thread can be created. Optionally, the interactive debugging thread can be a thread of UCLI (Unified Command-Line Interface) mode, referred to as UCLI thread. UCLI thread can be used to read and execute interactive debugging instructions input by the user to interact with the target simulation thread according to the interactive debugging instructions.

[0057] S230, controlling the target simulation thread to enter a blocked waiting state.

[0058] S240: Read, parse and execute the interactive debugging instruction through the interactive debugging thread.

[0059] Since the simulation debugging tool cannot execute multiple different threads at the same time, after creating an interactive debugging thread, it is necessary to control the target simulation thread to enter a blocked waiting state so that the interactive debugging thread is in an awake state, waiting for the user to enter an interactive debugging instruction. When the interactive debugging thread is in an active state, a command line interface can be provided to the user. The user can enter interactive debugging instructions as needed according to the command line interface, such as setting breakpoints or viewing the value of a signal. Accordingly, the interactive debugging thread can obtain the interactive debugging instructions through the command line interface, and parse and execute them.

[0060] S250, determining whether the interactive debugging instruction includes information instructing the target simulation thread to continue execution, if so, waking up the target simulation thread and executing S260, otherwise, executing S280.

[0061] S260: Continue to execute the target simulation thread, and control the interactive debugging thread to enter the blocking waiting state.

[0062] It is understandable that some interactive debugging instructions include the function of instructing the target simulation thread to continue to execute, while some interactive debugging instructions do not have the function of instructing the target simulation thread to continue to execute. The interactive debugging thread can execute each interactive debugging instruction in sequence according to the input order of the interactive debugging instructions, and judge whether the interactive debugging instruction includes the information of instructing the target simulation thread to continue to execute. If it is determined that the interactive debugging instruction currently executed includes the information of instructing the target simulation thread to continue to execute, the target simulation thread can be awakened, the target simulation thread can be continued to execute, and the interactive debugging thread can be controlled to enter the blocked waiting state. If it is determined that the interactive debugging instruction currently executed does not include the information of instructing the target simulation thread to continue to execute, the interactive debugging instruction can be continued to be executed in sequence.

[0063] S270, determining whether the target simulation thread executes the first target event, if so, controlling the interactive debugging thread to enter a wake-up state, and returning to execute S230, otherwise, executing S280.

[0064] The first target event may be an event that can suspend the target simulation thread.

[0065] S280, determining whether the target simulation thread executes the second target event, if so, executing S2110, otherwise, returning to execute S260.

[0066] The second target event may be an event that can end the simulation process, or may be an event that indicates that the simulation process has been completed.

[0067] After the target simulation thread is awakened, the simulation program can continue to execute the simulation process until an event that causes the simulation to be paused or ended is encountered. Specifically, the target simulation thread can judge the various running links in the simulation program in real time. If the target simulation thread executes the first target event that requires the simulation process to be paused during the simulation process, the interactive debugging thread can be controlled to enter the awakening state, and the execution control target simulation thread can be returned to enter the blocked waiting state. The interactive debugging thread reads, parses and executes the interactive debugging instructions to switch to the interactive debugging thread to continue the interactive debugging process. If the target simulation thread executes the second target event that requires the simulation process to end or be completed during the simulation process, the interactive debugging thread can be killed and the entire simulation process ends.

[0068] S290, determine whether the interactive debugging instruction is a simulation end instruction, if so, it is S2110, otherwise, return to execute S240.

[0069] The simulation end instruction may be an instruction for controlling the end of the current simulation program.

[0070] S2110, killing the interactive debugging thread and ending the entire simulation process.

[0071] Similarly, during the process of interactive debugging of the target simulation thread, the interactive debugging thread can also determine the type of interactive debugging instructions in real time. If it confirms that it has received a simulation end instruction instructing to end the target simulation thread to end the simulation process, it does not need to wait for the target simulation thread to be executed, and can directly kill the interactive debugging thread and end the entire simulation process.

[0072] In the embodiment of the present invention, optionally, the interactive debugging instruction may include but is not limited to at least one of a simulation control command, an information display command, and a memory modification command.

[0073] The simulation control commands may include but are not limited to a Stop command, a Next command, a Run command, a Finish command, and a Restart command, wherein:

[0074] The Stop command can set breakpoints in the simulation program, or operate existing breakpoints in the simulation program, such as deleting breakpoints, adding breakpoint comments, and enabling / disabling specified breakpoints. It should be noted that the Stop command is only used to set and modify breakpoints, and does not directly control the simulation. Optionally, the Stop command can support three types of breakpoints: (1) Breakpoints for monitoring signals: This type of breakpoint can be set on a signal, and will be triggered when the value of the monitored signal changes, causing the simulation to pause and wake up the interactive debugging thread; (2) Breakpoints on simulation time: This type of breakpoint is set on a specified simulation time, and will be triggered when the simulation enters the specified time, causing the simulation to pause and wake up the interactive debugging thread; (3) Breakpoints on statements: This type of breakpoint is set on a statement in the simulation program, and will be triggered when the simulation executes this statement, causing the simulation to pause and wake up the interactive debugging thread.

[0075] For example, if the use case 1 of a program voice is:

[0076] module test;

[0077] int a,b;

[0078]

[0079] For the above use case 1, suppose the interactive debugging instruction executed is: stop-change test.a. This instruction will set a breakpoint on the variable test.a. The breakpoint will be triggered when the value of variable a changes. Suppose the interactive debugging instruction executed is: stop-abosule 1. This instruction will set a breakpoint at simulation time 1. The breakpoint will be triggered when the simulation runs to this time. Suppose the interactive debugging instruction executed is: stop-line 9-file test.sv. This instruction will set a breakpoint at line 9 in the test.sv file, that is, x=y+1;. The breakpoint will be triggered when the simulation executes to this statement.

[0080] The Next command may cause the interactive debugging thread to block and wait, wake up the target simulation thread and execute a sentence of executable code forward, then pause the target simulation thread again and wake up the interactive debugging thread. For example, in the above use case 1, if the breakpoint stop-line 9-file test.sv is hit, the current simulation is paused at the sentence x=y+1;. At this time, executing the Next command through the interactive debugging thread will cause the simulation process to execute to the next sentence y=x|y; and pause, and then enter the interactive debugging thread again.

[0081] The Run command can make the interactive debugging thread block and wait, wake up the target simulation thread and execute forward until a breakpoint is triggered, an event that causes the simulation to end is encountered, or the simulation ends. For example, in the above use case 1, if the breakpoint stop-line 9-file test.sv is hit, the current simulation is paused at the sentence x=y+1; at this time, executing the run command through the interactive debugging thread will cause the simulation to continue to execute until the simulation ends.

[0082] The Finish command can be used to make the target simulation thread execute the end event system call and end the simulation process. For example, in the above use case 1, if the stop-line 9-file test.sv breakpoint is hit, the current simulation is paused at the sentence x=y+1; at this time, executing the Finish command through the interactive debugging thread will cause the simulation to end directly, and the subsequent statements and events of the simulation program will no longer be executed.

[0083] The Restart command can be used to restart the target simulation thread from the beginning. After the target simulation thread has reset its state and completed initialization, it will be blocked again and the interactive debugging thread will be awakened to wait for further interactive instructions from the user.

[0084] The information display command may include but is not limited to a Show command, a Scope command, and a Listing command.

[0085] The Show command can be used to view various types of information during the simulation process, including runtime hierarchical scopes such as instance and named block (block-level scope), ports, and signals, and can view in detail the full name, parent, type, location, value, and signal strength of an object. For example, in the above use case 1, you can use the Show command to view various types of information. Here are a few examples:

[0086] Show: This command can view all objects under the current scope. Assuming that the current scope is root, the following output will be obtained: test.

[0087] show-fullname-parent-type-value-where: This command will view all objects in the current scope and display their full name, parent, type, value, and location properties. Assuming the simulation is paused at the beginning and the current scope is test, the command will return the following:

[0088] a test.a test{int VARIABLE}0{test.sv 2}

[0089] b test.b test{int VARIABLE}0{test.sv 2}

[0090] foo test.foo test function--{test.sv 8}

[0091] The Scope command can be used to view the current scope and point the current scope to a specific instance. For example, in the above use case 1, the Scope command can be used to view and switch the scope. Here are a few examples:

[0092] Scope: This command will check the current scope. Assuming the current scope is the root node, the following will be returned:

[0093] $root

[0094] scope test.foo

[0095] This command will search for a scope called test.foo from the current scope, and once found, it will switch the current scope to test.foo.

[0096] The Listing command can be used to view the source code of the simulation program language. For example, in the above use case 1, the source code can be viewed by executing the Listing command through the interactive debugging thread. For example, when the Listing command is input as: listing-file test.sv-line 9-lines 3, the content of line 9 and the 3 lines above and below in the test.sv file will be output, and the output is as follows:

[0097] $display(a,b);

[0098] end

[0099] function int foo(int x,int y);

[0100] x=y+1;

[0101] y=x|y;

[0102] return y;

[0103] End function

[0104] The memory modification command may include but is not limited to a Force command and a Release command.

[0105] The force command allows users to modify the value of a signal. This command will continue to write a value to the specified signal until the user uses the release command to release the force operation. For example, in the above use case 1, the force command can be executed through the interactive debugging thread to copy the variable. The following is an example: force test.a 3'b101. This command will write the value of the variable test.a to 3'b101 (converted to decimal is 5). After executing this command, use the show-valuetest.a command to view the value of a, and you will get the result: 5.

[0106] The Release command can be used to release the modification applied to a signal by the force command and is used in conjunction with the force command.

[0107] Figure 4 Schematic diagram of an interactive simulation debugging process provided by the second embodiment of the present invention. In order to more clearly describe the technical solution provided by the embodiment of the present invention, in a specific example, Figure 4 As shown, taking the simulation process of chip design as an example, the software simulation process of the multi-threaded interactive debugging tool may include the following operations:

[0108] (1) Start simulation: This step is no different from the normal execution process when the software simulation tool for chip design simulation is running. The simulation program starts. Depending on the implementation method of the simulator, it may be necessary to load the compiled design simulation object into the simulator. This process may include instantiating modules, connecting signals, and setting simulation clocks. After this step is completed, go to step (2).

[0109] (2) Create a UCLI thread: Create a UCLI thread, which is used to read the instructions input by the user and execute the corresponding interactive debugging instructions, and interact with the simulation thread. The simulation thread is the thread that executes the simulation program. The UCLI thread is the interactive debugging thread. After this step is completed, go to step (3).

[0110] (3) Simulation thread blocks and waits: After creating the UCLI thread and performing initialization operations, the simulation thread will block and wait for wakeup. After this step is completed, go to step (4).

[0111] (4) The UCLI thread is in an active state: At this time, the simulation thread is blocked. The UCLI thread provides a command line console for the user to enter commands, and reads and parses the commands entered by the user, such as setting breakpoints and viewing signal values. If the executed command has the function of allowing the simulation program to continue executing, the UCLI thread will be blocked and the simulation thread will be awakened and go to step (5); if it is a command to end the simulation, go to step (6); if it is another command, continue to execute step (4).

[0112] (5) The simulation thread is awakened: The simulation thread will continue to execute the event-scheduled simulation until it encounters an event that causes the simulation to pause or end. If it encounters an event that causes the simulation to pause, it will go to step (4). If it encounters an event that causes the simulation to end or the entire simulation program is executed, it will go to step (6).

[0113] (6) Simulation ends: kill the UCLI thread and end the entire simulation process.

[0114] The multi-threaded interactive debugging method proposed in the above technical solution can well realize the interactive debugging and control of the simulation process, so as to quickly locate and solve the problems in the design object. By enriching various interactive debugging functions such as monitoring variable values ​​and setting breakpoints, the behavior of the design object can be tracked and analyzed more effectively, so as to accurately locate the problem and improve the flexibility of simulation debugging.

[0115] In the technical solution of the present disclosure, the collection, storage, use, processing, transmission, provision and disclosure of user personal information are in compliance with the relevant laws and regulations and do not violate public order and good morals.

[0116] It should be noted that any arrangement and combination of the technical features in the above embodiments also falls within the protection scope of the present invention.

[0117] Embodiment 3

[0118] Figure 5 is a schematic diagram of an interactive debugging device provided by Embodiment 3 of the present invention, such as Figure 5 As shown, the device includes: an interactive debugging thread creation module 310, an interactive debugging instruction receiving module 320 and an interactive debugging module 330, wherein:

[0119] An interactive debugging thread creation module 310, used to create an interactive debugging thread when it is determined that the target simulation thread is started;

[0120] An interactive debugging instruction receiving module 320, configured to receive interactive debugging instructions input by a user through the interactive debugging thread;

[0121] The interactive debugging module 330 is used to interactively debug the target simulation thread in response to the interactive debugging instruction through the interactive debugging thread.

[0122] The embodiment of the present invention creates an interactive debugging thread when the simulation debugging tool determines that the target simulation thread is started, and receives interactive debugging instructions input by the user through the interactive debugging thread, so that the interactive debugging thread responds to the interactive debugging instructions and interactively debugs the target simulation thread, thereby solving the problems of the interactive debugging tools in the existing simulation debugging tools, such as the lack of interactive debugging functions and poor flexibility, and can enrich the functions of interactive debugging, thereby improving the flexibility of interactive debugging.

[0123] Optionally, the interactive debugging thread creation module 310 is also used to: determine the implementation method of the simulator in the simulation debugging tool; and determine that the target simulation thread is started when it is determined that the compiled simulation object is loaded into the simulator according to the implementation method of the simulator in the simulation debugging tool.

[0124] Optionally, the interactive debugging module 330 is also used to: control the target simulation thread to enter a blocked waiting state; read, parse and execute the interactive debugging instruction through the interactive debugging thread, and when it is determined that the interactive debugging instruction includes information instructing the target simulation thread to continue execution, wake up the target simulation thread, continue executing the target simulation thread, and control the interactive debugging thread to enter the blocked waiting state.

[0125] Optionally, the interactive debugging module 330 is also used to: when it is determined that the target simulation thread executes the first target event, control the interactive debugging thread to enter a wake-up state, and return to execute the operation of controlling the target simulation thread to enter a blocked waiting state; when it is determined that the target simulation thread executes a second target event, kill the interactive debugging thread and end the entire simulation process.

[0126] Optionally, the interactive debugging module 330 is further configured to: when it is determined that the interactive debugging instruction is a simulation end instruction, kill the interactive debugging thread and end the entire simulation process.

[0127] Optionally, the interactive debugging instruction includes at least one of a simulation control command, an information display command, and a memory modification command.

[0128] The above interactive debugging device can execute the interactive debugging method provided by any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method. For technical details not described in detail in this embodiment, please refer to the interactive debugging method provided by any embodiment of the present invention.

[0129] Since the interactive debugging device introduced above is a device that can execute the interactive debugging method in the embodiment of the present invention, based on the interactive debugging method introduced in the embodiment of the present invention, the technical personnel in the field can understand the specific implementation of the interactive debugging device of the present embodiment and its various variations, so how the interactive debugging device implements the interactive debugging method in the embodiment of the present invention is not described in detail here. As long as the technical personnel in the field implement the device used by the interactive debugging method in the embodiment of the present invention, it belongs to the scope of protection of this application.

[0130] Embodiment 4

[0131] Figure 6 A schematic diagram of the structure of an electronic device 10 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.

[0132] like Figure 6As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0133] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0134] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as an interactive debugging method.

[0135] Optionally, interactive debugging methods can be applied to simulation debugging tools, including:

[0136] When it is determined that the target simulation thread is started, an interactive debugging thread is created;

[0137] Receiving interactive debugging instructions input by a user through the interactive debugging thread;

[0138] The target simulation thread is interactively debugged by the interactive debugging thread in response to the interactive debugging instruction.

[0139] In some embodiments, the interactive debugging method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the interactive debugging method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform the interactive debugging method in any other appropriate manner (e.g., by means of firmware).

[0140] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0141] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0142] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0143] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).

[0144] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0145] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.

[0146] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.

[0147] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.

Claims

1. An interactive debugging method, characterized in that: Applied to simulation debugging tools, including: When it is determined that the target simulation thread is started, an interactive debugging thread is created; Receiving interactive debugging instructions input by a user through the interactive debugging thread; The target simulation thread is interactively debugged by the interactive debugging thread in response to the interactive debugging instruction.

2. The method according to claim 1, characterized in that The step of determining the target simulation thread to start includes: Determine the implementation method of the simulator in the simulation debugging tool; In the case where it is determined that the compiled simulation object is loaded into the simulator according to the implementation mode of the simulator in the simulation debugging tool, it is determined that the target simulation thread is started.

3. The method according to claim 1, characterized in that The interactive debugging thread responds to the interactive debugging instruction to interactively debug the target simulation thread, including: Controlling the target simulation thread to enter a blocked waiting state; The interactive debugging instruction is read, parsed and executed by the interactive debugging thread. When it is determined that the interactive debugging instruction includes information instructing the target simulation thread to continue execution, the target simulation thread is awakened, the target simulation thread is continued to be executed, and the interactive debugging thread is controlled to enter the blocked waiting state.

4. The method according to claim 3, characterized in that The method further comprises: In the case of determining that the target simulation thread executes the first target event, controlling the interactive debugging thread to enter a wake-up state, and returning to execute an operation of controlling the target simulation thread to enter a blocked waiting state; When it is determined that the target simulation thread executes the second target event, the interactive debugging thread is killed and the entire simulation process ends.

5. The method according to claim 3, characterized in that: Also includes: When it is determined that the interactive debugging instruction is a simulation end instruction, the interactive debugging thread is killed and the entire simulation process is ended.

6. The method according to any one of claims 1 to 5, characterized in that: The interactive debugging instruction includes at least one of a simulation control command, an information display command, and a memory modification command.

7. An interactive debugging device, characterized in that: Configured in simulation debugging tools, including: An interactive debugging thread creation module is used to create an interactive debugging thread when it is determined that the target simulation thread is started; An interactive debugging instruction receiving module, used for receiving interactive debugging instructions input by a user through the interactive debugging thread; The interactive debugging module is used to interactively debug the target simulation thread in response to the interactive debugging instruction through the interactive debugging thread.

8. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the interactive debugging method according to any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the interactive debugging method described in any one of claims 1 to 6 when executed.

10. A computer program product comprising a computer program / instructions, wherein: When the computer program / instructions are executed by a processor, the interactive debugging method according to any one of claims 1 to 6 is implemented.