GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - anulum/loop-timing-witness: FPGA control-loop event witness software and RTL simulation for PolarFire SoC; physical board qualification pending.

BranchesTags
Open more actions menu

Latest commit

 

History

429 Commits
429 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
LICENSES
LICENSES
 
 
analysis/rust
analysis/rust
 
 
benchmarks
benchmarks
 
 
container
container
 
 
controllers
controllers
 
 
docs
docs
 
 
fuzz
fuzz
 
 
hardware/icicle
hardware/icicle
 
 
papers
papers
 
 
rtl
rtl
 
 
runtime
runtime
 
 
src/loop_timing_witness
src/loop_timing_witness
 
 
tests
tests
 
 
tools
tools
 
 
.clang-format
.clang-format
 
 
.editorconfig
.editorconfig
 
 
.gitattributes
.gitattributes
 
 
.gitignore
.gitignore
 
 
.gitleaks.toml
.gitleaks.toml
 
 
.pre-commit-config.yaml
.pre-commit-config.yaml
 
 
.zenodo.json
.zenodo.json
 
 
ARCHITECTURE.md
ARCHITECTURE.md
 
 
CHANGELOG.md
CHANGELOG.md
 
 
CITATION.cff
CITATION.cff
 
 
CODE_OF_CONDUCT.md
CODE_OF_CONDUCT.md
 
 
CONTRIBUTING.md
CONTRIBUTING.md
 
 
CONTRIBUTORS.md
CONTRIBUTORS.md
 
 
Doxyfile
Doxyfile
 
 
GOVERNANCE.md
GOVERNANCE.md
 
 
LICENSE
LICENSE
 
 
Makefile
Makefile
 
 
NOTICE.md
NOTICE.md
 
 
README.md
README.md
 
 
REUSE.toml
REUSE.toml
 
 
ROADMAP.md
ROADMAP.md
 
 
SECURITY.md
SECURITY.md
 
 
SUPPORT.md
SUPPORT.md
 
 
VALIDATION.md
VALIDATION.md
 
 
_typos.toml
_typos.toml
 
 
amp-capture.schema.json
amp-capture.schema.json
 
 
amp-plugin-build.schema.json
amp-plugin-build.schema.json
 
 
capability-inventory.json
capability-inventory.json
 
 
conftest.py
conftest.py
 
 
controller_test_support.py
controller_test_support.py
 
 
development-dependency-licences.json
development-dependency-licences.json
 
 
host-load.schema.json
host-load.schema.json
 
 
measurement-domain.json
measurement-domain.json
 
 
measurement-domain.schema.json
measurement-domain.schema.json
 
 
native-run.schema.json
native-run.schema.json
 
 
neural-step-run.schema.json
neural-step-run.schema.json
 
 
neural-step-run.schema.json.license
neural-step-run.schema.json.license
 
 
pyproject.toml
pyproject.toml
 
 
repeat-campaign.schema.json
repeat-campaign.schema.json
 
 
repeat-campaign.schema.json.license
repeat-campaign.schema.json.license
 
 
requirements-build.in
requirements-build.in
 
 
requirements-build.txt
requirements-build.txt
 
 
requirements-dev.in
requirements-dev.in
 
 
requirements-dev.txt
requirements-dev.txt
 
 
requirements-runtime.txt
requirements-runtime.txt
 
 
rtl_capture_support.py
rtl_capture_support.py
 
 
run-manifest.schema.json
run-manifest.schema.json
 
 
rust-toolchain.toml
rust-toolchain.toml
 
 
source-gates.toml
source-gates.toml
 
 

Repository files navigation

Loop Timing Witness

Sponsor PyPI crates.io DOI CI Docs CodeQL Pre-commit License Typed Python Codecov OpenSSF Scorecard OpenSSF Best Practices

The coverage badge describes Python host/tool reports. Native and RTL proof scopes are documented in the coverage guide. Download history and missing-data handling are described in repository metrics.

Loop Timing Witness architecture concept

Illustrative architecture concept. Hardware qualification and board measurements remain pending.

An open measurement instrument, in design, that timestamps the events of a real-time control loop in FPGA fabric and reports latency, jitter, deadline misses, fault response and energy per control cycle on a PolarFire SoC board — independently of the processor whose software is being measured.

