Select Page

The Simulation Game – it's all a matter of interpretation

Specifying and simulating embedded systems using models

Author: Dr. Klaus Birken, itemis AG

Contribution – Embedded Software Engineering Congress 2016

The crucial question for embedded engineers is: Can the software run on the hardware without exceeding its capabilities? The software must implement all necessary functions while making optimal use of the hardware. The product's economic viability is primarily determined by hardware costs; this is especially true for products manufactured and sold in high volumes.

This article presents a method and a corresponding tool for modeling and simulating the interaction between hardware and software. This can be done during the development process, even before prototypes exist and software implementation is still in the future. Regardless of any changes the systems engineer makes to the software or hardware model, the tool displays the effects directly and in real time. This enables an interactive, playful approach to system design.

Development of embedded software and systems

Today's embedded products are rich in features and functions. This makes the necessary system architecture, software architecture, and the actual implementation increasingly complex and challenging for architects and developers. Very early in the development process, one of the key questions is whether the planned hardware design is powerful enough to cover all software scenarios. If, later in development, it is discovered that the installed hardware is insufficient to implement certain product features, there are, at best, only a few costly options left to salvage the project. These include removing features, extensive software optimizations, or hardware upgrades.

In markets characterized by high unit sales, the above question becomes all the more interesting and pressing. There, the company's profit depends significantly on the hardware costs per unit (so-called...). bill of materialThis leads to a tendency to design the hardware very conservatively from the outset. At the same time, it is usually difficult to change the hardware at short notice in these markets. Thus, the problem mentioned above is compounded.

How can architects and systems engineers increase the confidence that software and hardware design will be compatible before the system is fully implemented? A very common approach is to extrapolate experience from previous projects, that is, to intuitively or systematically apply the know-how built up over years to new projects. This usually involves using generic tools such as Excel spreadsheets to estimate performance, resource utilization, and timing for the most demanding use cases of the new product.

This approach is highly dependent on the skills and experience of the engineers involved. Considering the static system structure (i.e., architecture) is insufficient to assess resource consumption during dynamic processes. Therefore, in an ad-hoc solution (e.g., using Excel spreadsheets), the dynamic processes must be represented in tabular form; the developer invents a new method for each analysis. This paper proposes an alternative approach: By combining software and hardware modeling at an early stage with the use of a simulation tool, the engineer is enabled to create a functional system model and perform the necessary analyses on it (so-called...). design space exploration).

Objectives of simulating system models

The methodology and associated tool described here offer the following analysis possibilities:

  • Architectural decisions can be evaluated as early as possible.
  • Timing requirements can be investigated without implementing the system beforehand.
  • Design flaws can be detected early.
  • Throughout the entire development period, it can be verified whether the system behaves according to the planned architectural decisions.
  • In later development phases, optimizations can be evaluated before they are actually implemented.

The above options always include both the software and hardware sides.

