System simulation test method, device and equipment and nonvolatile storage medium

By creating virtual devices and configuring interface drivers in the system simulation environment, the conversion of user control commands to processor control commands is realized, solving the problem of full log generation and improving the efficiency and flexibility of performance analysis in computer simulation testing.

CN120950412AActive Publication Date: 2025-11-14SHANDONG BOSUAN ZHIXIN INFORMATION TECHNOLOGY CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202511231846.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-31
Publication Date
2025-11-14
Estimated Expiration
2045-08-31

AI Technical Summary

Technical Problem

In existing technologies, the generation of full logs in computer simulation testing consumes a large amount of storage space, affects the efficiency of performance analysis, and lacks flexible control and dynamic adjustment capabilities.

Method used

By creating a first virtual device with a command conversion module in the system simulation environment, configuring the interface and driver for the processor simulation module, the conversion of user control commands to processor control commands is realized, and the log generation behavior is precisely controlled.

Benefits of technology

This reduces redundant data, lowers the complexity of performance analysis, improves simulation efficiency, enables online performance analysis and dynamic adjustment of log generation methods, and avoids the problem of asynchronous operation between the processor simulation module and the hardware module.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120950412A_ABST
    Figure CN120950412A_ABST
Patent Text Reader

Abstract

The invention discloses a system simulation test method, device and equipment and a nonvolatile storage medium, and relates to the technical field of computer simulation tests.First virtual equipment with a command conversion function module is created through a computer simulator, and a user interface and a first interface are configured; configuring a first virtual device driver for calling a first interface for the processor simulation module, converting a user control command which is received by the user interface and comprises a log generation command into a processor control command based on the first virtual device, and sending the processor control command to the processor simulation module through the first interface, therefore, the processor simulation module executes a processor control command when executing a simulation test in a system simulation environment, and a log generation mode is configured from a processor execution level, so that a log generation behavior of the processor simulation module when executing a test program can be accurately controlled; therefore, data redundant information is reduced, the performance analysis complexity is reduced, and the influence of log generation on the system simulation efficiency is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer simulation testing technology, and in particular to a system simulation testing method, apparatus, equipment, and non-volatile storage medium. Background Technology

[0002] As computer systems become increasingly complex, the role of co-simulation testing (both hardware and software) is becoming more prominent. Computer simulators allow the construction of computer simulation systems on host machines, with hardware simulation modules added. During test execution, the processor provides detailed logs of the software execution process; the processor simulation module within the computer simulation system also provides this functionality. However, the trace logs output by the processor simulation module during simulation are typically full logs, recording every aspect of the test program's execution. These full logs not only consume significant storage space but also greatly impact the efficiency of performance analysis.

[0003] How to configure the log generation method in computer simulation testing is a technical problem that needs to be solved by those skilled in the art. Summary of the Invention

[0004] This invention provides a system simulation testing method, apparatus, equipment, and non-volatile storage medium to at least solve the problem in related technologies where the log generation method in computer simulation testing cannot be configured.

[0005] This invention provides a system simulation testing method, comprising: A computer simulator is invoked to create a first virtual device with a command translation function module in the system simulation environment, and a user interface and a first interface for connecting to the processor simulation module in the system simulation environment are configured for the first virtual device. Configure the processor emulation module with a first virtual device driver for calling the first interface; Based on the first virtual device, the user control commands received by the user interface are converted into processor control commands and sent to the processor simulation module through the first interface, so that the processor simulation module executes the processor control commands when performing simulation tests in the system simulation environment; The user control commands include log generation commands.

[0006] The present invention also provides a system simulation testing device, comprising: A creation unit is used to call a computer simulator to create a first virtual device with a command conversion function module in a system simulation environment, and to configure a user interface and a first interface for connecting to the processor simulation module in the system simulation environment for the first virtual device. A configuration unit is configured to configure a first virtual device driver for the processor emulation module to call the first interface; The control unit is configured to convert user control commands received by the user interface into processor control commands based on the first virtual device and send them to the processor simulation module through the first interface, so that the processor simulation module executes the processor control commands when performing simulation tests in the system simulation environment. The user control commands include log generation commands.

