“Digital Twin”: Why emulate Embedded Systems?
What is Simulation?
The concept of simulation is broad, ultimately it involves simulating the real physical world in a controlled way. It is typically applied to scenarios that are difficult or even impossible to implement in the real.
It is well known that embedded systems are usually a combination of software and hardware with various forms and oriented to specific applications. Both the software and hardware must be designed with high efficiency, tailored, redundancy removed, low power consumption, small size, high integration, and often have high requirements for real-time performance and reliability.
With the increasing complexity of embedded systems, simulation has become the mainstream solution for developing embedded systems. Embedded systems with the following conditions are particularly suited for simulation:
Hardware is scarce, under development, or developing slowly.
High hardware cost.
High security and high reliability requirements.
By applying simulation in this scenario, the following benefits can be achieved:
Early software development, testing, and debugging
Testing other devices connected to the hardware
Significant cost savings
……
Simulation can be applied to the entire lifecycle of embedded systems, from early design to production and maintenance. The simulation process of embedded systems is a crucial part of "digital twins."According to IBM's definition, A digital twin is a virtual representation of an object or system designed to reflect a physical object accurately. It spans the object's lifecycle, is updated from real-time data and uses simulation, machine learning and reasoning to help make decisions. The digital twin is the pinnacle of simulation applications. At every stage of digital twin maturity, simulation plays an indispensable role.
Advantages of Simulation
Efficiency improvement
Embedded system developers cannot test the correctness and rationality of software design without the support of actual equipment during development. Simulation tools are used to debug the algorithmic logic, focusing more on possible physical limitations or errors. Hardware-independent deep testing can greatly improve the development efficiency of embedded systems and shorten the development cycle.
Controlling Test Environment
Simulating embedded systems provides an efficient and controllable test environment. The simulation environment can be reset at any time, quickly generating new test results without waiting for lengthy hardware resets or adjustments. Moreover, a fully digital simulation environment is not affected by external factors, ensuring more accurate and reliable results.
Debugging capability improvement
Simulation is not influenced by external physical factors when an embedded system encounters problems, allowing for faster identification of whether the issue lies in the software or hardware. If errors occur while testing on both embedded devices and simulators, the problem likely resides in the algorithm. If the error occurs only on the device, it may indicate a hardware issue.
The following table is the comparison of dynamic test data of an audio equipment software in the article "Design and Implementation of an all-digital simulation test System for Aviation Airborne Software". The execution time for full-digital simulation testing and regression testing is significantly reduced compared to a fully physical testing environment, while the number of test cases and software issues identified are identical. The full-digital simulation testing used SkyEye.
"Digital Twin" — Choosing the Right Simulation Tool
Although simulation is an excellent tool for developing embedded systems, if the simulation tool lacks precision, any tests conducted may backfire. This could not only fail to shorten the development cycle but even extend the planned schedule. Therefore, choosing the right simulation tool is a prerequisite for applying simulation.
SkyEye, also known as Tianmu Full-Digital Real-Time Simulation Software, is a virtual platform for simulating embedded target systems. It can fully simulate the CPU (Central Processing Unit), registers, memory, and peripheral interfaces of the target system.
Running embedded software on SkyEye produces the same effect as running it on the actual target system. SkyEye also supports multiple features such as:
Checkpoint analysis: by inserting checkpoints, the software's runtime state can be saved, allowing playback analysis to help locate software issues.
Access to the target system status: it is often difficult for testers to track and control the registers or status registers of physical hardware, but with SkyEye simulation, the internal state of the target system is clearly visible, aiding in troubleshooting.
Case Study: Digital Twins of Satellites
This case studydemonstrates how SkyEye is used to build a digital satellite prototype. First, by analyzing the system-level architecture and splitting it into subsystems, simulation models for different modules are established. SkyEye simulates the embedded processor and peripherals. Then, by using a simulation soft bus to link various distributed models, a digital satellite can be constructed. Twin data generated from real satellite operations is then input into the "digital satellite" for ultra-real-time simulation. Through visual application services, users can analyze the simulation results to predict the future trajectory of the real satellite, make decisions, and optimize the physical entity accordingly.