Introduction
Hardware Event Monitors (HEMs) are indispensable tools for timing analysis in safety-critical systems, such as avionics and automotive control. These monitors track critical resource usage, including cache misses and bus contention, providing the data necessary to guarantee that software meets strict real-time deadlines. However, HEMs are often treated as "non-functional" hardware by manufacturers, leading to poor documentation, verification gaps, and bugs.
Traditional validation techniques, known as Single HEM Validation (SHV), rely on an expert's ability to predict exact event counts for simple code loops. While effective for basic operations, SHV fails for complex, non-deterministic events like cache coherence snoops or stall cycles, where the "correct" value depends on the dynamic state of the entire MultiProcessor System on Chip (MPSoC).
Methodology: Multiple HEM Validation (MHV)
To address these limitations, this research introduces Multiple HEM Validation (MHV). Rather than seeking an absolute reference value, MHV validates hardware events by checking the mathematical consistency across a set of related monitors using linear equations and inequalities (e.g., $HEM_A = HEM_B + HEM_C$).
The MHV pipeline involves several critical steps:
- Equation Formulation: Experts define expected relationships between HEMs based on architectural knowledge.
- Decomposition and Transitivity: Since processors have limited Performance Monitoring Counters (PMCs), complex equations are broken into smaller sub-equations that can be validated within the hardware's constraints.
- Inter-Run Variability (IRV) Mitigation: When all required HEMs cannot be measured simultaneously, the methodology employs the MUCH (Multivariate Gaussian copula) technique to statistically merge data from separate runs while preserving pairwise correlations.
- Classification: Monitors are categorized based on their behavior: Trusted (T), Regained Trust (R) (consistent behavior that deviates from documentation but is explainable), or Untrusted (U).
Experimental Setup and Target Platform
The methodology was evaluated on the NXP T1040 SoC, a quad-core processor common in the avionics industry. The study focused on the CoreNet Coherence Fabric (CCF) and the L1/L2 cache hierarchy.
Custom assembly-level micro-benchmarks were designed to trigger specific coherence transitions (following the MESI protocol). These "snippets" used precise memory access patterns to stress the interconnect and caches, providing a controlled environment for validating 11 coherence-related HEMs.
Key Insights and Results
The evaluation revealed that architectural relationships are often more reliable than absolute values. While individual counts might vary due to system dynamics, the logical bounds between related counters (e.g., snoop hits should not exceed snoop requests) remain constant.
The study also highlighted that manufacturer documentation is frequently imprecise. Two HEMs (DL1CO and UL2DUP) initially failed validation but were moved to the "Regained Trust" category after the authors hypothesized and confirmed a specific hardware optimization where snoop hits bypass certain update stages. In contrast, one HEM (UL2SH) was found to be fundamentally "Untrusted," producing counter-intuitive values that could not be reconciled with any logical model.
Ultimately, 8 of the 11 HEMs were confirmed as Trusted. The results underscored the importance of IRV mitigation; without these statistical steps, several reliable counters would have been incorrectly flagged as broken due to measurement noise.
Conclusion and Future Work
MHV provides a rigorous framework for validating the hardware monitors essential for high-integrity timing analysis. By shifting the focus from absolute values to mathematical relationships, it enables the validation of complex, non-deterministic hardware events.
Future research will aim to reduce the dependency on human experts for formulating equations, potentially through automated relationship discovery using formal methods or machine learning. Additionally, extending the framework to handle non-linear relationships and larger sets of HEMs in modern, high-density chips remains a key objective.
Summary updated