Xilinx
HLS
Block Preview

Introduction

Port of KriaTest multichannel_delay (HLS, verbatim) + event_gate (VHDL, verbatim copy kria_event_gate). The trigger runs on the UNDELAYED stream, this block sees it delayed by DELAY frames, so a hit opens the gate DELAY frames “in the past”: that is the pre-trigger. POST_LEN frames are kept after the hit drops.

Output words (KriaTest AGENT/09 payload contract):

  • wtype 0x1 sample: ch, frame_ctr[15:0], flags (b0 first, b1 last, b2 pretrig), I, Q
  • wtype 0x2 hitmap segment (ceil(M/32) per frame, CTRL b2)
  • wtype 0x3 timestamp marker (every 2^TimestampLog2 frames, CTRL b3) EVT_FRAME_HI carries frame_ctr[31:16] of the word (side band).

Pin Description

IN_I Input 16 bit BIT VECTOR
int16 I (chan_glue format).
Default: Must be connected
IN_Q Input 16 bit BIT VECTOR
int16 Q.
Default: Must be connected
IN_CH Input 8 bit BIT VECTOR
Channel index.
Default: Must be connected
IN_LAST Input 1 bit BIT
Last channel of the frame.
Default: Must be connected
VALID_IN Input 1 bit BIT
Input valid.
Default: Must be connected
HIT_IN Input MaxChannels bit BIT VECTOR
HITMAP from Channel Trigger (Event Gate on).
HIT_VALID Input 1 bit BIT
HITMAP valid.
CLK Input 1 bit BIT
DSP clock.
Default: Default Board Clock
RESET Input 1 bit BIT
Synchronous reset (followed by an automatic ring clear).
Default: Default Board Reset
OUT_I Output 16 bit BIT VECTOR
Delayed I.
OUT_Q Output 16 bit BIT VECTOR
Delayed Q.
OUT_CH Output 8 bit BIT VECTOR
Delayed channel index.
OUT_LAST Output 1 bit BIT
Delayed end of frame.
VALID_OUT Output 1 bit BIT
Delayed word valid.
EVT_DATA Output 64 bit BIT VECTOR
64-bit event word (wtype 0x1 / 0x2 / 0x3).
EVT_FRAME_HI Output 16 bit BIT VECTOR
frame_ctr[31:16] of EVT_DATA.
EVT_VALID Output 1 bit BIT
Event word valid.

Properties

Property window

Endpoint Name EndpointName

Name of the register endpoint. Registers are REG___WR/_RD (KriaTest regmap page names: use DDC / CHAN / TRIG / GATE to get the exact KriaTest net names).

Register endpoint name (default GATE).

Default: GATE

Max Channels MaxChannels

Channels handled (DLY_MAX_CHANNELS, power of 2) = HIT_IN width. Must be >= the channelizer M.

DLY_MAX_CHANNELS (8..256).

Default: 256

Options: 8 16 32 64 128 256

Depth (frames per channel) Depth

Ring depth per channel (DLY_DEPTH): maximum DELAY = Depth-1 frames = pre-trigger depth. RAM = Depth x MaxChannels x 32 bit.

DLY_DEPTH frames per channel (16..256).

Default: 256

Options: 16 32 64 128 256

Use UltraRAM UseURAM

Ring in URAM (DLY_USE_URAM=1, KriaTest default: 16 URAM on XCK26 for 256x256). Off = BRAM; required on devices without URAM.

DLY_USE_URAM (KriaTest default on; off for devices without URAM).

Default: True

Event Gate (pre/post trigger) EventGate

Instantiate the KriaTest event_gate: EVT_DATA 64-bit words with per-channel pre/post-trigger gating. Off = delay line only (EVT_* outputs tied low).

Instantiate the event gate (EVT_* and HIT_* pins).

Default: True

Use Channel Mask UseChannelMask

Add registers CH_MASK0..CH_MASK (bit = channel enabled) for the gate. Off = every channel enabled (registers reset to 0, so the mask is opt-in).

Adds CH_MASK registers (opt-in, reset 0).

Default: False

Samples per HLS call SamplesPerCall

nsamp of each HLS call (auto-restart; one few-clock bubble per call, absorbed by the input FIFO). KriaTest used 0x40000000.

nsamp per HLS call.

Default: 1073741824

Options: 65536 1048576 1073741824

Timestamp Marker Period (log2 frames) TimestampLog2

A wtype 0x3 timestamp word every 2^n frames when CTRL b3 (ts_en) is set (KriaTest: 20).

Timestamp marker period (log2 frames).

Default: 20

Options: 10 12 16 20 24

Usage

Registers (endpoint = EndpointName, KriaTest pages GATE + STREAM.CTRL)

register access meaning
CTRL W b0 gate enable, b1 bypass, b2 hitmap_en, b3 ts_en, b4 clear (rising edge)
DELAY W frames of delay = pre-trigger depth (0..Depth-1, clamped); ONE register for ring and gate
PRE_LEN W frames flagged pretrig (capped at DELAY)
POST_LEN W frames kept open after the hit
LOG2_M W log2 of the channel count (hitmap burst size); 0 = log2(MaxChannels)
CH_MASK0.. W only with Use Channel Mask
STATUS / DROP_COUNT / FRAME_COUNT / EVT_COUNT R status, input drops, frames, events (gate openings)

Back-pressure

While the gate emits hitmap/timestamp words it does not consume samples. KriaTest stalled its source; SciCompiler streams cannot be stalled, so a 64-deep input FIFO absorbs it and the excess is DROPPED and counted. With HITMAP_EN the input needs >= ceil(M/32) idle clocks per frame.

Resources & Timing

  • Latency: a few clocks + DELAY frames

  • Throughput: One sample per clock (minus gate stalls, see Back-pressure)

256 ch x 32 frames URAM: 2 URAM, ~0.4k LUT (2.28 ns est.); KriaTest 256 x 256: 16 URAM. Verified: C core bit-exact vs KriaTest, KriaTest’s own tb_event_gate on the copy, generated RTL vs golden in GHDL incl. live DELAY change, clear, timestamp and overflow counting (tb/kria_delaybuf).