Today, hardware-in-the-loop (HIL) simulation is common practice as a testing methodology for electronic control units (ECUs). An essential criterion for the efficiency of an HIL system is the availability of powerful test automation having access to all of its hardware and software components (including I/O channels, failure insertion units, bus communication controllers and diagnostic interfaces). The growing complexity of vehicle embedded systems, which are interconnected by bus systems (like CAN, LIN or FlexRay), result in hundreds or even thousands of tests that have to be done to ensure the correct system functionality. This is best achieved by automated testing.
Automated testing usually is performed by executing tests on a standard PC, which is interconnected to the HIL system. However, higher demands regarding timing precision are hard to accomplish. As an example, ECU interaction has to be captured and responded to in the range of milliseconds. Such hard real-time constraints require the tests to be executed in real-time.
There is a need for a concept to execute tests in real-time on the processor board of the HIL simulator synchronously with the execution of the simulation model. The test description must be easy to learn and must provide a powerful means for software reuse, e.g. through libraries and object-orientation. Additionally, it must be possible to access all of the HIL components, such as hardware, real-time-model, communication buses, and diagnostic interfaces from within real-time tests.
In this paper we present a real-time testing concept meeting such demands. By applying this method, it is possible to implement sample-time-precise, highly reproducible tests with deterministic functional and timing behaviour. Such tests can be written using Python as a standard object-oriented scripting language, and executed in real-time without the need to modify and recompile the real-time model. Thus, the paper provides a new quality in automated testing of ECUs by introducing real-time execution as a core concept.