By Jay Thomas, Senior Director of Field Engineering, TASKING, and Gerard Vink, Industry Specialist, TASKING
This four-part article series explains how to understand, measure, and mitigate Worst-Case Execution Time (WCET) in modern multicore embedded systems with a focus on requirements, design, and verification. In part 1, we’ll establish the conceptual foundation for understanding WCET by defining what interference and coupling are, how multicore hardware introduces hidden sources of timing variability, and the significant impact these can have on system execution.
Foundations: Interference and Coupling
Many safety-critical embedded systems, including automotive, avionics, industrial control, military, and medical applications, must guarantee that critical tasks are always completed within fixed time budgets. Missing a deadline even once in a hard real-time system can be catastrophic. Consider an aircraft flight-control loop that must respond within milliseconds, or an automotive safety function that must actuate a brake to avoid a collision.
The traditional approach to meeting timing guarantees is to determine the Worst-Case Execution Time (WCET) for each critical task and demonstrate that it fits within the allocated time budget. In principle, this sounds straightforward. In practice, especially when writing software for modern multicore processors, assessing WCET is one of the most technically demanding challenges in safety-critical software development.
This article series explains why. We begin by introducing two foundational concepts that underpin the WCET problem: interference and coupling (part 1). Understanding these concepts precisely is essential, because they are the root cause of the timing variability that makes WCET hard to bound. The rest of the series will cover hidden timing coupling in multicore processors (part 2), a three-stage methodology for accurately accessing WCET (part 3), and ways to mitigate timing coupling interference to guarantee real-time deadlines (part 4).
Unintentional Interference: The Core Concept
Interference occurs when one software component unintentionally affects the behavior or state of another during execution. Interference is not a deliberate interaction. Rather, interference is an unwanted side effect that arises when two or more components share a resource without sufficient coordination.
Interference is particularly dangerous in safety-critical systems because it is often invisible at the design level. A software architect may have designed two tasks as completely independent. Yet at runtime, when these tasks execute on shared hardware, they can interfere with each other through shared microarchitectural resources such as caches, memory buses, interrupt controllers that lie below the software abstraction layer.
In the context of timing analysis, the key effect of interference is variability in execution time. When interference occurs, a task takes longer to execute than it would in isolation. Crucially, the amount of extra time depends on the behavior of other tasks running concurrently and can vary with every run. This variability adds complexity to measuring the WCET because it is difficult to determine which combination of interference produces the worst-case impact.
Key principle: Interference causes execution time variability.
Without interference, a task’s execution time is determined solely by its own code and inputs. With interference, execution time increases, depending on what other tasks are doing simultaneously -making worst-case analysis far more complex.
Coupling: The Structural Source of Interference
Coupling describes the degree of dependency between two software components. Where interference is a runtime phenomenon, coupling is a structural one as it describes the pathways through which interference can occur.
There are three forms of coupling relevant to WCET analysis. They are not mutually exclusive, and a real-world system will typically exhibit all three. However, they arise from different sources and thus require different analysis techniques to measure their impact.
Data Coupling
Data coupling occurs when two tasks share access to the same data. Consider a simple example: Task A reads a value and begins a calculation. Task B needs to update that same value. However, if Task B modifies the value while Task A is mid-calculation, Task A may produce incorrect results. To prevent this, one task must wait for the other to finish, introducing a delay.
This delay adds variability to execution time. In a system with many tasks sharing many data objects, the interactions can become highly complex, and the cumulative negative effect on timing can be significant.
Control Coupling
Control coupling occurs when one task directly influences the execution path of another, typically through shared flags, status variables, or mode registers. For example, an engine control module may behave differently depending on whether a “landing gear engaged” flag has been set by a separate task. The execution time of the control module varies with the value of that flag, which is set externally to the module.
Control coupling affects timing because it introduces conditional branches whose execution depends on the state of other tasks, not just the task’s own inputs.
Timing Coupling
Timing coupling is the form of coupling most specific to multicore systems. It is also the most difficult to analyze. While not explicitly mentioned in DO-178C or AC 20-193, the effect of timing coupling emerges by examining data and control flow coupling over time. Timing coupling occurs when two tasks interfere with each other through shared hardware resources. This means timing coupling can arise even when the two software components have no data or functional relationship at the software level.
Important distinction:
Data coupling and control coupling can be identified through software design review and static analysis tools. Timing coupling cannot as it exists at the hardware level and can only be measured empirically on the target platform under realistic load conditions.
For example, two tasks running on different cores of a multicore processor may compete for the same L2 cache, the same memory bus, or the same memory controller. Such competition, also known as resource contention, causes each task to execute with more delay than it would if it were the only task running in the system. Critically, tasks are not “aware” of each other at the software level as they are logically independent. The interference arises entirely from shared hardware infrastructure and how resource contention is managed.
This is why timing coupling is considered “hidden”. As it cannot be detected by inspecting the software architecture. It can only be measured by running the tasks concurrently on real target hardware and measuring the resulting execution times.
| Coupling Type | Source of Dependency | Visible in Software Design? | Analysis Approach |
|---|---|---|---|
| Data coupling | Shared data objects / memory | Yes | Static analysis, data flow analysis |
| Control coupling | Shared flags / status variables | Yes | Static analysis, control flow analysis |
| Timing coupling | Shared hardware resources (cache, bus) | No - hardware level only | On-target dynamic measurement |
The Relationship Between Coupling and Interference
Coupling and interference are related but distinct concepts. Coupling is the structural condition that makes interference possible. Interference is the runtime manifestation of insufficiently controlled coupling.
Where there is no coupling — no shared data, no shared control paths, no shared hardware resources — interference cannot occur. Where coupling exists but is tightly controlled (through synchronization mechanisms, exclusive resource allocation, or temporal partitioning), interference can be eliminated or bounded.
In the context of WCET, the goal is therefore twofold: identify all coupling points (data, control, and timing) and quantify the worst-case interference that each coupling point can introduce during execution.
Next time in part 2 of this article series, we’ll cover what worst-case execution really means and how it differs between single-core and multicore-based systems.
Worse-Case Execution Time (WCET) analysis for multi-core systems - Electrical Engineering News and Products (Originally published in EEWorld Online)
