Runtime analysis
Problem description
A multicore embedded system is used to process incoming data. Many threads are involved in this task. The results must be available in hard real time and are used for safety critical decisions.
The operating system provides data on task switch events, interrupts and scopes which arestreamed to an attached pc. Scopes here are sections of code.
Some of the questions are:
Solution description
Events from the individual cores have to ordered by time. The clock used for the time stamps must be synchronised in the embedded system. The synchronisation error must be less than the message delivery time between cores. With this relaxed condition, causal order is retained.
Signal chains
The questions above require:
A signal processing pattern is ideally suited to handle this task. As an example,a simple net runtime measurement,
where start and stop time events are received by the Splitter. The splitter takes the task switch times into account and forwards only the time intervals where the task is actually active.
The Total block accumulates the entire active runtime and forwords it to the statistics and histogram block at each data event. The data event also resets the total to zero.
This pattern can be extended to arbitrary complexity.
Script language usage
Embedding the python script language made the configuration of complicated signal chain networks easier and more flexible. Custom extensions and highly specialized filters can also be added in the scriptlanguage.
This approach is able to perform in real time for a large even for complicated signal chains since the script only setups the signal chains at the beginning. This is a form of the dependency injection pattern.
Benefits
Costs
Tools