A hardware simulation method, device, equipment and medium
By using multi-threads to create simulation modules and import simulation programs in hardware simulation, the problems of complexity and low efficiency of hardware debugging are solved, embedded hardware simulation debugging on PC is realized, and costs are reduced.
Patent Information
- Application Number
- CN202210446452.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-26
- Publication Date
- 2024-10-22
- Estimated Expiration
- 2042-04-26
AI Technical Summary
During the hardware emulation process, it is difficult for existing technologies to reduce the complexity of hardware debugging, improve debugging efficiency, and reduce costs, especially for embedded debugging of uncommon chips or self-developed chips.
Create simulation modules with different hardware simulation functions through different threads, determine the target hardware functions, build simulation hardware and interfaces, and import simulation programs to simulate hardware functions to realize the creation and operation of simulation hardware and interfaces.
It effectively reduces the complexity of hardware debugging, improves the flexibility and efficiency of debugging, reduces the cost of hardware debugging, and enables simulation debugging of embedded hardware on a PC.
Smart Images

Figure CN114860376B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a hardware simulation method, device, equipment and medium. Background Art
[0002] Currently, QEMU is a very powerful simulator in embedded simulation, supporting multiple architectures, such as X86 (The X86 architecture), AMD, PowerPC (Performance Optimization With EnhancedRISC-Performance Computing), etc. However, QEMU is not friendly enough to Windows, and does not support uncommon frameworks. Therefore, embedded debugging of uncommon chips or self-developed chips can often only be performed on embedded hardware.
[0003] As can be seen from the above, in the process of hardware simulation, how to reduce the complexity of hardware debugging, effectively improve the flexibility of hardware debugging, increase the efficiency of hardware debugging, and reduce the cost of hardware debugging are problems to be solved in this field. Summary of the invention
[0004] In view of this, the purpose of the present invention is to provide a hardware simulation method, device, equipment and medium, which can reduce the complexity of hardware debugging, effectively improve the flexibility of hardware debugging, increase the efficiency of hardware debugging, and reduce the cost of hardware debugging. The specific scheme is as follows:
[0005] In a first aspect, the present application discloses a hardware simulation method, comprising:
[0006] Create simulation modules with different hardware simulation functions through different threads;
[0007] Determine each target hardware function of the embedded hardware to be simulated, determine each target simulation module from the simulation module according to each target hardware function, and use each target simulation module to construct each simulation hardware and each simulation interface having the same function as each target hardware;
[0008] Determine each target simulation program according to the function of each target hardware, and import each target simulation program into each target simulation module, so as to run each simulation hardware and each simulation interface by using each target simulation program.
[0009] Optionally, the creating simulation modules with different hardware simulation functions respectively through different threads includes:
[0010] Creating each simulation module through different threads respectively, and determining the function of each simulation module according to business requirements;
[0011] Using a preset tool creation method and based on the function of the simulation module, adding a corresponding simulation tool to the simulation module, and saving the simulation tool to the simulation module;
[0012] Accordingly, the use of the target simulation modules to construct simulation hardware and simulation interfaces having the same functions as the target hardware includes:
[0013] The simulation tools in the target simulation modules are used to construct simulation hardware and simulation interfaces having the same functions as the target hardware.
[0014] Optionally, after determining each target simulation module from the simulation modules according to each target hardware function, the method further includes:
[0015] Determine the number of CPUs in the embedded hardware to be simulated, and determine the number of main threads according to the number of CPUs to obtain a target main thread, so as to use the target main thread to run each simulation module;
[0016] Furthermore, the step of importing each target simulation program into each target simulation module includes:
[0017] Determine a target secondary thread from all pre-established secondary threads;
[0018] The target sub-thread is used to import the target simulation programs into the target simulation modules.
[0019] Optionally, determining the target secondary thread from all pre-established secondary threads includes:
[0020] Filtering the target sub-threads required for importing the target simulation programs into the target simulation modules from all pre-established sub-threads through a preset filtering interface for users;
[0021] Or, the target sub-threads required for importing the target simulation programs into the target simulation modules are selected from all pre-established sub-threads by random selection.
[0022] Optionally, the importing of each target simulation program into each target simulation module includes:
[0023] Using a preset program input interface to obtain each target simulation program corresponding to each target hardware function, and saving each target simulation program to each simulation module;
[0024] Alternatively, the simulation programs already imported into the other simulation modules are obtained to obtain the target simulation programs, and the target simulation programs are saved in the simulation modules.
[0025] Optionally, the hardware simulation method further includes:
[0026] Adding data interfaces to all the simulation modules;
[0027] The data information in each target simulation module is viewed or modified through business requirements and the data interface.
[0028] Optionally, after using the target simulation programs to run the simulation hardware and the simulation interfaces, the method further includes:
[0029] Acquire the automation data information to be tested by using a preset information acquisition interface, and determine the data to be tested according to the automation data information to be tested and determine the corresponding simulation module to be tested from the target simulation modules;
[0030] The test data is imported into the test simulation module and run to obtain the automated test result.
[0031] In a second aspect, the present application discloses a hardware simulation device, comprising:
[0032] A simulation module creation module is used to create simulation modules with different hardware simulation functions through different threads;
[0033] A simulation hardware construction module, used to determine each target hardware function of the embedded hardware to be simulated, determine each target simulation module from the simulation module according to each target hardware function, and use each target simulation module to construct each simulation hardware and each simulation interface with the same function as each target hardware;
[0034] The simulation hardware running module is used to determine each target simulation program according to the functions of each target hardware, and import each target simulation program into each target simulation module, so as to use each target simulation program to run each simulation hardware and each simulation interface.
[0035] In a third aspect, the present application discloses an electronic device, comprising:
[0036] Memory, used to store computer programs;
[0037] The processor is used to execute the computer program to implement the aforementioned hardware simulation method.
[0038] In a fourth aspect, the present application discloses a computer storage medium for storing a computer program; wherein, when the computer program is executed by a processor, the steps of the aforementioned disclosed hardware simulation method are implemented.
[0039] It can be seen that the present application provides a hardware simulation method, including creating simulation modules with different hardware simulation functions through different threads; determining each target hardware function of the embedded hardware to be simulated, determining each target simulation module from the simulation module according to the target hardware function, and using the target simulation module to construct each simulation hardware and each simulation interface with the same function as the target hardware; determining each target simulation program according to the target hardware function, and importing each target simulation program into each target simulation module, so as to use the target simulation program to run each simulation hardware and each simulation interface. The present application creates different simulation modules through different threads to simulate the embedded hardware to be simulated so as to obtain each simulation hardware and each simulation interface with the same function as the embedded hardware to be simulated, which can effectively reduce the complexity of hardware debugging, improve the flexibility of hardware debugging, and use each simulation hardware and each simulation interface for hardware debugging, which can effectively increase the efficiency of hardware debugging and reduce the cost of hardware debugging. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0041] Figure 1 A flowchart of a hardware simulation method disclosed in this application;
[0042] Figure 2 A flowchart of a hardware simulation method disclosed in this application;
[0043] Figure 3 A schematic diagram of the structure of a hardware simulation device disclosed in this application;
[0044] Figure 4 A structural diagram of an electronic device provided for this application. DETAILED DESCRIPTION
[0045] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions 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 are within the scope of protection of the present invention.
[0046] In the current context, QEMU is a very powerful simulator that supports multiple architectures, including X86 (The X86 architecture), AMD, PowerPC (Performance Optimization With EnhancedRISC–Performance Computing), etc. However, QEMU is not friendly enough to Windows and does not support uncommon frameworks. Therefore, embedded debugging of uncommon chips or self-developed chips can often only be performed on embedded hardware. As can be seen from the above, in the process of hardware simulation, how to reduce the complexity of hardware debugging, effectively improve the flexibility of hardware debugging, increase the efficiency of hardware debugging, and reduce the cost of hardware debugging are problems to be solved in this field.
[0047] See also Figure 1 As shown, the embodiment of the present invention discloses a hardware simulation method, which may specifically include:
[0048] Step S11: creating simulation modules with different hardware simulation functions respectively through different threads.
[0049] In this embodiment, each simulation module is created separately through different threads, and the function of each simulation module is determined according to business requirements; a preset tool creation method is used to add corresponding simulation tools to the simulation module based on the function of the simulation module, and the simulation tool is saved to the simulation module.
[0050] Step S12: Determine each target hardware function of the embedded hardware to be simulated, determine each target simulation module from the simulation module according to the target hardware function, and use the target simulation modules to construct each simulation hardware and each simulation interface having the same function as the target hardware.
[0051] In this embodiment, the target hardware functions of the embedded hardware to be simulated are determined, and then the number of CPUs in the embedded hardware to be simulated is determined, and the number of main threads is determined based on the number of CPUs to obtain the target main thread, so as to use the target main thread to run the simulation modules, and then the target simulation modules are determined from the simulation modules based on the target hardware functions, and the simulation hardware and simulation interfaces with the same functions as the target hardware are constructed using the target simulation modules.
[0052] Step S13: Determine each target simulation program according to the function of each target hardware, and import each target simulation program into each target simulation module, so as to use each target simulation program to run each simulation hardware and each simulation interface.
[0053] In this embodiment, after determining each target simulation program according to the functions of each target hardware, a target sub-thread is determined from all pre-established sub-threads, and then the target sub-thread is used to import the target simulation program into each target simulation module, so that the simulation tools in the above-mentioned target simulation modules can be used to construct simulation hardware and simulation interfaces with the same functions as the target hardware.
[0054] In this embodiment, there are two methods for determining the target sub-thread from all pre-established sub-threads, including: filtering out the target sub-threads required for importing the target simulation programs into the target simulation modules from all pre-established sub-threads through a preset user-oriented filtering interface; or, filtering out the target sub-threads required for importing the target simulation programs into the target simulation modules from all pre-established sub-threads through a random screening method.
[0055] In this embodiment, simulation modules with different hardware simulation functions are created respectively through different threads; each target hardware function of the embedded hardware to be simulated is determined, and each target simulation module is determined from the simulation module according to the target hardware function, and each simulation hardware and each simulation interface with the same function as the target hardware are constructed by using the target simulation module; each target simulation program is determined according to the target hardware function, and each target simulation program is imported into the target simulation module, so as to run each simulation hardware and each simulation interface by using the target simulation program. This application creates different simulation modules through different threads to simulate the embedded hardware to be simulated so as to obtain each simulation hardware and each simulation interface with the same function as the embedded hardware to be simulated, which can effectively reduce the complexity of hardware debugging, improve the flexibility of hardware debugging, and use each simulation hardware and each simulation interface for hardware debugging, which can effectively increase the efficiency of hardware debugging and reduce the cost of hardware debugging.
[0056] See also Figure 2 As shown, the embodiment of the present invention discloses a hardware simulation method, which may specifically include:
[0057] Step S21: creating simulation modules with different hardware simulation functions through different threads.
[0058] Step S22: determine the target hardware functions of the embedded hardware to be simulated, determine the target simulation modules from the simulation modules according to the target hardware functions, and use the target simulation modules to construct simulation hardware and simulation interfaces with the same functions as the target hardware.
[0059] Step S23: determining each target simulation program according to each target hardware function, and importing each target simulation program into each target simulation module.
[0060] Step S24: Use the preset information acquisition interface to obtain the automation data information to be tested, and determine the data to be tested based on the automation data information to be tested and determine the corresponding simulation module to be tested from the target simulation modules, import the data to be tested into the simulation module to be tested and use the simulation program corresponding to the simulation module to be tested to run the simulation module to be tested to obtain the automation test results.
[0061] In this embodiment, it may also include, after creating simulation modules with different hardware simulation functions through different threads, adding data interfaces for all the simulation modules, and then viewing or modifying the data information in each target simulation module through business needs and the data interface.
[0062] In this embodiment, simulation modules with different hardware simulation functions are created respectively through different threads; each target hardware function of the embedded hardware to be simulated is determined, and each target simulation module is determined from the simulation module according to the target hardware function, and each simulation hardware and each simulation interface with the same target hardware function is constructed by using the target simulation module; each target simulation program is determined according to the target hardware function, and each target simulation program is imported into the target simulation module; the automation data information to be tested is obtained by using a preset information acquisition interface, and the data to be tested is determined according to the automation data information to be tested and the corresponding simulation module to be tested is determined from the target simulation modules, the data to be tested is imported into the simulation module to be tested, and the simulation program corresponding to the simulation module to be tested is used to run the simulation module to be tested to obtain the automation test result. The present application creates different simulation modules through different threads to simulate the embedded hardware to be simulated so as to obtain various simulation hardware and simulation interfaces with the same functions as the embedded hardware to be simulated, which can effectively reduce the complexity of hardware debugging and improve the flexibility of hardware debugging. By using various simulation hardware and simulation interfaces for hardware debugging, the efficiency of hardware debugging can be effectively increased and the cost of hardware debugging can be reduced.
[0063] For example, the simulation modules with different hardware simulation functions include: message scheduling module, hardware acceleration module, data storage module, human-computer interaction module, etc. The message scheduling module is responsible for message scheduling between modules and realizes message transmission between modules. The hardware acceleration module simulates the operation of processor hardware peripherals and embedded hardware units independently of the CPU (Central Processing Unit), solves the problem that embedded applications need to access hardware peripheral resources, and realizes functions such as embedded hardware interface or hardware acceleration. The hardware simulation unit realizes data interaction through an interface consistent with the hardware driver interface, ensuring that the application can be directly transplanted to the hardware platform. The data storage module can save system data and logs, support file storage, binary data storage, and can also transplant embedded databases. Because it is separated from embedded hardware, any system operation status or data can be conveniently and directly viewed and modified. The human-computer interaction module mainly realizes human-computer interaction, supports different input commands or data, receives and saves software operation results, etc., and supports mainstream input and output devices to meet various data output requirements of embedded platforms, and can directly connect with third-party test software for data interaction. The simulation module is separated from the embedded device and can be debugged independently on a PC (personal computer). The PC can have more methods and tools to locate bugs, and various open source test frameworks can be transplanted for automated testing.
[0064] See also Figure 3 As shown, the embodiment of the present invention discloses a hardware simulation device, which may specifically include:
[0065] A simulation module creation module 11, used to respectively create simulation modules with different hardware simulation functions through different threads;
[0066] The simulation hardware construction module 12 is used to determine each target hardware function of the embedded hardware to be simulated, determine each target simulation module from the simulation module according to each target hardware function, and use each target simulation module to construct each simulation hardware and each simulation interface having the same function as each target hardware;
[0067] The simulation hardware running module 13 is used to determine each target simulation program according to the functions of each target hardware, and import each target simulation program into each target simulation module, so as to run each simulation hardware and each simulation interface by using each target simulation program.
[0068] In this embodiment, simulation modules with different hardware simulation functions are created respectively through different threads; each target hardware function of the embedded hardware to be simulated is determined, and each target simulation module is determined from the simulation module according to the target hardware function, and each simulation hardware and each simulation interface with the same function as the target hardware are constructed by using the target simulation module; each target simulation program is determined according to the target hardware function, and each target simulation program is imported into the target simulation module, so as to run each simulation hardware and each simulation interface by using the target simulation program. This application creates different simulation modules through different threads to simulate the embedded hardware to be simulated so as to obtain each simulation hardware and each simulation interface with the same function as the embedded hardware to be simulated, which can effectively reduce the complexity of hardware debugging, improve the flexibility of hardware debugging, and use each simulation hardware and each simulation interface for hardware debugging, which can effectively increase the efficiency of hardware debugging and reduce the cost of hardware debugging.
[0069] In some specific embodiments, the simulation module creation module 11 may specifically include:
[0070] A simulation module creation module, used to create each simulation module through different threads, and determine the function of each simulation module according to business requirements;
[0071] A simulation tool adding module is used to add corresponding simulation tools to the simulation module based on the functions of the simulation module by using a preset tool creation method, and save the simulation tool to the simulation module.
[0072] In some specific embodiments, the simulation hardware construction module 12 may specifically include:
[0073] The simulation hardware construction module is used to use the simulation tools in the target simulation modules to construct simulation hardware and simulation interfaces with the same functions as the target hardware.
[0074] In some specific embodiments, the simulation hardware construction module 12 may specifically include:
[0075] The target main thread determination module is used to determine the number of CPUs in the embedded hardware to be simulated, and determine the number of main threads according to the number of CPUs to obtain the target main thread, so as to use the target main thread to run each simulation module.
[0076] In some specific embodiments, the simulation hardware running module 13 may specifically include:
[0077] A target secondary thread determination module, used to determine a target secondary thread from all pre-established secondary threads;
[0078] The target simulation program importing module is used to import each target simulation program into each target simulation module by using the target secondary thread.
[0079] In some specific embodiments, the target simulation program import module may specifically include:
[0080] An interface import module, used for acquiring the target simulation programs corresponding to the target hardware functions by using a preset program input interface, and saving the target simulation programs to the simulation modules;
[0081] Other simulation module import modules are used to obtain the simulation programs that have been imported into other simulation modules to obtain the target simulation programs, and save the target simulation programs to the simulation modules.
[0082] In some specific embodiments, the target secondary thread determination module may specifically include:
[0083] A screening module, used for screening out target sub-threads required for importing the target simulation programs into the target simulation modules from all pre-established sub-threads through a preset screening interface for users;
[0084] The random screening module is used to screen out the target sub-threads required when importing the target simulation programs into the target simulation modules from all pre-established sub-threads by random screening.
[0085] In some specific embodiments, the simulation hardware running module 13 may specifically include:
[0086] A data interface adding module, used for adding data interfaces to all the simulation modules;
[0087] The data viewing module is used to view or modify the data information in each target simulation module according to business requirements and the data interface.
[0088] In some specific embodiments, the simulation hardware running module 13 may specifically include:
[0089] A data information acquisition module, used for acquiring the automation data information to be tested by using a preset information acquisition interface, and determining the data to be tested according to the automation data information to be tested and determining the corresponding simulation module to be tested from the target simulation modules;
[0090] The simulation running module is used to import the test data into the test simulation module and run it to obtain the automated test results.
[0091] Figure 4A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 is used to store a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the hardware simulation method performed by the electronic device disclosed in any of the aforementioned embodiments.
[0092] In this embodiment, the power supply 23 is used to provide working voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and the external device, and the communication protocol it follows is any communication protocol that can be applied to the technical solution of the present application, and is not specifically limited here; the input and output interface 25 is used to obtain external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs and is not specifically limited here.
[0093] In addition, the memory 22, as a carrier for storing resources, can be a read-only memory, a random access memory, a disk or an optical disk, etc. The resources stored thereon include an operating system 221, a computer program 222 and data 223, etc. The storage method can be temporary storage or permanent storage.
[0094] Among them, the operating system 221 is used to manage and control the hardware devices and computer programs 222 on the electronic device 20 to realize the operation and processing of the data 223 in the memory 22 by the processor 21, which can be Windows, Unix, Linux, etc. In addition to including a computer program that can be used to complete the hardware simulation method performed by the electronic device 20 disclosed in any of the aforementioned embodiments, the computer program 222 can further include a computer program that can be used to complete other specific tasks. In addition to data received by the hardware simulation device and transmitted from an external device, the data 223 can also include data collected by its own input and output interface 25, etc.
[0095] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0096] Furthermore, an embodiment of the present application also discloses a computer-readable storage medium, in which a computer program is stored. When the computer program is loaded and executed by a processor, the steps of the hardware simulation method disclosed in any of the aforementioned embodiments are implemented.
[0097] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0098] The above is a detailed introduction to a hardware simulation method, device, equipment and storage medium provided by the present invention. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea; at the same time, for a general technician in this field, according to the idea of the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.
Claims
1. A hardware simulation method, characterized in that: include: Create simulation modules with different hardware simulation functions through different threads; Determine each target hardware function of the embedded hardware to be simulated, determine each target simulation module from the simulation module according to each target hardware function, and use each target simulation module to construct each simulation hardware and each simulation interface having the same function as each target hardware; Determine each target simulation program according to the function of each target hardware, and import each target simulation program into each target simulation module, so as to run each simulation hardware and each simulation interface by using each target simulation program; The method of creating simulation modules with different hardware simulation functions respectively through different threads includes: creating each simulation module respectively through different threads, and determining the function of each simulation module according to business requirements; adding corresponding simulation tools to the simulation modules based on the functions of the simulation modules by using a preset tool creation method, and saving the simulation tools to the simulation modules; Correspondingly, the use of the target simulation modules to construct the simulation hardware and simulation interfaces with the same functions as the target hardware includes: using the simulation tools in the target simulation modules to construct the simulation hardware and simulation interfaces with the same functions as the target hardware; After determining each target simulation module from the simulation module according to each target hardware function, the method further includes: determining the number of CPUs in the embedded hardware to be simulated, and determining the number of main threads according to the number of CPUs to obtain a target main thread, so as to use the target main thread to run each simulation module; Furthermore, the step of importing the target simulation programs into the target simulation modules includes: determining a target sub-thread from all pre-established sub-threads; and importing the target simulation programs into the target simulation modules using the target sub-thread.
2. The hardware simulation method according to claim 1, characterized in that: The step of determining the target secondary thread from all pre-established secondary threads includes: Filtering the target sub-threads required for importing the target simulation programs into the target simulation modules from all pre-established sub-threads through a preset filtering interface for users; Or, the target sub-threads required for importing the target simulation programs into the target simulation modules are selected from all pre-established sub-threads by random selection.
3. The hardware simulation method according to claim 1, characterized in that: The step of importing each target simulation program into each target simulation module comprises: Using a preset program input interface to obtain each target simulation program corresponding to each target hardware function, and saving each target simulation program to each simulation module; Alternatively, the simulation programs already imported into the other simulation modules are obtained to obtain the target simulation programs, and the target simulation programs are saved in the simulation modules.
4. The hardware simulation method according to claim 1, characterized in that: Also includes: Adding data interfaces to all the simulation modules; The data information in each target simulation module is viewed or modified through business requirements and the data interface.
5. The hardware simulation method according to any one of claims 1 to 4, characterized in that: After using the target simulation programs to run the simulation hardware and the simulation interfaces, the method further includes: Acquire the automation data information to be tested by using a preset information acquisition interface, and determine the data to be tested according to the automation data information to be tested and determine the corresponding simulation module to be tested from the target simulation modules; The test data is imported into the test simulation module and run to obtain the automated test result.
6. A hardware simulation device, characterized in that: include: A simulation module creation module is used to create simulation modules with different hardware simulation functions through different threads; A simulation hardware construction module, used to determine each target hardware function of the embedded hardware to be simulated, determine each target simulation module from the simulation module according to each target hardware function, and use each target simulation module to construct each simulation hardware and each simulation interface with the same function as each target hardware; A simulation hardware running module, used for determining each target simulation program according to the functions of each target hardware, and importing each target simulation program into each target simulation module, so as to run each simulation hardware and each simulation interface by using each target simulation program; The simulation module creation module is specifically used to create each simulation module through different threads, and determine the function of each simulation module according to business requirements; use a preset tool creation method and add a corresponding simulation tool to the simulation module based on the function of the simulation module, and save the simulation tool to the simulation module; Correspondingly, the simulation hardware construction module is specifically used to use the simulation tools in the target simulation modules to construct various simulation hardware and simulation interfaces with the same functions as the target hardware; The device is further used to determine the number of CPUs in the embedded hardware to be simulated, and determine the number of main threads according to the number of CPUs to obtain a target main thread, so as to use the target main thread to run each simulation module; Furthermore, the simulation hardware running module is specifically used to determine a target secondary thread from all pre-established secondary threads; The target sub-thread is used to import the target simulation programs into the target simulation modules.
7. An electronic device, characterized in that: include: Memory, used to store computer programs; A processor, configured to execute the computer program to implement the hardware simulation method according to any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that: Used to store a computer program; wherein, when the computer program is executed by a processor, the hardware simulation method according to any one of claims 1 to 5 is implemented.
