Embedded computing rarely works in isolation. While personal computers and consumer electronics can usually work independently with relatively infrequent human intervention, most embedded computers work closely with the world around them. They "feel" it, execute control algorithms, read out the sensor readings, use all kinds of actuators to change the external environment. They are active participants in a continuously evolving cyber-physical reality. The simulation of such systems can not be limited to the model of an isolated digital computer - you have to make part of the physical world into it. The following video on Youtube demonstrates how this can be done with Wind River Simics.
Also available are several clips published by NASA (National Aero Space Agency), demonstrating how Simics is involved in a truly full- platform simulation in the Global Precipitation Measurement project. ')
For the video presented above, the following configuration was recreated.
The main elements are: control console, board with installed VxWorks OS and control application, water heater (kettle). The control is carried out with the help of an actuator that changes the power supplied to the heating element in the kettle. The program makes decisions based on the readings of the current water temperature, measured by a thermometer. A thermometer and a heater are connected to analog-digital (ADC) and digital-analog (DAC) converters, respectively, which are located on the embedded computer board. Details of how the simulation of devices in general occurs in Simics are described in another post . The control program has access only to the ADC and DAC, as it happens in real systems. Simulation of physical processes is done inside Simics; it is implemented using the built-in Python interpreter and the Simics API.
Due to the fact that the physical model is introduced into the simulation, it becomes possible to reverse the time, inspect the state of its parts and control it through the Simics graphical interface. An additional feature not shown in the video is setting breakpoints for events in the simulation, such as boiling water or burning a kettle (I apologize for the spoiler). In practice, this scheme is quite often implemented: the physical model is executed outside Simics in an already written third-party program, and then some connector is written between it and Simics, inside which the digital part of the model is represented. This demo physical system presents so-called. a system panel located next to the display of the control computer and a panel that allows artificially initiate errors (i.e., conduct fault injection).
Note: Since version 4.8, the default Simics interface is based on Eclipse.
Some features of the mechanism of injection injection is demonstrated in the video; This configuration also allows you to explore some other scenarios. The model of the physical system is written in such a way that it allows noise to be brought into the temperature sensor so that it reports distorted values ​​or even freezes its readings altogether. You can change the height of the kettle above sea level, and this affects the boiling point of water. The heater can be fixed at some power. All this allows you to test the reliability of software in the presence of the possibility of a variety of problems, without the need to search for boundary conditions by analytical methods or modification of real equipment (ie, a kettle).
Simulator NASA and Simics
Simics users can put giant systems into the simulation, representing physical, mechanical, and control algorithms. These simulations are often also huge, performed on dozens of different host systems and connected with the help of specialized middleware. Using the API provided by the Simics Extension Builder package, it becomes possible to integrate Simics with almost any third-party system.
A notable example of such integration is the work published by NASA ( NASA IV & V Success Story on Youtube). The NASA Go-Sim installation ( another video on Youtube) used a combination of Simics simulated control computer and its own design for modeling physical processes. To connect the sensors and actuators of the spacecraft with the control computer, tires 1553 and Spacewire were used. In this case, the messages passing through them can be intercepted and modified in order to test the reliability of the software in the presence of interference ( another video ).