Fig. 1 (see PDFThis demonstrates the interaction with an executable model: Due to the higher level of abstraction of the model (i.e., it simulates abstract, modeled behavior rather than code), the simulation can be run with every model change. This makes the effects of design decisions immediately visible, for both software and hardware changes. When working with a real embedded system, it usually takes several minutes for the effect of a software change to become apparent; hardware changes can only be evaluated at all, and then only with considerable effort, in the form of prototypes.

How are executable models created in the early stages?

To enable a system to be modeled in such a way that it can be executed using a simulator as early as the analysis phase, suitable abstractions must be introduced. The hardware is thereby reduced to a few model concepts, each of which is modeled by the smallest possible set of parameters:

  • Microcontrollers and processors are modeled using a power factor, the number of cores, and, if applicable, information on priorities and scheduling.
  • Networks, communication links, hard drives or flash modules are categorized under the concept of bandwidth-limited resources In summary, such resources are described by their bandwidth, their impact on CPU times, and a factor for context-switching costs.
  • Finally, Pool resources such as main memory or countable, limited resources, defined by their size or number.

The above information can either be defined for a specific model, extrapolated from previous projects, or determined via simple benchmarks.

The software structure is modeled as a hierarchy of communicating components. Each component instance can define one or more processes that are triggered externally. Fig. 2 (see PDFFigure 1 shows, as an example, the modeling of the startup behavior of a media server component, e.g., from an entertainment system. A sequence of steps is defined for each process; the resource consumption is specified for each step.

Modeling of product lines

The methodology described here also supports the description of product lines. This means that the executable models describe not just a single project, but an entire product family or a set of product variants. This is achieved through feature models (see Fig. 3, PDFThe product line can be structured to control certain aspects of the model depending on selected features of a specific product configuration for the simulation. Fig. 4 (see PDF) demonstrates this using the example of a model parameter.

How are the results of simulation and analysis presented?

An important characteristic for the successful use of this methodology is that the tool used immediately displays the simulation results back in mode. This can happen in a variety of ways.

Fig. 5 (see PDFThis shows how timing results from the simulation are displayed as part of the modeled processes. If the tool detects problems in the dynamic process (e.g., a large delay along the critical path), these are also displayed. If the user changes the modeled process, the simulation is rerun in the background, so that the timing values always reflect the current state of the model.

Fig. 6 (see PDFFigure 1 shows an example of a diagram that an engineer can use to get an overview of the sequence of events in a scenario. Here, the utilization of all resources over time is shown.

If the system's timing and performance requirements are described not only textually (e.g., in DOORS) but also semi-formally, they can be automatically validated against the simulation results. This makes it possible to immediately display for each requirement whether the current state of the executable model would meet it (see Fig. 7)., PDFIf a requirement is not met, information is displayed that enables further analysis.

Background information on the tool platform

The above illustrations (except Fig. 1, see PDFThe images shown are direct representations from the innovative modeling tool ISE (Integrated Specification Environment), which itemis AG has been developing since January 2016 as part of the IETS3 research project. Significant parts of this tool are available under an open-source license. The figures demonstrate that the ISE tool allows for the combination of many different notations within the same model to optimally express domain concepts. These include textual and mathematical notation, tables, tree structures (e.g., decision trees, feature diagrams), and graphical elements (e.g., component hierarchies).

This requires a tool platform that allows for the flexible combination of various modeling aspects and notations. For ISE, the Language Workbench MPS is used. MPS (Meta Programming System) is a tool development platform developed under an open-source license by JetBrains [1]. The unique feature of MPS is its use of projecting editors instead of the (limiting) use of parsers. This allows the underlying object models to be projected onto different notations.

Advantages for embedded practice

The methodology described here was developed in 2009/2010 and successfully used in the field of automotive infotainment systems [2]. The new implementation based on the MPS platform now provides powerful tool capabilities that enable the architect or developer of an embedded system to develop a deep understanding of the system's dynamic processes and thus of the interaction between hardware and software at a very early stage.

References

[1] MPS (Meta Programming System) homepage: https://www.jetbrains.com/mps.

[2] K. Birken, D. Hünig, T. Rustemeyer, R. Wittmann: Resource analysis of Automotive/Infotainment systems based on domain-specific models – a real-world example. In: Leveraging Applications of Formal Methods, Verification, and Validation, Volume 6416 of Lecture Notes in Computer Science pp 424-433, Springer, Heidelberg, 2010.

Download the article as a PDF


Modeling – MicroConsult Training & Coaching

Do you want to bring yourself up to date with the latest technology?

Then find out more here MircoConsult offers training courses/seminars/workshops and individual coaching on the topic of modeling/embedded and real-time software development.

Training & coaching on the other topics in our portfolio can be found here. here.


Modeling – Expertise

Valuable expertise in modeling/embedded and real-time software development is available. here Available for you to download free of charge.

To the specialist information

You can find expertise on other topics in our portfolio here. here.

MicroConsult Newsletter

With the MicroConsult newsletter, you'll stay on the pulse of the embedded world. Look forward to proven practical knowledge, real professional tips, and current events – directly from our experts for your project success.

Subscribe now!

Published by

weissblau media

weissblau media