1.1 Introduction
Embedded and cyber-physical systems have become ubiquitous in our everyday life, including consumer electronics, transportation, control, industry automation, energy grids, medical equipment and defence systems. Their timely development has become a key to economic success in many business areas. An inherent property of embedded systems is that they combine hardware and software into a coherent apparatus that serves some dedicated function, e.g. a camera taking pictures, or a train braking system. Also, more and more devices have turned from being standalone to networked, communicating systems, which necessitate the adjunct of communication hardware and software to the embedded platforms.
As a corollary of these evolutions, at the beginning of a project (to design a new system) the separation may not be clearly defined yet between which system functions will be performed by hardware or by software. This hardware/software partitioning may be decided based on large number of factors, including performance, flexibility and costs, as the result of an investigation and early prototyping phase. Independently of all these considerations, there is market pressure to decrease their development time and costs, despite increasing safety and security requirements for the manufacturers, for example in transportation, industrial process control or defence. Crucially, this includes both functional as well as non-functional requirements, i.e. requirements on the behavior of a system at its outputs as a function of its inputs, as well as quality attributes such as real-time performance, power consumption or reliability.
All these issues call for development tools that can help the designers to decide the optimal hardware and software combination, to validate the software functionality, to estimate overall performance, and to validate that the resulting product verifies the required properties in timely fashion. Among available design automation approaches, simulations continue to play a vital role. A simulator provides an executable, virtual model of a candidate design that allows emulating the evolution of behavior over time and under different inputs before a system is built, i.e. for candidate designs that may not yet physically exist. Given the inherently dynamic nature of complex systems today, being able to rapidly observe and evaluate their time-varying behavior at early design stages can be crucial feedback for designers. As such, virtual prototyping as presented in this chapter is a key tool, although it is certainly not the only one available.
This chapter is aimed at providing an overview and survey of issues and solutions in virtual prototyping of embedded computer systems. The main concern in all virtual prototyping is to find the right abstractions that will allow optimally navigating fundamental tradeoffs between applicability, accuracy, development costs and simulation speed. The rest of the chapter is organized as follows: After an overview of general virtual prototyping objectives and issues in Sect..
1.2 Virtual Prototyping
Engineering projects aim at constructing a device, or an ensemble of devices, that performs some function. The goal is to elaborate the object, including hardware, software, and the mechanical parts, and later to manufacture this object on a production line. In the past, engineers have been making physical prototypes of such devices by creating or assembling the hardware parts, writing the software programs running on the hardware, and testing whether the prototype would satisfy the requirements. When it does not, they would construct a second prototype, and so on, until the device is ready for manufacturing. This is a long and tedious process, slowing down time to market, and because the number of actual prototypes is limited, only a handful of engineers can work concurrently.
Computer modeling technologies in 3D, mechanics and electronics have become powerful enough that one can build a virtual prototype , that is, a virtual device that can be tested and validated in simulation. In this chapter, we use the term virtual prototyping to refer to technology that provides an emulation of an embedded computer system represented by executable hardware and software models that capture most, if not all, of the required properties of a final system. The real application software can be run over the virtual prototype of the hardware platform and produce the same results as the real device with the same sequence of outputs. The virtual prototype of the complete system under design can then be run and tested like the real one, where engineers can exercise and verify the desired device properties. However, a key challenge is that the virtual prototype includes enough detail to faithfully and accurately replicate the behavior of the modeled system. This in turn directly influences the speed at which the prototype can be run. Ideally, it should do so in about the same time frame as the real system and also report non-functional properties such as performance measurements, power consumption, thermal dissipation, etc.
The goal of virtual prototyping is to verify that required functional and non-functional properties of the system are satisfied. In a number of cases, it happens that verifying properties on a virtual platform is more advantageous than on the real hardware. This includes:
Observing and checking system properties
Sometimes one would like to observe the system internally without disturbing the device functions. In a number of cases, adding software to observe the system modifies its behavior. For example, to test that the memory usage of an embedded application is correct, one has to track the memory operations using instrumented code and this introduces changes in the application behavior, and possibly also the real target platform cannot support such instrumentation. A virtual prototype makes it possible to add non-intrusive software probes in the simulation model itself. This can include observation of hardware behavior, e.g. to monitor the memory consumption as each memory access can be tracked. Also, many software defects stem from hardware not being correctly initialized. Whereas it is hard to check this on the real platform, it is easy to verify initialization assertions in a virtual platform. Finally, in a virtual simulation, time can be stopped to observe the global system at a particular point in execution. This is difficult if not impossible to achieve in the physical world. Even if one system component is stopped, e.g. in a debugger, other components and the external environment will continue to run.