[0007] The present invention also provides an electronic device, comprising: a memory for storing a computer program; and a processor for executing the computer program to implement the steps of any of the above-described system simulation test methods.

[0008] The present invention also provides a non-volatile storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the steps of any of the above-described system simulation test methods.

[0009] Through this invention, in a system simulation environment, a first virtual device with a command conversion function module is created using a computer simulator. A user interface and a first interface for connecting to a processor simulation module are configured. The processor simulation module is then configured with a first virtual device driver for calling the first interface. Based on the first virtual device, user control commands, including log generation commands, received by the user interface are converted into processor control commands and sent to the processor simulation module through the first interface. This allows the processor simulation module to execute processor control commands during simulation testing in the system simulation environment. By configuring the log generation method at the processor execution level, the log generation behavior of the processor simulation module during test program execution can be precisely controlled, rather than simply outputting the full log. This reduces data redundancy, lowers the complexity of performance analysis, and reduces the impact of log generation on system simulation efficiency.

[0010] The present invention also provides a method for creating and configuring a first virtual device, thereby enabling the receiving of software control instructions through a first interface, controlling the generation of logs by the processor simulation module, and flexibly processing user-inputted control commands, reducing unnecessary data interference, and improving the accuracy and efficiency of performance analysis.

[0011] This invention can also generate logs online and call performance analysis tools online to output performance analysis results based on test logs. It can realize online performance analysis by dynamically adjusting the log generation method, which helps testers obtain performance analysis results in a timely manner.

[0012] The present invention can also send a synchronization command to the processor simulation module through the first virtual device, so that when the processor simulation module pauses the simulation test due to log generation, it can control the hardware simulation module connected to the processor simulation module to pause the operation in a cross-triggered manner based on the synchronization command, and control the hardware simulation module to start when the log recording is completed and the simulation test is restarted, thereby avoiding the problem of the processor simulation module being out of sync with other hardware simulation modules when the log is paused due to log generation, that is, avoiding the log generation affecting the execution of the test process. Attached Figure Description

[0013] To more clearly illustrate the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0014] Figure 1 A flowchart of a system simulation testing method provided in an embodiment of the present invention; Figure 2 An architecture diagram of a system simulation environment provided in an embodiment of the present invention; Figure 3 This is a schematic diagram illustrating how a performance analysis tool can be invoked to output performance analysis results, as provided in an embodiment of the present invention. Detailed Implementation

[0015] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the protection scope of the present invention.

[0016] It should be noted that, in the description of this invention, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. The terms "first," "second," etc., used in this invention are used to distinguish similar objects and are not used to describe a specific order or sequence.

[0017] To enable those skilled in the art to better understand the present invention, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0018] In computer simulation testing, open-source computer architecture simulators (hereinafter referred to as computer simulators) can be used to realize system simulation modeling, which can realize the simulation of complex software and hardware systems. For example, the General Execution-driven Multiprocessor Simulator (GEM5) is an open-source simulator that supports system-level and central processing unit (CPU) microarchitecture level, supports multiple instruction set architectures, and is currently widely used.

[0019] During computer simulation testing, processor architectures typically provide detailed logs of the software execution process. This allows developers to track and record various information during program execution, such as function calls, branch decisions, cache hits, and memory accesses, aiding in performance analysis and optimization, as well as troubleshooting and fault diagnosis. For example, the ARM architecture provides the Timestamped Activity Recording and Monitoring for ARM Cores (Tarmac Trace) tracing mechanism, which records detailed information about the software's running status and performance data on ARM architecture CPUs. Developers can use in-depth analysis of these logs to obtain key performance indicators during software execution, providing a basis for performance optimization.

[0020] However, during simulation, the logging functionality provided by the processor architecture has many shortcomings.

