TM
Block Preview

Introduction

The Trigger LE TM core implements a leading-edge discriminator optimized for time-multiplexed (TM) data streams, commonly used in high-speed nuclear and particle physics data-acquisition systems. The core processes TM_Factor parallel samples per clock cycle, detecting threshold crossings with sub-clock-cycle precision.

A key feature is the optional hysteresis mode, which uses two separate thresholds (high and low) to prevent false triggers caused by noise when the signal hovers near the threshold level.

Pin Description

CLK Input 1 bit BIT
System sampling clock. All internal operations are synchronous to the rising edge of CLK.
Default: Default Board Clock
RESET Input 1 bit BIT
Synchronous active-high reset. Clears all internal state, threshold comparison history, and inhibition counters.
Default: Default Board Reset
DATA_IN Input WordSize x TM_Factor bit TM
Time-multiplexed input samples to be discriminated. Width is WordSize x TM_Factor bits, containing TM_Factor parallel samples. The LSB corresponds to the oldest sample (t=0), MSB to the newest (t=TM_Factor-1).
Default: Must be connected
POLARITY Input 1 bit BIT

Selects trigger edge polarity.

  • 1 – detect positive excursions (signal rising above threshold)
  • 0 – detect negative excursions (signal falling below threshold) Width = 1 bit.
Default: 1
THRS_HIGH Input WordSize bit BIT VECTOR
Upper threshold level with bit-width equal to WordSize. A trigger START is generated when the signal crosses this threshold in the direction specified by POLARITY.
INHIBIT Input 16 bit BIT VECTOR
Number of clock cycles during which new triggers are suppressed after each trigger event (dead-time). 16-bit unsigned value. Set to 0 for no inhibition.
Default: 0
DATA_OUT Output WordSize x TM_Factor bit TM
Pass-through of the input data. Width equals WordSize x TM_Factor bits.
TRIGGER_TM Output TM_Factor bit TM
Time-multiplexed trigger START vector. Each bit corresponds to one TM sample; bit i is set if sample i caused a trigger START. Width equals TM_Factor bits.
TRIGGER Output 1 bit BIT
Single-cycle pulse generated when any TM sample causes a trigger START. OR-reduction of TRIGGER_TM.
TRIGGER_TM_POS Output ceil(log2(TM_Factor)) bit BIT VECTOR
Binary-encoded index of the first TM sample that triggered (START event). Width equals ceil(log2(TM_Factor)) bits. Valid only when TRIGGER = 1.
TRIGGER_LOW_TM Output TM_Factor bit TM
Time-multiplexed trigger STOP vector (when signal falls below THRS_LOW). Each bit corresponds to one TM sample; bit i is set if sample i caused a trigger STOP. Width equals TM_Factor bits.
TRIGGER_LOW Output 1 bit BIT
Single-cycle pulse generated when any TM sample causes a trigger STOP. OR-reduction of TRIGGER_LOW_TM.
TRIGGER_LOW_TM_POS Output ceil(log2(TM_Factor)) bit BIT VECTOR
Binary-encoded index of the first TM sample that triggered the STOP event. Width equals ceil(log2(TM_Factor)) bits. Valid only when TRIGGER_LOW = 1.
TOT_TM Output TM_Factor bit TM
Time-over-Threshold vector at TM resolution. Each bit indicates whether the corresponding TM sample is above THRS_HIGH. Width equals TM_Factor bits.
TOT Output 1 bit BIT
Time-over-Threshold flag. OR-reduction of TOT_TM. High when any TM sample is above threshold.
THRS_LOW WordSize bit
Lower threshold level for hysteresis mode, with bit-width equal to WordSize. When USE_HYSTERESIS = 1, a trigger STOP is generated when the signal falls below this level. Should be set to THRS_LOW <= THRS_HIGH for correct operation. Only visible when Hysteresis property is enabled.
USE_HYSTERESIS

Runtime enable for hysteresis mode.

  • 1 – Use separate high/low thresholds (hysteresis enabled)
  • 0 – Use only THRS_HIGH (hysteresis disabled) Only visible when Hysteresis property is enabled.
Default: 0

Properties

Property window

Analog Channel Word Size Wordsize

Set the analog channel word size in bits

Bit-width of each sample within the TM frame. Applies to DATA_IN, THRS_HIGH, THRS_LOW and DATA_OUT signals. Available values: 16, 32, 64, default 16. Note: This property is typically hidden and auto-configured based on the connected signal.

Default: 16

Options: 16 32 64

Time Mux TimeMultiplexing

Set number of samples for each clock cycle

