TL;DR
This paper tackles the challenge of accurately monitoring hardware events on multicore processors for critical embedded systems, specifically for timing analysis in space applications. They developed a novel tracing solution for the GR712RC platform, which lacks built-in performance counters, by leveraging its debug support unit. This solution enables detailed profiling of memory accesses and instruction execution, crucial for understanding and bounding multicore interference.
What Problem Does This Paper Address?
The increasing demand for computing power in critical embedded systems (CES) is driving the adoption of multicore processors. However, this shift introduces significant challenges for timing analysis, a crucial aspect of verification and validation in safety-critical domains like aerospace. Multicore architectures, with their shared hardware resources, lead to "multicore interference" – unpredictable delays caused by competing cores. Traditional monitoring and profiling tools, designed for debugging and general performance optimization, are often insufficient for the precise timing analysis required by CES standards. Specifically, the GR712RC, a common choice for space missions, lacks integrated performance monitoring units (PMUs), making it difficult to gather the necessary data for timing analysis. This paper addresses the need for a practical, industrially-amenable profiling solution for such platforms to accurately characterize and bound multicore interference.
Methods
The authors developed a custom profiling solution for the GR712RC by creatively utilizing its Debug Support Unit (DSU). This approach bypasses the lack of a dedicated PMU. The core of their method involves:
- Bus Trace Buffer (BTB) and Instruction Trace Buffer (ITB): The DSU is configured to snoop the AMBA AHB bus (BTB) to capture memory access events and to capture the instruction execution stream from each core (ITB).
- GRMON Script (Dumper): A script is used to control the processor (via breakpoints and step-by-step execution) and dump the contents of the BTB and ITB to a host machine. This process is designed to be conservative to avoid data loss from buffer overruns.
- Post-processing (Merger): Raw trace data is filtered, redundant entries are removed, and instruction opcodes are decoded to identify instruction types. A key step is linking bus trace entries (e.g., cache misses) to the corresponding load instructions.
- Event Counting (Collector): Finally, the processed data is used to derive various event counts, such as instruction counts, load/store counts, cache hits/misses, and accesses to different memory types (on-chip SRAM, off-chip SRAM, SDRAM, I/O).
This approach allows for the collection of detailed hardware event information without relying on on-chip PMUs.
Datasets
The paper does not explicitly mention training datasets. For evaluation, they used:
- Code Snippets: Small, carefully crafted code snippets designed to trigger specific hardware events (e.g., instruction cache hits/misses, data cache hits/misses, accesses to different memory types). These were used to validate the accuracy of the profiling solution in both bare-metal and RTEMS environments.
- Real Space Application: A subset of a telemetry and telecommand (TM/TC) subsystem, specifically focusing on UART communication. This served as a case study to demonstrate the practical application of the profiling solution for characterizing multicore interference.
- Stressing Benchmarks: Microbenchmarks designed to maximally stress specific memory resources (on-chip SRAM, off-chip SRAM, SDRAM, UART) to derive contention slowdown matrices.
Key Insights and Ideas
- Leveraging Debug Support for Profiling: The most significant insight is demonstrating that a powerful profiling solution for timing analysis can be built by creatively using the debug support unit (DSU) of a processor, even when dedicated performance counters are absent. This opens up possibilities for profiling on many embedded platforms that might otherwise be considered untraceable for detailed timing analysis.
- Bridging the Gap for Critical Systems: The paper highlights that standard debugging tools are insufficient for the rigorous timing analysis required by safety-critical systems. A tailored approach is needed to extract specific hardware event data that directly informs timing models.
- Practical Challenges of Multicore Tracing: The authors emphasize the practical difficulties in obtaining accurate and non-intrusive traces, especially on multicore systems. This includes managing buffer sizes, minimizing probe effects, and ensuring data integrity.
- Validation is Paramount: The paper strongly advocates for thorough validation of any profiling solution, using both synthetic benchmarks and real-world applications, to build confidence in the collected data.
- RTOS Portability: The solution's ability to work with minimal changes across bare-metal and RTEMS environments demonstrates its practical portability for diverse embedded systems.
Key Results
- Accurate Event Counting: The developed profiling solution demonstrated high accuracy in deriving event counts, with deviations typically below 0.1% for instruction counts and even lower for other events when compared to expected values from carefully designed code snippets.
- RTEMS Compatibility: The profiling solution showed excellent portability, requiring no changes to the core tracing and post-processing scripts when transitioning from bare-metal to the RTEMS real-time operating system.
- Contention Characterization: The solution was successfully applied to a real space application (TM/TC subsystem), enabling the derivation of event counts for different components.
- Slowdown Matrix Generation: The paper successfully generated a contention slowdown matrix, quantifying the impact of one core's activity on another's access to shared resources, with results showing reasonable agreement between stressing benchmarks and expected relations.
- FTC Estimate Validation: The derived Fully Time-Composable (FTC) estimates for multicore execution times were consistently higher than observed multicore execution times, as expected, with over-estimation factors ranging from 1.01 to 1.35 for most applications, demonstrating the conservative nature of the model.
Limitations and Future Work
- Intrusiveness: While the solution aims for low intrusiveness, the process of stopping the processor for trace dumping inherently introduces some level of perturbation. The authors acknowledge that the chosen step size for dumping is a trade-off between minimizing data loss and limiting intrusiveness.
- Hardware Dependency: The specific scripts for trace collection are dependent on the debug solution (DSU and GRMON in this case). While the methodology is generalizable, the implementation details would need adaptation for different platforms.
- Future Work: The authors plan to deploy the developed solution with other applications in specific business units of Thales. They also aim for wider applicability by adapting the solution to external debugging solutions and protocols that support different processor families. Further research could explore more advanced techniques to further reduce intrusiveness and enhance the automation of the profiling process.
Summary updated