Skip to content

Trigger I/O (White-Rabbit + EPICS)

The standards-interop seam for the chamber-side trigger lane: a White-Rabbit sub-nanosecond TAI timestamp, the timestamped sensor-edge ingress and trigger-edge egress events, the sensor-to-trigger latency contract, and the EPICS process-variable names a control system publishes. This is a contract, not a White-Rabbit or EPICS runtime — it carries no hardware or channel-access dependency.

Contract

  • WhiteRabbitTimestamp(tai_seconds, nanoseconds, picoseconds) — a TAI instant at picosecond resolution, with picoseconds_since for signed deltas.
  • TriggerIngress — a timestamped sensor-edge event carrying the MIF-008 fabric evidence (spike_count, confidence_q8_8, bank_ready, safety_veto).
  • TriggerEgress — the timestamped fire/veto decision leaving for the coil switch.
  • egress_latency_ps(ingress, egress) — sensor-edge → trigger-edge latency in picoseconds; raises if the egress precedes its ingress (a trigger cannot precede the evidence that caused it).
  • epics_channel(signal) / epics_channels() — the SCPN:MIF:TRIG:* PV names for the ingress evidence, the fire/veto edges, the timestamps, and the latency.

examples/interop_bridge.py wraps a real evaluate_merge_trigger decision in this contract and reports the latency and channels.

Python API

trigger_io

Timestamped trigger ingress/egress contract for the MIF chamber-side lane.

This is a contract, not a runtime: typed data structures and channel naming that a White-Rabbit timing fabric and an EPICS or MARTe2 real-time consumer would use to ingest the sensor edge and emit the compression-trigger edge. It carries no network or device code; it defines the seam so siblings and integrators agree on timestamp semantics and signal names.

White Rabbit (CERN, IEEE 1588 PTP plus physical-layer syntonisation) provides sub-nanosecond synchronisation, so a single floating nanosecond field would throw away its precision. Timestamps here are an integer TAI second plus an integer nanosecond plus an integer picosecond, which preserves the sub-nanosecond budget the trigger path is designed around (the same budget decomposed in bench/results/trigger_latency_budget.json). EPICS process-variable names follow the SCPN:MIF:... convention so a control system can bind the channels directly.

WhiteRabbitTimestamp(tai_seconds, nanoseconds, picoseconds=0) dataclass

A White-Rabbit TAI timestamp with sub-nanosecond resolution.

Parameters

tai_seconds : int TAI seconds since the epoch; must be non-negative. nanoseconds : int Nanoseconds within the second, in [0, 1_000_000_000). picoseconds : int Sub-nanosecond remainder, in [0, 1000); carries the White-Rabbit sub-nanosecond precision.

total_picoseconds property

Return the timestamp as a single integer picosecond count.

__post_init__()

Validate the timestamp fields without changing their precision.

picoseconds_since(earlier)

Return the signed picosecond interval from earlier to this stamp.

TriggerIngress(timestamp, spike_count, confidence_q8_8, bank_ready, safety_veto) dataclass

A timestamped sensor-edge event arriving at the trigger fabric.

The evidence fields mirror the MIF-008 fabric inputs so the contract is the one decision the chamber-side lane consumes.

TriggerEgress(timestamp, fire, veto_active) dataclass

A timestamped trigger-edge decision leaving for the coil switch.

egress_latency_ps(ingress, egress)

Return the sensor-edge to trigger-edge latency in picoseconds.

Raises ValueError if the egress is not at or after the ingress; a trigger cannot precede the evidence that caused it.

epics_channel(signal)

Return the EPICS process-variable name for a trigger-lane signal.

epics_channels()

Return every trigger-lane signal mapped to its EPICS process-variable name.