Number of parallel samples processed per clock cycle (TM_Factor). Determines the effective sampling rate multiplication and sub-clock timing resolution. Available values: 2, 4, 8, 16, 32, default 4.

Default: 4

Options: 2 4 8 16 32

Hysteresis Hysteresis

Enable hysteresis logic to separate L->H to H->L commutation

Enable hysteresis logic to use separate thresholds for trigger arming and disarming. When enabled, the THRS_LOW and USE_HYSTERESIS inputs become available.

  • False (default) – Single threshold mode
  • True – Hysteresis mode with separate high/low thresholds

Default: False

Usage

Functional overview

The core compares each of the TM_Factor parallel input samples against the programmable threshold(s) and detects transitions:

Without hysteresis (USE_HYSTERESIS = 0):

  • Single threshold THRS_HIGH is used
  • Trigger START occurs when signal crosses THRS_HIGH (low-to-high transition)
  • Trigger STOP occurs simultaneously with START (instantaneous pulse)

With hysteresis (USE_HYSTERESIS = 1):

  • Two thresholds are used: THRS_HIGH and THRS_LOW (where THRS_LOW <= THRS_HIGH)
  • Trigger START occurs when signal crosses THRS_HIGH (low-to-high transition)
  • Trigger STOP occurs when signal falls below THRS_LOW (high-to-low transition)
  • The trigger remains “armed” only after the signal has fallen below THRS_LOW

What is Hysteresis?

Hysteresis is a technique used to prevent spurious trigger events caused by noise when the signal amplitude is close to the threshold level. Without hysteresis, noise fluctuations can cause the signal to repeatedly cross the threshold, generating multiple false triggers from a single pulse.

With hysteresis enabled, two distinct thresholds are defined:

  • THRS_HIGH: The signal must rise above this level to generate a trigger START
  • THRS_LOW: The signal must fall below this level before the trigger can be re-armed

This creates a “dead zone” between the two thresholds where crossing events are ignored, effectively filtering out noise-induced oscillations.

Hysteresis behavior

In the figure above:

  • The red line shows the threshold level
  • The green region indicates when the trigger is waiting to be re-armed (signal must fall below THRS_LOW)
  • TRIGGER REARMED marks when the system is ready to accept a new trigger
  • The TOT signal shows the Time-over-Threshold duration
  • The TRIGGER pulse marks the leading edge detection

Polarity

The POLARITY input allows inverting the trigger logic:

  • POLARITY = 1 (positive): Trigger on rising edges (signal going above threshold)
  • POLARITY = 0 (negative): Trigger on falling edges (signal going below threshold)

Dead-time Inhibition

After each trigger, new triggers can be inhibited for a programmable number of clock cycles using the INHIBIT input. This prevents re-triggering on the same pulse or on pile-up events.

The inhibition operates at the TM sample level, meaning the exact inhibition duration is: $$ t_{inhibit} = \text{INHIBIT} \times T_{clk} $$

where $T_{clk}$ is the clock period. The inhibition mask is applied precisely, ensuring consistent dead-time regardless of where within the TM frame the trigger occurred.


Time-over-Threshold (ToT)

The core provides ToT outputs that indicate how long the signal remains above the threshold. Two methods are available (selected at compile time via TOT_METHOD generic):

  • Method 0 (Full): ToT starts with trigger START and ends when signal falls below THRS_HIGH
  • Method 1 (Simple): ToT directly reflects whether the signal is above THRS_HIGH

Time-multiplexed outputs

The core provides multiple trigger-related outputs with TM precision:

  • TRIGGER – single-bit pulse, asserted for one clock cycle when any TM channel triggers
  • TRIGGER_TM – TM_Factor-bit vector indicating which specific TM sample triggered
  • TRIGGER_TM_POS – binary-encoded index of the first triggering TM sample

Similarly for the STOP event (when using hysteresis):

  • TRIGGER_LOW – single-bit pulse when signal falls below THRS_LOW
  • TRIGGER_LOW_TM – TM vector for the low threshold crossing
  • TRIGGER_LOW_TM_POS – binary index of the STOP event
 

Timing

  • Threshold comparisons are performed combinatorially on the input data.
  • Transition detection and trigger generation occur with 1 clock cycle latency.
  • DATA_OUT provides a pass-through of the input data (no additional delay).

Typical applications

  • Photon or particle counting with scintillators and SiPM/PMT front-ends
  • Leading-edge discriminator with noise rejection via hysteresis
  • Digital oscilloscope trigger with programmable dead-time
  • Pulse width measurement using ToT outputs