Xilinx
TM
HLS
Block Preview

Introduction

The QDC/PSD HLS TM block implements digital charge integration (QDC) with optional Pulse Shape Discrimination (PSD) for particle identification in time-multiplexed (TM) systems.

This block is designed for high-speed ADC systems where multiple samples are processed per clock cycle. It supports TM factors of 2, 4, 8, 16, or 32 samples per clock.

PSD is used to distinguish different particle types (e.g., neutrons vs. gammas) based on their scintillation pulse shape. Different particles produce different light decay time constants in scintillators, allowing discrimination by comparing charge integrated over different time windows.

The block provides:

  • Qlong: Total charge integrated over the long gate
  • Qshort: Charge integrated over the short gate (fast component)
  • PSD: Ratio of Qshort/Qlong or Qlong/Qshort (selectable)

The core uses Xilinx HLS for efficient FPGA implementation.

Pin Description

AN In Input 16×TM bit TM
16-bit × TM analog input signal from ADC. Time-multiplexed input with TM samples packed per clock cycle. Connected to the detector output (typically through preamplifier or direct PMT/SiPM).
Default: Must be connected
TRIGGER IN Input 1 or TM bit BIT

Trigger input pulse.

  • In SIMPLE mode: 1-bit signal, starts integration for all TM phases
  • In TM mode: TM-bit vector, individual trigger per phase HIGH for one clock/sample when pulse is detected.
Default: Must be connected
BASELINE IN Input 16 bit BIT VECTOR
16-bit baseline value to subtract from input samples. Connect to a baseline restorer output for DC offset removal. Set to 0 if no baseline subtraction is needed.
PRE INT Input 16 bit BIT VECTOR
16-bit pre-integration time in sample counts. Number of samples to integrate BEFORE the trigger. Captures the rising edge of the pulse. Typical values: 5-50 samples.
QLONG TIME Input 16 bit BIT VECTOR
16-bit long integration gate duration in sample counts. Total integration time after trigger for Qlong. Should capture the full pulse including the slow decay component. Typical values: 200-2000 samples depending on scintillator decay time.
QSHORT TIME Input 16 bit BIT VECTOR
16-bit short integration gate duration in sample counts. Integration time after trigger for Qshort. Should capture mainly the fast component of the pulse. Typical values: 20-100 samples.
POST INIB Input 16 bit BIT VECTOR
16-bit post-integration inhibit time in sample counts. Additional dead time after QLONG_TIME ends. Events during this window cause single-event rejection (DREJ). Prevents pile-up from affecting subsequent measurements.
GAIN Input 16 bit BIT VECTOR
16-bit gain factor for 16-bit output scaling. Represents a value between 0 (0x0000) and 1 (0xFFFF). Applied to QLONG_32 and QSHORT_32 to generate 16-bit outputs. Adjust to fit the charge range in 16 bits.
TIMETAG Input 64 bit BIT VECTOR
64-bit timestamp input. Captured at trigger time and output on TIMESTAMP.
RST_STAT Input 1 bit BIT
Reset statistics signal. Clears rejection counters REJ_CNT and DREJ_CNT when asserted.
CLK Input 1 bit BIT
System clock input. All operations are synchronous to the rising edge.
Default: Default Board Clock
RESET Input 1 bit BIT
Synchronous reset. Clears all internal state and accumulators.
Default: Default Board Reset
DATA_OUT Output 16×TM bit TM
16-bit × TM delayed input signal output. Input signal delayed by the IP pipeline for alignment.
DATA_VALID Output 1 bit BIT
Data valid strobe. HIGH for one clock cycle when QLONG, QSHORT, and PSD outputs are valid.
QLONG_32 Output 32 bit BIT VECTOR
32-bit long integration result (full resolution). Raw charge sum without gain applied.
QSHORT_32 Output 32 bit BIT VECTOR
32-bit short integration result (full resolution). Raw charge sum without gain applied.
QLONG_16 Output 16 bit BIT VECTOR
16-bit long integration result. Qlong_32 scaled by GAIN for reduced data width.
QSHORT_16 Output 16 bit BIT VECTOR
16-bit short integration result. Qshort_32 scaled by GAIN for reduced data width.
QLONG_GATE Output 1 bit BIT
Qlong integration gate signal (combined). HIGH during the long integration window.
QSHORT_GATE Output 1 bit BIT
Qshort integration gate signal (combined). HIGH during the short integration window.
PSD Output 32 bit BIT VECTOR
32-bit PSD ratio output. Fixed-point ratio (Qlong/Qshort or Qshort/Qlong based on PSD Mode). Maximum value (2^32) when ratio equals 1.
TIMESTAMP Output 64 bit BIT VECTOR
64-bit timestamp output. Captured TIMETAG value at trigger time.
INIB Output 1 bit BIT
Inhibit signal. HIGH when integration is in progress and new triggers are blocked.
REJ Output 1 bit BIT
Rejection flag (pulse). HIGH when a pile-up during QLONG window caused both events to be rejected.
DREJ Output 1 bit BIT
Double rejection flag (pulse). HIGH when a pile-up during POST_INIB caused the second event to be rejected.
REJ_CNT Output 32 bit BIT VECTOR
32-bit rejection counter. Counts events rejected due to pile-up during QLONG window. Reset by RST_STAT.
DREJ_CNT Output 32 bit BIT VECTOR
32-bit double rejection counter. Counts events rejected due to pile-up during POST_INIB. Reset by RST_STAT.
QLONG_GATE_TM TM bit
Qlong integration gate signal per TM phase. Only available when Trigger Mode = TM. Each bit indicates the gate state for the corresponding TM phase.
QSHORT_GATE_TM TM bit
Qshort integration gate signal per TM phase. Only available when Trigger Mode = TM. Each bit indicates the gate state for the corresponding TM phase.

