The provided transcript focuses on the integration of high-assurance software development (Ada/SPARK) with professional-grade hardware-in-the-loop (HIL) debugging tools (Lauterbach TRACE32) and modern CI/CD orchestration (GitLab). This topic is highly relevant to Embedded Software Engineers, System Architects, and Lead DevOps Engineers specializing in safety-critical or high-reliability systems.
Abstract
This technical demonstration outlines a robust workflow for hardware-accelerated debugging and automated testing using the Ada/SPARK ecosystem. The presentation features the Lauterbach MicroTrace 32 debugger interfaced with a Raspberry Pi Pico (RP2040) target. Key components include the use of VS Code as the primary IDE, Alire for dependency management and build orchestration, and SPARK for formal verification of a binary search algorithm.
The core of the demonstration highlights the advantages of hardware-level control, specifically the implementation of "write breakpoints" to capture state changes in real-time and extract stack traces. Furthermore, the workflow is extended into a GitLab CI/CD pipeline. By utilizing a local GitLab runner connected to the physical hardware, the system demonstrates an automated "Build-Deploy-Test" cycle where hardware failures trigger the generation of stack trace artifacts for remote analysis.
Hardware-Accelerated Debugging and CI/CD Integration Summary
00:00 Hardware Overview: The setup utilizes a Lauterbach MicroTrace 32 connected to a Raspberry Pi Pico. While the Pico is a low-cost target, it serves as a pervasive platform to demonstrate hardware-accelerated control and superior target visibility compared to software-only debuggers.
00:52 Development Stack: The environment uses VS Code integrated with Alire (Ada package manager) for toolchain and dependency management. The demo features a binary search implementation in SPARK, emphasizing functional correctness through formal proof before moving to hardware.
01:57 Debugger Orchestration: The Lauterbach TRACE32 software is launched via VS Code tasks using .cmm and config.t32 files. This automates binary flashing to the target and opens a source-level debugging interface with real-time register and variable monitoring.
03:00 Advanced Debugging (Write Breakpoints): A key takeaway is the use of hardware-accelerated "write breakpoints." Unlike standard breakpoints, these halt the processor specifically when a targeted memory location is modified, allowing the developer to trace the exact line and stack frame responsible for the state change.
04:03 CI/CD Pipeline Architecture: The workflow is mirrored in a GitLab pipeline using an Ubuntu-based "SDK" container. The pipeline is divided into a Build Stage (compiling the Ada binary and caching dependencies via Alire) and a Test Stage.
05:18 Hardware-in-the-Loop (HIL) Testing: The test stage utilizes a local GitLab runner connected to the TRACE32 hardware. This allows the CI pipeline to execute the binary on physical silicon, ensuring that environmental or hardware-specific issues are caught during the automation cycle.
08:24 Failure Detection and Artifacts: In the event of a test failure, the debugger is scripted to detect the failure condition, capture a stack trace, and save it as an LSD file. This file is then uploaded to GitLab as a build artifact, providing immediate diagnostic data for failed CI runs.
09:01 Toolchain Flexibility: The process is compatible with both the community-supported Alire/GNAT tools and professional-grade suites like GNAT Pro and SPARK Pro from AdaCore, providing a scalable path from prototyping to industrial deployment.