Evidence maturity: architecture_only. No board instrument has been built or measured. The repository contains measurement contracts, fabric timestamp capture, a dual-clock buffer, plants, references, PID and discrete LQR controllers with bit-exact C/Rust/RTL parity, a deadline monitor and fault injector tested in RTL simulation, and a host analysis command that reports simulation provenance separately from board evidence. The capability and claim inventories remain empty and checked by the manifest validator.

The measurement problem

Real-time control on embedded systems-on-chip is usually characterised by software that times itself on the processor under test: a timer wake-up benchmark, or timestamps logged by the control task. Those numbers share clock, scheduler and interrupts with the system being measured, often describe a proxy task rather than the control loop, and rarely come with energy per cycle or with the effect of latency on control quality. Moving a controller between a Linux task, a bare-metal core and FPGA logic therefore changes the measurement method along with the placement.

What the instrument is designed to do

For one closed control loop on one PolarFire SoC Icicle Kit, the planned instrument:

  1. timestamps every sample-ready, sample-read, actuator-write and deadline event in FPGA fabric on a 64-bit counter clocked at 100 MHz (10 ns resolution);
  2. reports latency and jitter as distributions (median, 95th, 99th and 99.9th percentile, maximum) and counts deadline misses in hardware;
  3. compares three controller placements under identical plant and controller definitions: Linux user space on the U54 application cores, a bare-metal loop on one U54 core in asymmetric multiprocessing, and fixed-point logic in fabric;
  4. relates latency to the tracking error of an emulated plant in the same run;
  5. estimates energy per control cycle from the board's PAC1934 power monitor, with the limits stated in docs/MEASUREMENT_PROTOCOL.md;
  6. injects faults and measures detection and time to a defined safe actuator state;
  7. writes every run as raw event records plus a hashed manifest, so a run can be repeated and audited.

A second event profile, COMPUTE, applies the same event witness to fabric accelerators: input write, compute start, compute done, output read and interrupt entry.

Who it is for

Engineers and researchers who must show measured loop timing instead of estimates: motor, power-electronics and motion control, laboratory hardware-in-the-loop set-ups, and teams that place computation in FPGA fabric and need its end-to-end latency on real hardware.

Evidence boundary and non-claims

  • No board latency, jitter, deadline, energy or control-quality number has been measured. Functional simulation results and native regression timings are separately labelled.
  • No physical board is currently available; development and verification use simulation.
  • No statement about PolarFire SoC performance is made before a measured run with its manifest and hashes exists.
  • No comparison with other vendors or platforms is part of the project.
  • The target board has not been used yet; the platform facts in the manifest come from the board user guide and are marked verified_on_hardware: false.
  • Hardware timing measurement from FPGA fabric is established prior work (see below), and so is recording a loop's latency together with its energy. The planned contribution is the application to complete control-loop events across three placements on one device with control quality, energy and fault response in the same run, published as reproducible run records — not the idea of measuring from fabric.