Properties

Property window

Enable PSD use_psd

Default: False

PSD Mode psd_mode

Select PSD calculation mode

Default: Qlong/Qshort

Options: Qlong/Qshort Qshort/Qlong

Time Mux TimeMultiplexing

Set number of samples for each clock cycle

Number of samples processed per clock cycle. Determines the time-multiplexing factor. Available values: 2, 4, 8, 16, 32, default 4.

Default: 4

Options: 2 4 8 16 32

Trigger Mode TriggerMode

Select if trigger is SIMPLE or TM

Trigger input mode selection.

  • SIMPLE: Single-bit trigger starts integration for all TM phases simultaneously. Timing accuracy is one system clock cycle.
  • TM: TM-bit trigger vector allows individual phase triggering. Timing accuracy is one sample period (1/TM of clock cycle). When set to TM, additional outputs QLONG_GATE_TM and QSHORT_GATE_TM become available. Available values: SIMPLE, TM, default SIMPLE.

Default: SIMPLE

Options: SIMPLE TM

EnablePSD EnablePSD
Enable PSD calculation. When disabled, only QDC (charge integration) is performed. Available values: True, False, default False.
PSDMode PSDMode

PSD calculation mode.

  • Qlong/Qshort: PSD = (Qlong / Qshort) * 2^32
  • Qshort/Qlong: PSD = (Qshort / Qlong) * 2^32 Available values: Qlong/Qshort, Qshort/Qlong, default Qlong/Qshort.

Usage

PSD Principle

PSD diagram

The figure illustrates the pulse shape discrimination principle:

  • Qlong integrates the full pulse (PRE_INT to QLONG_TIME after trigger)
  • Qshort integrates only the fast component (PRE_INT to QSHORT_TIME after trigger)
  • The ratio between these charges discriminates particle types

PSD Simulation Example

PSD simulation

The simulation shows typical PSD waveforms with Qlong and Qshort integration gates.


Time-Multiplexed Processing

In TM mode, the block processes multiple samples per system clock cycle:

TM Factor Samples/Clock Effective Sample Rate
2 2 2x clock frequency
4 4 4x clock frequency
8 8 8x clock frequency
16 16 16x clock frequency
32 32 32x clock frequency

