Hardware‑Backed MCDC Coverage Framework
Lübeck, Germany
- Posted
- First seen 9 October 2026 (7 weeks ago)
- Deadline
- Not specified
- Department
- Not specified
- Category
- Thesis
- Employment type
- Not specified
- Language
- Not specified
Summary
IN COOPERATION WITH UNIVERSITY OF APPLIED SCIENCE IN BERGEN/NORWAY Redirecting Clang’s MCDC Coverage Instrumentation to ARM CoreSight: A High‑Performance, Hardware‑Backed Coverage Collection Framework 1. Motivation & Background 1.1. Modified Condition/Decision Coverage (MCDC) MCDC is a stringent white‑box testing criterion required by safety‑critical standards such as DO‑178C (Level‑A), ISO 26262, and IEC 61508. It demands that each atomic condition in a decision be shown to independently affect the decision’s outcome. Historically, generating MCDC data on embedded targets is cumbersome: • Source‑level tools (e.g., GCOV, lcov) instrument the program, write massive text files, and then post‑process them on a host PC. • The instrumentation overhead can be high (extra branches, counters) and the I/O bandwidth needed to dump GCOV files can dominate execution time on low‑power micro‑controllers. 1.2. Clang’s New MCDC Instrumentation The LLVM/Clang project (January 2024) introduced built‑in support for MCDC coverage. The compiler now inserts instrumentation points that record the evaluation of each condition and decision, and the data is emitted through the existing -fprofile-instr-generate pipeline, ultimately producing a .gcda/.gcno file that can be consumed by GCOV. 1.3. ARM CoreSight CoreSight is ARM’s on‑chip debug, trace and profiling infrastructure. It provides: • ETM/PTM trace for instruction flow. • CTI/CTM/CTP for event‑driven instrumentation (e.g., Data Write events). • TPIU/ETB for high‑speed, low‑latency transport (UART, USB, high‑speed trace ports, SWO). CoreSight can stream events directly from the target to a host debugger with negligible software overhead, making it ideal for collecting coverage data in real‑time while preserving deterministic timing. 1.4. Gap Clang’s MCDC instrumentation is hard‑wired to the GCOV workflow. No existing solution routes the coverage events through CoreSight, which would give: • Deterministic, low‑overhead collection (no file system writes). • Immediate visibility of coverage for interactive debugging. • Possibility of live‑feedback to a test harness (e.g., stopping a test when a condition is uncovered). Goal: “High‑jack” the Clang MCDC instrumentation so that every coverage point generates a CoreSight trace event, bypassing GCOV entirely. 2. Problem Statement How can LLVM/Clang’s MCDC instrumentation be repurposed to emit coverage events via ARM CoreSight, while preserving correct semantics, keeping overhead below a defined threshold, and providing a usable end‑to‑end toolchain for safety‑critical embedded developers? Key challenges: • Mapping Instrumentation to CoreSight Events – The instrumentation currently writes to internal counters; we must replace this with writes to CoreSight‑observable registers or memory‑mapped trace ports. • Portability & configurability – The solution should compile for any ARM Cortex‑M / Cortex‑A core equipped with CoreSight (or a simulated environment such as QEMU with a CoreSight model). • Toolchain Integration – We need a workflow that starts from source, produces an ELF that streams coverage, and a host‑side collector that reconstructs the MCDC matrix. • Performance Guarantees – Quantify the added latency, code‑size increase, and any impact on timing‑critical code. • Verification of Correctness – Ensure that the event stream faithfully represents the same coverage information as the reference GCOV implementation. 3. Research Questions (RQs) # Question RQ‑1 What is the minimal set of CoreSight primitives (e.g., ITM, ETM, CTI, TPIU) required to convey every MCDC instrumentation point without loss of information? RQ‑2 How does the CoreSight‑based coverage collection affect the execution time and binary size compared with the classic GCOV approach on representative safety‑critical benchmarks? RQ‑3 What software architecture (instrumentation library, runtime shim, host collector) provides the most robust and portable solution across different ARM families? RQ‑4 Can the generated CoreSight event trace be transformed back into the standard GCOV data format (or a new standardized format) so that existing coverage analysis tools can be reused? RQ‑5 How does the proposed framework integrate into a continuous‑integration (CI) pipeline for safety‑critical development, and what are the implications on certification (traceability, auditability)? 4. Objectives & Scope Objective Deliverable O‑1 – Instrumentation Redirection – Modify Clang’s MCDC passes (or add a new LLVM pass) to replace the default __llvm_profile_* calls with CoreSight trace writes. Patched Clang source + LLVM pass plugin. O‑2 – Runtime Support Layer – Implement a tiny, header‑only CoreSight shim(mcdc_coreSight.h) that abstracts the low‑level registers (ITM/CTM) and provides macros used by the instrumented code. Open‑source C/C++ library, unit‑tested on QEMU and real hardware. O‑3 – Host‑Side Collector – Develop a Python/ C++ utility (mcdc_collect) that reads the CoreSight stream via SWO, ETB, or Debugger‑API (e.g., pyOCD) and reconstructs the MCDC matrix. CLI tool with documentation and test suite. O‑4 – Performance Evaluation – Benchmark against GCOV on a set of open‑source safety‑critical kernels (e.g., AUTOSAR demo, DO‑178C flight‑control loop, Mini‑CANstack). Empirical data set, statistical analysis. O‑5 – Verification & Regression Suite – Produce a set of regression tests that compare the CoreSight‑derived coverage with the legacy GCOV output for identical inputs. CI‑compatible test harness. O‑6 – Documentation & Guidance – Write a Developer’s Guide describing the toolchain, required board configuration, and best‑practice recommendations for certification‑oriented projects. PDF manual, sample project repository. Out‑of‑Scope • Development of a full CoreSight hardware emulator (we will reuse existing QEMU and commercial debuggers). • Extending the approach to non‑ARM architectures (though the methodology could be adapted). 5. Methodology 5.1. Literature & Tool Survey (Weeks 1‑2) • Study Clang’s MCDC implementation (source files MCDCCoverage.cpp, CoverageInstrumentation.cpp). • Review ARM CoreSight technical reference manuals (ITM, ETM, CTI, TPIU, ETB). • Examine existing open‑source CoreSight drivers (e.g., pyOCD, OpenOCD, CMSIS‑DSP/ITM). 5.2. Design Phase (Weeks 3‑4) • Mapping Table: For each instrumentation point (condition entry, decision evaluation, condition toggle) define a unique event ID and payload layout (e.g., 32‑bit word: [event‑type | condition‑id | outcome]). • Instrumentation Hook: Decide whether to replace the default profiling calls (__llvm_profile_*) or to inject an additional pass that appends a CoreSight call after each existing instrumentation. 5.3. Implementation Phase Activities Expected Outcome P1 – Clang Modification(Weeks 5‑7) Fork LLVM, add an optional -fcoverage-mcdc-coresight flag, implement a new MCDCCoreSightPass that emits llvm::CallInst to __mcdc_coresight_emit(uint32_t id, uint8_t value). Patched Clang that can be built with standard LLVM build system. P2 – Runtime Shim(Weeks 8‑10) Implement __mcdc_coresight_emit in a header‑only library: on Cortex‑M use ITM_SendChar/ITM_SendWord; on Cortex‑A use memory‑mapped CTI registers or ETM software‑triggered packets. Provide fallback to a stub for non‑CoreSight targets. Portable shim that compiles with -mcpu=cortex-m4 etc. P3 – Host Collector(Weeks 11‑13) Use pyOCD or OpenOCD to capture the SWO stream, parse the binary protocol, and rebuild the MCDC matrix (condition‑decision table). Export to gcov‑compatible .gcda files or a custom JSON format. mcdc_collect CLI tool that produces human‑readable reports and can be fed to existing gcovr/lcov pipelines. P4 – Integration & CI(Weeks 14‑15) Create a Docker image containing the patched Clang, shim library, and collector; build CI jobs that compile a test suite, run on QEMU with CoreSight emulation, and verify coverage equality with GCOV. Fully reprod
Other current jobs at Uni Lübeck
All 19 jobs- Sichere IT für KMU
Thesis
- 2 Ausbildungsplätze zur Kauffrau/zum Kaufmann für Büromanagement (m/w/d)
Administration · Universität zu Lübeck · Deadline 6 December 2026
- Systembibliothekar/in (m/w/d)
Administration · Universität zu Lübeck · Deadline 20 December 2026
- Cybersecurity of a Modular Rescue Robotics Platform: Risk Analysis and Security Concept
Thesis
- IT-Sicherheit einer modularen Rettungsrobotik-Plattform: Risikoanalyse und Sicherheitskonzept
Thesis
- Wissenschaftliche/r Mitarbeiter/in – Post-Doc (m/w/d)
Postdoc · Universität zu Lübeck · Deadline 29 November 2026