Related work

  • Alonso et al., "Interrupt Latency Accurate Measurement in Multiprocessing Embedded Systems by Means of a Dedicated Circuit", Electronics 13(9), 1626, 2024, https://doi.org/10.3390/electronics13091626 — a fabric circuit that measures the latency between two interrupt signals with one clock-cycle resolution and compares hypervisor and asymmetric-multiprocessing configurations on Zynq UltraScale+.
  • Microchip Technology, "PolarFire SoC FPGA: Interrupt Latency and Data Transfer Throughput Measurements", white paper DS60001712B, 2021 — processor-side interrupt latency on the Icicle Kit measured with the RISC-V cycle counter.
  • Puglisi et al., "Comparative evaluation of embedded platforms for real-time acquisition in plasma control and data acquisition systems", Fusion Engineering and Design 228, 115769, 2026, https://doi.org/10.1016/j.fusengdes.2026.115769 — bare-metal, FreeRTOS, Linux and FPGA placements of one acquisition loop, timed by server-side packet timestamps and an oscilloscope.
  • Geier, Brändle, Faller and Chakraborty, "Debugging FPGA-accelerated Real-time Systems", IEEE RTAS 2020, 350–363, https://doi.org/10.1109/RTAS48715.2020.00010 — a trace core in the fabric of a Zynq board and an external measurement board record a visual-servoing loop's input-to-output latency, its processing phases and the power of at least nine supply rails in one run. It traces one implementation of the loop; a bare-metal against Linux comparison is named as future work, and no fault is injected.
  • Ayad, Saci and Khezzar, "Impact of Digital Control Architecture on IGBT Short-Circuit Protection Performance: A Comparative Study of FPGA and Microcontroller Implementations", Journal Européen des Systèmes Automatisés 59(8), 2139–2148, 2026, https://doi.org/10.18280/jesa.590802 — one protection loop on a microcontroller and on an FPGA with the same analog front end: digital latency, peak fault current and dissipated fault energy, on two devices.
  • Cuccagna et al., "Dynamic Deployment of Real Time Services in Edge Computing Systems", IEEE Open Journal of the Communications Society 7, 1163–1185, 2026, https://doi.org/10.1109/OJCOMS.2026.3658832 — latency and throughput of the paths between Linux, FreeRTOS and programmable logic on one Zynq-7030; the paths are measured, not a control loop.

The instrument complements these classes of tools rather than replacing them:

  • Processor-side latency tools, such as cyclictest from rt-tests and the kernel's timerlat tracer with rtla timerlat, wake a thread from a periodic timer and report its wake-up latency on the processor's own clock. They characterise the operating system under test, not the path from a sample to an actuator command, and do not run in a bare-metal or fabric placement.
  • Embedded logic analysers make internal fabric signals visible: SmartDebug's live probes route two internal signals of a PolarFire device to dedicated pins for an oscilloscope, and LiteScope records triggered sample windows in on-chip memory. They show waveforms around a trigger, not a timestamped record of every cycle of a run.
  • Processor trace, such as the RISC-V processor trace specification, streams a core's instruction flow to a trace sink. It shows where software spends its time, but not the fabric side of an access or a controller that runs in fabric.
  • Time references such as IEEE 1588 and White Rabbit distribute traceable time. The instrument takes such a reference through its pulse-per-second input, and its mirror pins show its own events to an external time tagger.
  • Control-timing analysis, such as Jitterbug and TrueTime (Cervin, Henriksson, Lincoln, Eker and Årzén, 2003), computes the cost of a delay distribution. The instrument measures that distribution, and loop_timing_witness.control_cost evaluates its cost.
  • Runtime monitors synthesised into fabric, such as R2U2 (Schumann, Moosbrugger and Rozier, 2015) and RTLola (Baumeister, Finkbeiner, Schwenger and Torfah, 2019), check temporal specifications of signal streams while a system runs. They decide whether a property holds; the instrument records each event's time, from which distributions are formed.

Relation to SC-NeuroCore

Loop Timing Witness is developed as hardware-validation tooling for SC-NeuroCore, an open neuromorphic computing library. The COMPUTE profile is designed to measure the memory-mapped write, compute, read and interrupt path that fabric neuron peripherals use. No SC-NeuroCore code, model or adapter is part of this repository: adapters that place such peripherals in the instrument's device-under-test slot belong to the SC-NeuroCore repository and consume this repository's published manifest format and interface. No SC-NeuroCore latency or energy on PolarFire SoC has been measured.

Explicit exclusions

  • SC-NeuroCore source code, generated neuron peripherals, models or adapters.
  • Controllers, plant models or physics from other projects; only textbook PID and discrete LQR controllers are in scope.
  • Microchip Libero SoC binaries, licensed or encrypted IP cores and redistributed vendor reference designs; they are generated by scripts or fetched at a pinned revision.
  • Board measurement results and platform performance claims until a measured run exists. Labelled simulation evidence and non-isolated native regression records are retained.

Architecture

The instrument architecture, event record format and verification plan are described in docs/ARCHITECTURE.md. The repository boundary is fixed by docs/adr/0001-repository-boundary.md, the measurement procedure and its stated limits by docs/MEASUREMENT_PROTOCOL.md, and the threat model by docs/THREAT_MODEL.md. The implemented simulation and host file contract is in docs/HOST_ANALYSIS.md. The source-bound vendor input procedure is in hardware/icicle/README.md; no Libero or board result is claimed.

