Xilinx
HLS
Block Preview

Introduction

Port of the KriaTest channel_trigger HLS block (verbatim source, ap_ctrl_hs + AXI-Stream), with its software control plane implemented in a VHDL wrapper. It works on the TDM output of the Polyphase Channelizer (one channel per clock), so it is TM by nature.

Per channel: OFF -> p >= TH_UP counts up (else down, saturating 0..N_ON), reaching N_ON switches ON; ON -> p <= TH_DOWN counts up (0..N_OFF), reaching N_OFF switches OFF.

Pin Description

IN_I Input IqWidth bit BIT VECTOR
Channel sample I (signed, IqWidth).
Default: Must be connected
IN_Q Input IqWidth bit BIT VECTOR
Channel sample Q.
Default: Must be connected
IN_CH Input 8 bit BIT VECTOR
Channel index (low log2(MaxChannels) bits used). The same channel must not repeat within 8 clocks (true for any channelizer frame, M >= 8).
Default: Must be connected
IN_LAST Input 1 bit BIT
Last channel of the frame (triggers the HITMAP word).
Default: Must be connected
VALID_IN Input 1 bit BIT
Input valid.
Default: Must be connected
CLK Input 1 bit BIT
DSP clock.
Default: Default Board Clock
RESET Input 1 bit BIT
Synchronous reset (followed by an automatic clear call).
Default: Default Board Reset
OUT_PWR Output PowerWidth bit BIT VECTOR
I^2+Q^2 (MSBs if PowerWidth < 2*IqWidth).
OUT_CH Output 8 bit BIT VECTOR
Channel index of OUT_PWR.
OUT_TRIG Output 1 bit BIT
Channel state after this sample (masked).
OUT_LAST Output 1 bit BIT
Last channel of the frame.
VALID_OUT Output 1 bit BIT
Power word valid.
HITMAP Output MaxChannels bit BIT VECTOR
Per-frame map of ON channels (bit n = channel n), masked.
HIT_VALID Output 1 bit BIT
HITMAP valid (one clock per frame).

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 TRIG).

Default: TRIG

Max Channels MaxChannels

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

TRG_MAX_CHANNELS (8..256): HITMAP width.

Default: 256

Options: 8 16 32 64 128 256

I/Q Bit Width IqWidth

Width of IN_I / IN_Q (TRG_IQ_W). 16 = the int16 channelizer output (power Q2.30, thresholds 32 bit).

TRG_IQ_W (8..16).

Default: 16

Options: 8 10 12 14 16

Power Output Width PowerWidth

Width of OUT_PWR (TRG_POW_W). If narrower than 2*IqWidth the MSBs of I^2+Q^2 are output.

TRG_POW_W (16, 24, 32).

Default: 32

Options: 16 24 32

Persistence Counter Width CounterWidth

Bits of the N_ON / N_OFF persistence counters (TRG_CNT_W): N_ON/N_OFF up to 2^w-1 frames.

TRG_CNT_W (4, 6, 8).

Default: 8

Options: 4 6 8

Use Channel Mask UseChannelMask

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

Adds the CH_MASK registers (reset 0 = all masked, so it is opt-in).

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 (auto-restart).

Default: 1073741824

Options: 65536 1048576 1073741824

Usage

Registers (endpoint = EndpointName, KriaTest page TRIG)

register access meaning
CTRL W b0 clear (rising edge: abort + clear call)
TH_UP / TH_DOWN W power thresholds (low 2*IqWidth bits) - LIVE
N_ON / N_OFF W persistence in frames (low CounterWidth bits) - LIVE
CH_MASK0.. W only with Use Channel Mask: bit n = channel n enabled (masks HITMAP and OUT_TRIG)
STATUS R b0 running, b1 clearing, b4 drop
DROP_COUNT R input samples lost on a full input FIFO

Vitis wires the threshold scalars straight into the loop, so new values act on the next sample (verified in the generated RTL).

Resources & Timing

  • Latency: a few clocks (HLS pipeline) + 1 output register

  • Throughput: One sample per clock

MaxChannels=256: 1 BRAM18, 2 DSP, ~1.4k FF (2.87 ns est.). Verified bit-exact vs the KriaTest C core and in GHDL on the generated RTL (tb/kria_trigger: 3 configurations, live threshold change, clear, HLS restart at 100 % duty).