[0021] First, the logging function in processor architecture is merely a low-level debugging tool. It consumes significant resources, meticulously recording every detail of instruction execution and hardware register state changes. Furthermore, during processor simulation, logging is typically full or statically configured, leading to the following problems: data redundancy (full logs consume substantial storage resources, increasing data analysis complexity); lack of flexible control (the log scope cannot be adjusted in real-time according to user needs during simulation (e.g., specific code segments, memory addresses, register operations); and uncontrollable performance overhead (log generation can significantly slow down simulation, making it difficult to balance debugging needs with simulation efficiency).

[0022] The debugging interface provided by the processor architecture only supports breakpoint-triggered logging. For example, the debugging tool (gdbserver) interface of Gem5 can receive breakpoint configurations to record logs when the processor simulation module executes simulation tests at specific locations. However, this configuration cannot adjust the log granularity or filtering conditions, and this breakpoint interrupts from the underlying level of the processor simulation module, which will directly affect the execution of the test program.

[0023] To configure the log generation method in computer simulation testing, this invention provides a system simulation testing method, apparatus, device, and non-volatile storage medium. In the system simulation environment, a first virtual device with a command conversion module is created using a computer simulator. A user interface and a first interface for connecting to a processor simulation module are configured. A first virtual device driver for calling the first interface is configured for the processor simulation module. Based on the first virtual device, user control commands, including log generation commands, received by the user interface are converted into processor control commands and sent to the processor simulation module through the first interface. This allows the processor simulation module to execute processor control commands during simulation testing in the system simulation environment. This configuration of the log generation method at the processor execution level allows for precise control of the log generation behavior of the processor simulation module when executing test programs, rather than simply outputting the full log. This reduces data redundancy, lowers the complexity of performance analysis, and minimizes the impact of log generation on system simulation efficiency.

[0024] The embodiments of the present invention provide a system simulation testing method. The method is described in detail below in conjunction with the execution flow of the system simulation testing method.

[0025] Figure 1 A flowchart of a system simulation testing method provided in an embodiment of the present invention.

[0026] like Figure 1 As shown, the system simulation testing method provided in this embodiment of the invention may include: S101: calling a computer simulator to create a first virtual device with a command conversion function module in the system simulation environment, configuring a user interface and a first interface for connecting to the processor simulation module in the system simulation environment for the first virtual device.

[0027] S102: Configure the processor emulation module with the first virtual device driver for calling the first interface.

[0028] S103: Based on the first virtual device, the user control commands received by the user interface are converted into processor control commands and sent to the processor simulation module through the first interface, so that the processor simulation module executes the processor control commands when performing simulation tests in the system simulation environment.

[0029] Among these, user control commands include log generation commands.

[0030] In practical implementation, a system simulation environment is pre-built using a computer simulator. Within this environment, a simulation subsystem is constructed that includes multi-level caching, a self-developed hardware acceleration engine, and a high-speed interconnect bus. For example, in the GEM5 Redundant Arrays of Independent Disks (RAID) simulation environment, configuration files can be modified and custom modules added. Hardware acceleration engines, including a high-speed serial computer expansion bus (Peripheral Component Interconnect Express, PCIe) interface, a Direct Memory Access (DMA) module, an Accelerator Data Operation (ACC) module, and an Input / Output Processor (IOP), can be added. The communication mechanism between each acceleration engine and the CPU can be optimized to ultimately complete the construction of the simulation system.

[0031] For S101, the function of creating a custom device based on computer virtual devices is to add a first virtual device in the system simulation environment and define the function module of the first virtual device to include at least a command conversion function module, which is used to convert user control commands into processor control commands. The user control commands include at least a log generation command to configure the log generation strategy of the processor simulation module.

[0032] Configure a user interface and a first interface for the first virtual device to establish communication between the first virtual device and the user, as well as between the first virtual device and the processor emulation module.

[0033] For S102, a first virtual device driver is configured in the processor emulation module so that the processor emulation module can communicate with the first virtual device based on the first interface.

[0034] For S103, based on the first virtual device, user control commands are converted into processor control commands that can be executed by the processor simulation module, and the processor control commands are transmitted to the processor simulation module to configure the log generation strategy during the simulation test process from the processor execution level.

[0035] The system simulation testing method provided in this invention creates a first virtual device with a command conversion function module in a system simulation environment using a computer simulator. It configures a user interface and a first interface for connecting to a processor simulation module, and configures a first virtual device driver for the processor simulation module to call the first interface. Based on the first virtual device, user control commands received by the user interface, including log generation commands, are converted into processor control commands and sent to the processor simulation module through the first interface. This allows the processor simulation module to execute processor control commands during simulation testing in the system simulation environment. By configuring the log generation method at the processor execution level, the log generation behavior of the processor simulation module during test program execution can be precisely controlled, rather than simply outputting the full log. This reduces data redundancy, lowers the complexity of performance analysis, and reduces the impact of log generation on system simulation efficiency.

[0036] Figure 2 This is an architecture diagram of a system simulation environment provided in an embodiment of the present invention.

[0037] Based on the above embodiments, in the system simulation testing method provided by the embodiments of the present invention, S101 calls a computer simulator to create a first virtual device in the system simulation environment, and configures a user interface and a first interface for connecting to the processor simulation module in the system simulation environment for the first virtual device. This may include: calling the computer simulator to create the underlying class structure of the first virtual device, the underlying class structure including register variables, register read / write control parameters, and conversion logic corresponding to user control commands corresponding to the first interface; creating a device object corresponding to the first virtual device and configuring the corresponding device control parameters; adding an instance of the first virtual device in the configuration script of the system simulation environment, and connecting the first virtual device to the processor simulation module.

[0038] In practical implementation, a custom device is added in the system simulation environment to receive and implement software control of the processor and provide real-time feedback on the working status of the simulation subsystem, serving as the first virtual device.

[0039] Taking the GEM5+ARM simulation system as an example, a custom device of the SimpleDevice class can be added to the device model. It defines three sets of registers to receive control commands and internal status feedback sent by the software, so as to dynamically control the ARM Tarmac logging to be turned on or off during the operation of the software under test.

[0040] Specifically, first, a C++ class is created to define the device's underlying structure. Members include three sets of register variables, as well as control logic implementations for register read / write and Tarmac logging (enabling and disabling). Next, a Python class for device control is defined, providing instantiation control of the device object and required parameters. Then, in the system configuration script, an instance of the first virtual device is added and connected to the system bus.

[0041] By following the steps above, a first virtual device is added to GEM5. The next step is to define the software abstraction of this first virtual device to provide a control interface for the application layer software.

[0042] In this embodiment of the invention, configuring a first virtual device driver for calling the first interface in S102 may include: creating a control interface function for the first virtual device based on the register mapping of the first virtual device, so as to configure the first virtual device driver according to the control interface function; wherein, the control interface function includes an initialization interface function for the first virtual device, a control interface function for the first virtual device, and a status query interface function for the first virtual device.

[0043] In practical implementation, based on the software development process and the register mapping of the first virtual device, a set of control interface functions is defined. These functions may include defining device initialization and log generation strategies, such as the log generation location (start and end points) of the code under test, cache hit statistics, memory command statistics, and simulation subsystem working status queries.

[0044] In this embodiment of the invention, step S103, which converts user control commands received from the user interface into processor control commands based on the first virtual device and sends them to the processor emulation module through the first interface, so that the processor emulation module executes the processor control commands when performing simulation testing in the system simulation environment, may include: converting log generation commands into code instrumentation locations based on the first virtual device, and sending the code instrumentation locations to the processor emulation module through the first interface, so that the processor emulation module configures log generation control parameters for the program code under test according to the code instrumentation locations, and executes the log generation control parameters when executing the program code under test; wherein, the log generation control parameters include at least one of the following: log generation location of the program code under test, log tracking granularity, and log statistics parameter type.

[0045] In some optional embodiments of the present invention, converting the log generation command into a code instrumentation location based on the first virtual device and sending the code instrumentation location to the processor simulation module through the first interface may include: converting the log generation command into a code instrumentation location based on the first virtual device, adding the code of the program to be tested to the system simulation environment, recompiling the system simulation environment, and sending the code instrumentation location to the processor simulation module.

[0046] For example Figure 2 As shown, depending on the needs of debugging or performance analysis, the device initialization interface is called before the code segment under test to set the log recording start position to start logging and the log recording end position to end logging. Then, the program code under test is ported to the system simulation environment containing the first virtual device.

[0047] Then, the system simulation environment is rebuilt. Taking GEM5 as an example, an SConscript script is created, and the command sconsbuild / ARM / gem5.opt is executed to recompile Gem5, so that the custom device code is added to the GEM5 binary file.

[0048] Therefore, it is possible to achieve such Figure 2 The architecture shown builds a system simulation environment based on the host machine's hardware resources. The simulation subsystem can include one or more processor simulation modules, which can be single-core or multi-core processors. The simulation subsystem may also include bus interconnects and other interface controllers.

[0049] In the first virtual device, the first interface may include a bus interface and a register interface. The register interface provides a software control interface, receiving user control commands (such as starting performance statistics recording) and current status feedback. The bus interface enables the first virtual device to connect to the simulation subsystem. The functional module is used to implement user control commands, that is, to convert user-inputted user control commands into processor control commands that the processor simulation module can recognize and execute. Based on this method, the log generation method can be dynamically adjusted.

[0050] The first virtual device driver, as the software abstraction of the first virtual device, provides three types of interfaces to the upper-layer software: an initialization interface, responsible for controlling the initial state of the first virtual device, such as releasing the internal state machine reset signal; a control interface, implementing the execution of user control commands, such as enabling and disabling Tarmac performance data statistics; and a status query interface, assisting the software in confirming the working status of the first virtual device.

[0051] The test program is the program code under test running in the processor simulation module. Through the first virtual device provided in this embodiment of the invention, it is possible to control the opening and closing of performance data statistics at the beginning and end of the code segment under test, as well as to query the working status of the first virtual device.

[0052] Based on the system simulation environment, during the execution of the program code under test by the processor simulation module, log generation commands in the processor control commands are identified. When the corresponding location of the program code under test is reached, test logs are recorded based on the log generation function of the processor simulation module. After preprocessing such as format conversion, effective information related to software performance, such as instruction execution time, cache command rate, and memory access frequency, is extracted. Based on the performance analysis results, software optimization strategies are formulated, such as partial code refactoring, algorithm improvement, and hardware and software resource adjustment. The optimization effects are then iteratively verified using the system simulation environment.

[0053] The above embodiments of the present invention describe a method for controlling log generation by inserting it into the code of the program under test. Although this method can accurately record runtime data for the code segment under test, it lacks dynamic interactivity. In some optional embodiments of the present invention, step S103, which converts the user control command received by the user interface into a processor control command based on the first virtual device and sends it to the processor emulation module through the first interface, may further include: converting the user control command into a target processor control command based on the first virtual device and sending it to the processor emulation module. The type of the target processor control command includes at least one of command line, script, and graphical user interface (GUI). By transmitting user commands to the processor emulation module through command line, script, graphical user interface, etc., more real-time adjustments to the log generation method can be achieved when adjusting the log generation method, without requiring a restart of the system emulation environment.

[0054] In the above embodiments, control instructions from the software are received through a register interface, but the application scenarios of this method are limited. In some alternative embodiments of the present invention, configuring a first virtual device driver for the processor emulation module to call the first interface in S102 may further include: configuring communication parameters for the first virtual device to communicate with the processor emulation module via memory mapping. The first virtual device communicates directly with the processor hardware through memory-mapped I / O, allowing the custom device to retain a certain degree of flexibility.

[0055] Figure 3 This is a schematic diagram illustrating how a performance analysis tool can be invoked to output performance analysis results, as provided in an embodiment of the present invention.

[0056] In this embodiment of the invention, the processor simulation module in S103 executes processor control commands when performing simulation tests in the system simulation environment, which may include: generating test logs according to log generation commands during the simulation test in the system simulation environment; and calling performance analysis tools to output performance analysis results based on the test logs.

[0057] In practice, different simulation system startup commands are executed according to the characteristics of the program code under test. During the operation of the simulation system, processor running data is recorded and logged to the log file.

[0058] In this embodiment of the invention, a script can be written to parse the generated log file, remove irrelevant information, and convert data such as timestamps, instruction execution processes, hardware resource usage, cache hits, and memory access statistics into a unified format for subsequent analysis. Then, a performance analysis tool is called to perform performance analysis. This tool can be Lauterbach Trace32, FlameGraph, etc. For example, using Lauterbach Trace32, the original Tarmac log data and the compiled ELF image of the target software are imported to generate performance data graphs including function interface call context, interrupt context, and timing. Using FlameGraph, the processed log data is input to generate visual program performance and CPU utilization charts to assist in analyzing program performance bottlenecks and function call hotspots.

[0059] In addition to performance analysis solutions based on third-party tools, data mining algorithms can also be used to perform correlation analysis on performance indicators in log data, find the relationship between instruction execution time and cache hit rate, build a software performance model based on regression analysis, and predict performance under different input data scales.

[0060] By using the above analysis methods, we can confirm whether the target code's performance meets the requirements. If not, we need to develop targeted performance optimization strategies. Based on the analysis results, we can identify potential performance bottlenecks, such as unreasonable memory access and caching configurations in the software. We can then optimize the code, adjust the data structure layout, and add a data prefetching mechanism. Next, we can rerun the optimized software in a simulation system and compare the performance data to verify the effectiveness of the optimization strategies until the performance requirements are finally met.

[0061] Based on the first virtual device provided in this embodiment of the invention, the log generation method of the processor simulation module can be dynamically adjusted. Furthermore, with the generation of log files, performance analysis can be performed more flexibly. For example, during the log generation process, performance analysis tools can be synchronously invoked to output performance analysis results, which can then be displayed on the user interface. This improves the real-time nature of the performance analysis results output, facilitating online observation of the system simulation environment by testers.

[0062] Based on the above embodiments, in the system simulation testing method provided by the embodiments of the present invention, the user control command may further include a synchronization command. In S103, when the processor simulation module executes the processor control command during simulation testing in the system simulation environment, it may include: when the processor simulation module executes the simulation test in the system simulation environment, upon reaching the log generation position corresponding to the log generation command and pausing the simulation test, controlling the hardware simulation module connected to the processor simulation module to pause operation using a cross-trigger method based on the synchronization command, and controlling the hardware simulation module to start when log recording is completed and the simulation test is restarted.

[0063] In the process of controlling the log generation position of the processor emulation module by using breakpoint-triggered logging in related technologies, since the processor emulation module is interrupted directly from the bottom layer to generate logs, when the processor emulation module pauses the execution of the code under test, other hardware modules connected to the processor emulation module will not stop working. This will lead to the processor emulation module being out of sync with other hardware modules, which will affect the execution of the code under test.

[0064] In this embodiment of the invention, a synchronization command can also be sent to the processor simulation module through the first virtual device. This allows the processor simulation module to control the hardware simulation module connected to the processor simulation module to pause operation based on the synchronization command when the simulation test is paused due to log generation. When the log recording is completed and the simulation test is restarted, the hardware simulation module can be controlled to start. This avoids the problem of the processor simulation module being out of sync with other hardware simulation modules when the log is paused due to log generation, i.e., it avoids the log generation affecting the execution of the test process.

[0065] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method.

[0066] Embodiments of the present invention also provide a system simulation testing apparatus, which may include: a creation unit, configured to call a computer simulator to create a first virtual device with a command conversion function module in a system simulation environment, and configure a user interface and a first interface for connecting to a processor simulation module in the system simulation environment for the first virtual device; a configuration unit, configured to configure a first virtual device driver for the processor simulation module to call the first interface; and a control unit, configured to convert user control commands received by the user interface into processor control commands based on the first virtual device and send them to the processor simulation module through the first interface, so that the processor simulation module executes the processor control commands when performing simulation testing in the system simulation environment; wherein, the user control commands include log generation commands.

[0067] In this embodiment of the invention, the creation unit calls a computer simulator to create a first virtual device in a system simulation environment, and configures a user interface and a first interface for connecting to the processor simulation module in the system simulation environment for the first virtual device. This may include: calling the computer simulator to create the underlying class structure of the first virtual device, the underlying class structure including register variables corresponding to the first interface, register read / write control parameters, and conversion logic corresponding to user control commands; creating a device object corresponding to the first virtual device and configuring the corresponding device control parameters; adding an instance of the first virtual device in the configuration script of the system simulation environment, and connecting the first virtual device to the processor simulation module.

[0068] In this embodiment of the invention, the configuration unit configures a first virtual device driver for the processor emulation module to call the first interface, which may include: creating a control interface function for the first virtual device based on the register mapping of the first virtual device, so as to configure the first virtual device driver according to the control interface function; wherein, the control interface function includes an initialization interface function for the first virtual device, a control interface function for the first virtual device, and a status query interface function for the first virtual device.

[0069] In this embodiment of the invention, the control unit converts user control commands received from the user interface into processor control commands based on a first virtual device and sends them to the processor emulation module through a first interface, so that the processor emulation module executes the processor control commands when performing simulation testing in the system simulation environment. This can include: converting log generation commands into code instrumentation locations based on the first virtual device, and sending the code instrumentation locations to the processor emulation module through the first interface, so that the processor emulation module configures log generation control parameters for the program code under test according to the code instrumentation locations, and executes the log generation control parameters when executing the program code under test; wherein, the log generation control parameters include at least one of the following: log generation location of the program code under test, log tracking granularity, and log statistics parameter type.

[0070] In this embodiment of the invention, the control unit converts the log generation command into a code instrumentation location based on the first virtual device and sends the code instrumentation location to the processor simulation module through the first interface. This may include: converting the log generation command into a code instrumentation location based on the first virtual device, adding the code to be tested to the system simulation environment, and then recompiling the system simulation environment to send the code instrumentation location to the processor simulation module.

[0071] In this embodiment of the invention, the processor simulation module executes processor control commands when performing simulation tests in the system simulation environment, which may include: generating test logs according to log generation commands during the simulation test in the system simulation environment; and calling performance analysis tools to output performance analysis results based on the test logs.

[0072] In this embodiment of the invention, the user control command further includes a synchronization command; when the processor simulation module executes the processor control command during simulation testing in the system simulation environment, it may include: when the processor simulation module executes the simulation test in the system simulation environment, upon reaching the log generation position corresponding to the log generation command and pausing the simulation test, controlling the hardware simulation module connected to the processor simulation module to pause operation based on the synchronization command using a cross-triggered method, and controlling the hardware simulation module to start when the log recording is completed and the simulation test is restarted.

[0073] For a description of the features in the embodiment corresponding to the system simulation test device, please refer to the relevant description of the embodiment corresponding to the system simulation test method, which will not be repeated here.

[0074] Embodiments of the present invention also provide an electronic device, including a memory and a processor, wherein the memory stores a computer program and the processor is configured to run the computer program to perform the steps in any of the above-described system simulation test method embodiments.

[0075] Embodiments of the present invention also provide a non-volatile storage medium storing a computer program, wherein the computer program is configured to execute the steps in any of the above-described system simulation test method embodiments when running.

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

[0077] Embodiments of the present invention also provide a computer program product, which includes a computer program that, when executed by a processor, implements the steps in any of the above-described system simulation testing method embodiments.

[0078] Embodiments of the present invention also provide another computer program product, including a non-volatile storage medium storing a computer program, which, when executed by a processor, implements the steps in any of the above-described system simulation test method embodiments.

[0079] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software 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 implementations should not be considered beyond the scope of this invention.

[0080] The above provides a detailed description of the system simulation testing method, apparatus, equipment, and non-volatile storage medium provided by the present invention. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The descriptions of the above embodiments are only intended to help understand the method and core ideas of the present invention. It should be noted that those skilled in the art can make various improvements and modifications to the present invention without departing from its principles, and these improvements and modifications also fall within the protection scope of the present invention.

Claims

1. A system simulation testing method, characterized in that, include: A computer simulator is invoked to create a first virtual device with a command translation function module in the system simulation environment, and a user interface and a first interface for connecting to the processor simulation module in the system simulation environment are configured for the first virtual device. Configure the processor emulation module with a first virtual device driver for calling the first interface; Based on the first virtual device, the user control commands received by the user interface are converted into processor control commands and sent to the processor simulation module through the first interface, so that the processor simulation module executes the processor control commands when performing simulation tests in the system simulation environment; The user control commands include log generation commands.

2. The system simulation testing method according to claim 1, characterized in that, A computer simulator is invoked to create a first virtual device in a system simulation environment. A user interface and a first interface for connecting to a processor simulation module in the system simulation environment are configured for the first virtual device, including: The computer simulator is invoked to create the underlying class structure of the first virtual device. The underlying class structure includes register variables corresponding to the first interface, register read / write control parameters, and conversion logic corresponding to the user control command. Create a device object corresponding to the first virtual device and configure the corresponding device control parameters; Add an instance of the first virtual device to the configuration script of the system simulation environment, and connect the first virtual device to the processor simulation module.

3. The system simulation testing method according to claim 1, characterized in that, Configuring a first virtual device driver for the processor emulation module to call the first interface includes: Based on the register mapping of the first virtual device, a control interface function for the first virtual device is created to configure the driver of the first virtual device according to the control interface function; The control interface functions include the initialization interface function of the first virtual device, the control interface function of the first virtual device, and the status query interface function of the first virtual device.

4. The system simulation testing method according to claim 1, characterized in that, Based on the first virtual device, the user control commands received by the user interface are converted into processor control commands and sent to the processor emulation module through the first interface, so that the processor emulation module executes the processor control commands when performing simulation tests in the system simulation environment, including: Based on the first virtual device, the log generation command is converted into a code instrumentation location, and the code instrumentation location is sent to the processor emulation module through the first interface, so that the processor emulation module configures the log generation control parameters of the program code under test according to the code instrumentation location, so as to execute the log generation control parameters when the program code under test is executed; The log generation control parameters include at least one of the following: log generation location, log tracking granularity, and log statistics parameter type for the program code under test.

5. The system simulation testing method according to claim 4, characterized in that, Based on the first virtual device, the log generation command is converted into a code instrumentation location, and the code instrumentation location is sent to the processor emulation module through the first interface, including: Based on the first virtual device, the log generation command is converted into a code instrumentation location, and the code to be tested is added to the system simulation environment. Then, the system simulation environment is recompiled to send the code instrumentation location to the processor simulation module.

6. The system simulation testing method according to claim 1, characterized in that, The processor simulation module executes the processor control commands during simulation testing in the system simulation environment, including: During the simulation test performed in the system simulation environment, the processor simulation module generates test logs according to the log generation command. Call the performance analysis tool to output performance analysis results based on the test logs.

7. The system simulation testing method according to claim 1, characterized in that, The user control commands also include synchronization commands; The processor simulation module executes the processor control commands during simulation testing in the system simulation environment, including: When the processor simulation module performs simulation testing in the system simulation environment, upon reaching the log generation position corresponding to the log generation command and pausing the simulation test, it controls the hardware simulation module connected to the processor simulation module to pause operation based on the synchronization command using a cross-triggered method, and controls the hardware simulation module to start when the log recording is completed and the simulation test is restarted.

8. A system simulation testing device, characterized in that, include: A creation unit is used to call a computer simulator to create a first virtual device with a command conversion function module in a system simulation environment, and to configure a user interface and a first interface for connecting to the processor simulation module in the system simulation environment for the first virtual device. A configuration unit is configured to configure a first virtual device driver for the processor emulation module to call the first interface; The control unit is configured to convert user control commands received by the user interface into processor control commands based on the first virtual device and send them to the processor simulation module through the first interface, so that the processor simulation module executes the processor control commands when performing simulation tests in the system simulation environment. The user control commands include log generation commands.

9. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor, configured to implement the steps of the system simulation test method as described in any one of claims 1 to 7 when executing the computer program.

10. A non-volatile storage medium, characterized in that, The non-volatile storage medium stores a computer program, wherein when the computer program is executed by a processor, it implements the steps of the system simulation test method as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Simulation debugging method and device for processor

    CN102567196A

  • Embedded operating system-based simulation debugging system and method

    CN103186458A

  • Processor debugging system and method under simulation mode

    CN107688528A

  • Distributed interactive simulation time sequence verification method and system

    CN115422033A

  • System and apparatus for managing test procedures within a hardware-in-the-loop simulation system

    US20100250220A1