The system block diagram illustrates the planned PolarFire SoC Icicle Kit instrument.

The planned contracts are machine-readable in measurement-domain.json (schema measurement-domain.schema.json): timebase, event record layout, event profiles and the intervals derived from them, event buffer sizing, controller placements and the run plan. Each run manifest binds a snapshot of this file by SHA-256. The validator checks their internal consistency, for example that the event buffer outlasts the slowest permitted drain at the highest sample rate and that the timebase counter cannot wrap during a repeat.

The RTL stream contract is described in docs/FABRIC_WITNESS.md; the integrated plant, monitor and injector are in docs/PLANT_WITNESS.md. Controller arithmetic, design, native interfaces and simulation limits are in docs/CONTROLLERS.md. Dedicated-hart firmware preparation, actual ISA capture and analysis limits are in docs/AMP_SIMULATION.md. The IRQ-free Linux AMP logger, mailbox startup and board qualification requirements are in docs/AMP_LINUX.md.

Repository layout

Path Content
measurement-domain.json, measurement-domain.schema.json identity, boundary and planned measurement contracts
run-manifest.schema.json versioned, provenance-bound run input contract
amp-capture.schema.json actual dedicated-hart ISA logger receipt and artifact custody
amp-plugin-build.schema.json original generation/compilation, native compiler, SDK, source/header and link provenance, and a counted variant's instrumentation
capability-inventory.json generated public inventory, empty at architecture_only
development-dependency-licences.json reviewed licence of every pinned development tool
docs/ architecture, measurement protocol, threat model, decision records
papers/ manuscript collection; no manuscript exists yet
rtl/ fixed-point controllers, plants, monitor, injector, timestamp capture and dual-clock stream
controllers/ dependency-free C and Rust kernels, streaming CLIs and API documentation
runtime/rtl/ native process transport through the actual production AXI simulation
runtime/linux/ UIO transport, native controller and AMP logger entries, bracketed PAC1934 IIO journal; hardware qualification pending
benchmarks/ matching native workloads, the closed-loop data harness and labelled timing records
tools/ host analysis, validators, inventory generator, repository guards and preflight runner
tests/ command-line, file and RTL-simulation tests
.github/ workflow definitions, workflow inventory and contribution metadata

Python package and native interfaces

The source tree's version is 0.4.0. It is published as the analysis package on PyPI and as the controller crate on crates.io. The package installs the typed loop_timing_witness API, packaged JSON schemas and the loop-timing-witness-analyze command. The package analyses existing hash-bound run records; native simulation, firmware preparation and hardware access remain separate source tools with the dependencies stated in VALIDATION.md.

Install the published host analysis package in a Python 3.15 environment:

python -m pip install loop-timing-witness==0.4.0
loop-timing-witness-analyze path/to/manifest.json --output-dir report

The standalone no_std Rust controller is published as witness-controller. Version 0.4.0 follows the project version; its library is unchanged since 0.1.0:

[dependencies]
witness-controller = "=0.4.0"

Its versioned API reference covers the PID state, coefficient validation and LQR step. Native execution and board adapters remain source tools; the AMP kernel is not a registry crate.

From a source checkout with Python 3.15.2:

make venv
.venv/bin/loop-timing-witness-analyze path/to/manifest.json --output-dir build/report

The analyser reports absolute adjacent-cycle latency jitter in JSON, summary and pair CSV files, and an SVG comparison. Counts expose missing pairs; warm-up and missing cycles are never bridged. This addition is new in 0.2.0; the 0.1.0 artefact does not contain it. See the definition and outputs.

The report writer supports Linux with capability-checked renameat2(RENAME_NOREPLACE) publication. A destination created during staging is preserved and the write fails. Other OS report publication remains unqualified; the pure loading and calculation API below is independent of this native binding. See the host analysis contract.

For programmatic analysis:

from pathlib import Path

from loop_timing_witness.analyze_run import build_report
from loop_timing_witness.run_manifest import load_run

report, cycle_rows = build_report(load_run(Path("path/to/manifest.json")))