Important: The interpretation of integration time parameters (PRE_INT, QLONG_TIME, QSHORT_TIME, POST_INIB) depends on the Trigger Mode:

  • SIMPLE mode: Parameters are in clock cycles (all TM phases integrate together)
  • TM mode: Parameters are in sample counts (each phase integrates independently)

Trigger Mode Selection

The Trigger Mode property controls how the trigger input is interpreted:

Mode Trigger Input Timing Accuracy Description
SIMPLE 1-bit signal TM group Single trigger signal starts integration for all TM phases simultaneously. Timing resolution equals one system clock cycle.
TM TM-bit vector Single sample Individual trigger for each TM phase. Timing resolution equals one sample period (1/TM of clock cycle).

SIMPLE Mode:

  • Trigger input is a single bit
  • When triggered, integration starts at the same point for all TM phases
  • Simpler to use with external trigger sources
  • Timing accuracy: 1 system clock cycle

TM Mode:

  • Trigger input is a vector with one bit per TM phase
  • Each phase can trigger independently
  • Provides maximum timing accuracy
  • Additional outputs: QLONG_GATE_TM, QSHORT_GATE_TM (per-phase gate signals)
  • Timing accuracy: 1 sample period (1/TM of clock cycle)

PSD Calculation Modes

The PSD value can be calculated using two formulas, selectable via the PSD Mode property:

Mode 1: Qlong/Qshort (default)

$$ \text{PSD} = \frac{Q_{\text{long}}}{Q_{\text{short}}} \times 2^{32} $$

Mode 2: Qshort/Qlong

$$ \text{PSD} = \frac{Q_{\text{short}}}{Q_{\text{long}}} \times 2^{32} $$

The choice depends on the application:

  • Qlong/Qshort: Larger values for particles with slower decay (e.g., neutrons in organic scintillators)
  • Qshort/Qlong: Complementary ratio, may be preferred for some analysis methods

Integration Timing

The charge integration windows are defined as:

  Trigger
   |
   v
|--PRE_INT--|------------------QLONG_TIME-----------------|--POST_INIB--|
            |--------QSHORT_TIME--------|
            ^                           ^                              ^
            |                           |                              |
       Integration                 Qshort ends                   Ready for
         starts                                                  next event
  
  • PRE_INT: Samples to include before the trigger (captures rising edge)
  • QLONG_TIME: Duration of long integration gate after trigger
  • QSHORT_TIME: Duration of short integration gate after trigger
  • POST_INIB: Additional dead time after Qlong for pile-up rejection

All timing values are in sample counts (not clock cycles).


Pile-Up Rejection

The block implements non-paralyzable pile-up rejection:

Event Timing Behavior
Trigger during QLONG window Both events rejected (REJ flag)
Trigger during POST_INIB Only second event rejected (DREJ flag)
Trigger after POST_INIB Both events accepted normally

Rejection counters (REJ_CNT, DREJ_CNT) track discarded events for rate analysis.


Output Formats

The block provides charge values in two formats:

Output Bits Gain Applied Use Case
QLONG_32 / QSHORT_32 32 No Full resolution for analysis
QLONG_16 / QSHORT_16 16 Yes Reduced data for histogramming

The GAIN parameter scales the 32-bit values to fit in 16 bits:

$$ Q_{16} = \frac{Q_{32} \times \text{GAIN}}{65536} $$


Baseline Subtraction

The BASELINE IN input allows real-time baseline subtraction:

$$ Q = \sum_{i=0}^{N} (x[i] - \text{baseline}) $$

Connect a baseline restorer block output to remove DC offset and improve energy resolution.


Timing and Latency

  • Processing latency: 1 clock cycle
  • Throughput: TM samples per clock cycle

Typical Applications

  • High-speed neutron/gamma discrimination with fast scintillators
  • Multi-GSPS ADC systems
  • Phoswich detector readout at high rates
  • Time-of-flight measurements requiring precise timing
  • PET systems with high count rates