“Digital Twin”: Why emulate Embedded Systems?
What is Simulation?
The concept of simulation is broad in scope, but in essence,it all refers to simulating the real physical world in a controlled way. It is typically applied to scenarios which are challenging or even impossible to implement in the real world.
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 efficiency, precisely meeting the required specifications, with the advantages of low power consumption, small size, and high integration.Additionally,it should also possess high real-time performance and reliability.
As the complexity of embedded systems surges, 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 these scenarios, the following benefits can be achieved:
software development, testing, and debugging in advance
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 will not be affected by external factors, the results are more accurate and reliable.
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 a simulation tool called "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 with SkyEye
This case demonstrates 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.
Second, 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.