Both entry points validate schema identifiers, source/file hashes and run provenance before analysis. A simulation record remains labelled as simulation. The actual package-consumer check, make python-package-tests, builds both wheel and source archive, installs them into independent environments and analyses events produced by the real Icarus RTL path.

The documentation website contains the source guides and Python, Rust and C/C++ API references. Native interfaces are documented in the controller contract, the Rust crate README and the AMP runtime contracts. make documentation-toolchain docs-site builds the source documentation, Python pydoc, both Rustdoc references and the C/C++ Doxygen declaration reference into build/docs-site. Python has NumPy docstring checks. Rustdoc rejects missing public items, warnings and broken intra-doc links. Doxygen rejects undocumented public declarations, structure members and enum values. The site build refuses publication if any maintained language reference is missing.

Validation

Every gate and its exact scope are listed in VALIDATION.md. From a clean checkout with Python 3.15:

make venv        # .venv from the hashed development lock
make preflight   # every local gate, failing closed on a missing tool

Security

Report vulnerabilities privately as described in SECURITY.md.

Licence

AGPL-3.0-or-later, with a commercial licence available; see NOTICE.md and LICENSES/. Licensing metadata follows REUSE 3.x (REUSE.toml).

Citation

Citation metadata is in CITATION.cff. The 0.1.0 source archive is published on Zenodo and binds source commit 1d12e0342d5320f62182fef41709773f3c555b50. The GitHub release includes the same source ZIP and a provenance manifest with verified artifact hashes. Published PyPI/crates.io 0.1.0 artifacts retain their original build provenance and are not replaced by the later source archive. The 0.2.0 source archive is a new version of the same Zenodo record and binds the tagged 0.2.0 release commit; the 0.2.0 GitHub release includes its source ZIP and provenance manifest. The 0.3.0 source archive is the next version of that record and binds the tagged 0.3.0 release commit; the 0.3.0 GitHub release includes its source ZIP and provenance manifest; PyPI kept the 0.2.0 analysis package then, and the 0.3.0 controller crate was published to crates.io on 2026-11-16 from commit 7ed2ce5, whose crate sources equal those of the 0.3.0 tag. The 0.4.0 source archive is the next version of that record and binds the tagged 0.4.0 release commit; the 0.4.0 GitHub release includes its source ZIP and provenance manifest, and PyPI and crates.io carry the 0.4.0 analysis package and controller crate. Cite the software version and the commit you inspected. Software version numbers do not establish physical board qualification or measured platform performance.

Native source-bound simulation capture is available through tools/capture_native_simulation.py; see the host analysis contract for configuration, retained source/binary provenance, the bound parent Python producer context and observed tracking coverage. Optional Linux host load profiles retain actual bounded worker activity and scheduling facts; all captures remain simulation-only.

The source-bound neural verifier is available through the Python API and loop-timing-witness-analyze, and through the standalone Rust analysis crate and loop-timing-witness-analyze-native. The neural analysis contract defines exact source/runtime admission and independent source, capture, numerical, completion and clock verdicts. This interface verifies simulated acquisitions; it does not establish physical device qualification. The crate's loop-timing-witness-campaign-native command analyses repeat campaigns as loop-timing-witness-campaign does.

make native-sbom produces and verifies the complete locked native analysis dependency inventory with cargo-cyclonedx 0.5.10. See native inventory validation for tool installation, exclusive output directories and the source-package scope.

Support development

Support the project through GitHub Sponsors, Buy Me a Coffee, Stripe, PayPal or TWINT. For commercial licensing, contact Anulum.

Anulum Fortis Studio

About

FPGA control-loop event witness software and RTL simulation for PolarFire SoC; physical board qualification pending.

anulum.github.io/loop-timing-witness/

Topics

control-systemsfpgajitterlatencymeasurementpolarfire-socpythonreal-timerisc-vrustsystemverilog

Resources

Readme
AGPL-3.0 license

Code of conduct

Code of conduct

Contributing

Contributing

Security policy

Security policy
Activity

Stars

0 stars

Watchers

0 watching

Forks

1 fork
Report repository

Releases

Sponsor this project

Packages

Used by

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.