Part 1 of this article series covered human-in-the-loop agentic AI workflows, trusted process frameworks, and the role of worst-case execution time (WCET) analysis in certifying safety-critical systems. In Part 2, we’ll explore how to accurately assess WCET, using agentic AI to automate and accelerate iterative testing, and how all of these concepts together can simplify and accelerate the certification of complex automotive systems that must meet strict safety standards.
Accurately Assessing WCET
As stated above, it’s not feasible to test every possible run-time combination. However, when the testing process is able to be accelerated, more combinations can be tested. This increases coverage of the possible combinations, leading to a more accurate estimate of the WCET and enabling developers to have greater confidence in the overall reliability of the system.
Accurately assessing WCET in multicore-base automotive systems is more complicated than it is for single-core systems. That’s because two tasks running on different cores of a multicore processor may compete for the same inter-processor resources, in particular the L2 cache, memory bus, and memory controller.
Contention between cores for these resources can result in execution interference even when tasks are otherwise completely independent of each other (i.e., no data coupling or control coupling). Such interference is known as timing coupling.
To understand timing coupling, consider how each core on a multicore processor typically has a private L1 cache and access to a shared L2 cache. When tasks on different cores simultaneously access large datasets that exceed their L1 caches, they can compete for L2 cache lines. Each cache miss forces a memory access, which is orders of magnitude slower than a cache hit. The more interference from cache misses, the more substantial the negative impact on execution time.
Note that timing coupling can’t be assessed by inspecting the software architecture using static analysis, nor by executing a task on its own. Consider two tasks: Task A has a small cache footprint, and Task B has a large cache footprint.
When running on its own, Task A achieves excellent execution performance because the code doesn’t flush the L2 cache. However, when Task B is running concurrently on the same multi-course processor, its large cache footprint causes the L2 cache to flush frequently. Even though Task A and Task B are otherwise independent of each other, Task B’s larger dataset can cause substantial variability in Task A’s run-time performance.
The level of interference varies depending on which tasks are running concurrently on other cores and how often they each use the shared resource. In addition, tasks can start at different times relative to each other, which changes the pattern of interference. Thus, a single measurement pass is insufficient to assess timing coupling (Fig. 1).
Execution time histograms1. Execution time histograms for a task running without interference (left) and under multi-core timing coupling (right). The shift of the entire distribution to the right shows that both mean execution time and WCET increase under interference. A WCET estimate based only on the left-hand distribution would severely underestimate the actual worst case.
To get a more accurate assessment of interference, developers must run system tasks concurrently on real target hardware to be able to measure the resulting execution times arising from the particular interference experienced. For this reason, measuring the impact of timing coupling on WCET involves an iterative process exploring different combinations of:
- Concurrent tasks to capture how tasks on different cores can interfere with each other based on their specific L2 cache, memory bus, and memory controller usage.
- Task start offsets to vary the temporal overlap of concurrently executing tasks.
- Task data size to probe L1/L2 cache interference.
- Processor configuration settings, including cache enable/disable states and core affinity assignments to determine the impact of particular configuration choices.
- System load levels, including stress testing with maximum current load on all cores so that test measurements align with real-world operation.
Agentic AI to Accelerate Iterative Testing
The following is an example of how to automate empirical WCET analysis using agentic AI workflows while maintaining requirements traceability as required for certification:
Identify and Prioritize
Through the use of static-analysis test tools, developers can assess software complexity, control flow, and data and control coupling. With this information, developers are able to identify the most likely timing “hotspots” that will negatively impact WCET. Then they can prioritize the specific function and task interactions that should be closely monitored during on-target, run-time measurements.
Instrument Code
To enable accurate run-time measurements, the relevant code modules need to be instrumented with lightweight timing wrappers by the compiler. As many combinations will need to be tried, the specific modules instrumented may change from run to run. If this were done manually, a person would have to be present for each iteration. Using agentic AI, it’s possible to automate this process.
In addition, the AI can be enabled to handle and resolve simple errors that would otherwise halt the testing process. For example, if a particular combination of compiler options causes a build error during an automated session, an AI agent can diagnose and correct the error so that the current iteration is able to complete and avoid interrupting the analysis process.
Measure
A hardware debugger provides non-intrusive, on-target tracing. After being set up and configured for each run, the debugger can capture cycle-accurate, real-time timing data from the running system. This approach prevents the test process from adversely affecting execution behavior or skewing the accuracy of WCET measurements.
Automate
An agentic AI could be used to automate the entire WCET workflow. This includes driving comprehensive interference scenarios, collecting and visualizing execution time histograms, and producing auditable timing evidence for certification purposes.
Verify
With the right tools, developers can take the raw data collected and create a statistical distribution to automatically check and verify results against the system’s real-time timing requirements.
Orchestrate
An entire measurement test campaign can be orchestrated using agentic AI to manage and accelerate test processes across an extensive range of scenarios and execution runs to more accurately estimate the actual WCET of the system. With orchestration, overnight testing will complete without disruption or the need for a developer to be physically present.
Oversight
Agentic AI actions are logged with all exceptions flagged to maintain human-in-the-loop oversight and accountability. Thus, a person can take complete ownership and responsibility for the testing process, thereby maintaining the trustability required by safety standards.
Accessing WCET for multicore automotive systems involves many thousands of test iterations. By using a trusted process framework, agentic AI workflows can substantially improve efficiency through automation while at the same time reduce the risk of human error.
With a vertically integrated development pipeline that combines compilation and debug through to on-target measurement and collection of certification evidence, developers can automate many complex manual tasks. This not only simplifies AI coordination between tools, it substantially accelerates the software-development lifecycle.
Developers could also scale testing into the cloud to expand assessment coverage. In general, more comprehensive validation and verification testing increases accuracy and confidence in the overall reliability, safety, and security of automotive systems.
Faster Certification with Agentic AI
The verification and validation model used to develop safe and secure software illustrates how testing is planned in parallel with development rather than being an afterthought at the end of the project (Fig. 2).
Requirements traceability2. Requirements traceability is an essential part of the verification and validation model used to develop safe and secure software. AI must be implemented in a manner that supports this model for systems requiring certification.
Requirements traceability is an essential part of the process as it provides a way to verify how requirements have been implemented through each stage of the software-development lifecycle. Note that this doesn’t just apply to verification or validation, but to other types of analysis as well, including vulnerability analysis, security analysis, and data- and control-flow analysis.
By itself, AI isn’t directly certifiable in the traditional safety-critical model. This is because current implementations are probabilistic and difficult to fully bound. Their “black box” model of operation also often lacks the transparency needed to establish trust in how results are produced. Employing AI that replaces engineers complicates traceability, in turn complicating verification, reducing reliability, and generally making certification more difficult and costly.
Alternatively, when AI is used within a clearly defined and trusted process framework, traceability is maintained. Thus, AI-generated tests, derived requirements, analysis results, and other AI-based artifacts can be accepted as certifiable artifacts when they’re captured, reviewed, traced, verified, and controlled using certified or certifiable tools.
With this approach, AI isn’t the trusted authority on its own. Rather, the qualified toolchain in the defined engineering processes provides the trust boundary. This enables OEMs to leverage AI in their software-development lifecycle while still maintaining the traceability, evidence, and verification discipline required to achieve functional-safety certification.
AI is here to stay and will only continue to play a greater role over time in the development of automotive systems. By clearly defining AI’s part in software development, implementing proper guardrails, and strictly maintaining human oversight, development teams can benefit from AI to automate many complex manual tasks to produce better and more reliable code faster and with less risk.
>>Read Part 1 of this two-part series
Agentic AISource: Electronic Design




