Xilinx
Block Preview

Introduction

Port of KriaTest fw/rtl/regs/mon_spectrum.vhd (register page MON_SPEC_* and BRAM window 0xC000). Wire IN_* to the Polyphase Channelizer outputs and CHSEL to the Kria TDM Oscilloscope CHSEL_OUT (KriaTest: the spectrum follows OSC_CHSEL; 0xFF = every channel).

Pin Description

IN_I Input 16 bit BIT VECTOR
IN_Q Input 16 bit BIT VECTOR
IN_CH Input 8 bit BIT VECTOR
IN_LAST Input 1 bit BIT
VALID_IN Input 1 bit BIT
CHSEL Input 8 bit BIT VECTOR
Channel select (0xFF = all), from the oscilloscope CHSEL_OUT; 0 when unconnected.
CLK Input 1 bit BIT
Default: Default Board Clock
RESET Input 1 bit BIT
Default: Default Board Reset
IN_I / IN_Q 16 bit
TDM channel sample (int16).
IN_CH / IN_LAST / VALID_IN 8 bit
TDM channel index, last-of-frame, valid.
CLK / RESET 1 bit
CLK_ACQ, synchronous reset (starts a flush).

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

Default: SPEC

Bins (window depth) Bins

Number of histogram bins = memory window size (power of 2). KriaTest: 16384 bins = 16 RAMB36.

Histogram size, 1024..16384 (KriaTest 16384 = 16 RAMB36).

Default: 16384

Options: 1024 2048 4096 8192 16384

Usage

Binning

bin = (pwr - SPEC_MIN) » SPEC_REBIN, saturated to Bins-1; samples outside [SPEC_MIN, SPEC_MAX] are discarded. pwr = I^2 + Q^2, 32-bit exact.

Use

SPEC_MIN / SPEC_MAX / SPEC_REBIN / SPEC_LIMIT, then SPEC_CTRL = 1 (flush, ~Bins clocks), SPEC_CTRL = 2 (reset counters), SPEC_CTRL = 4 (start). Reads of the window are non-destructive.

Registers (endpoint = EndpointName, default SPEC)

register access meaning
SPEC_CTRL W b0 flush, b1 reset (write-1-to-pulse), b2 start (level)
SPEC_LIMIT W [27:0] limit, [31:30] mode: 00 free, 01 counts, 10 milliseconds
SPEC_REBIN W [4:0] shift
SPEC_MIN W lower power bound
SPEC_MAX W upper power bound
SPEC_STATUS R b0 running, b1 completed, b2 lost (sticky, RMW busy), [31:4] limit counter
Memory DATA: Bins x 32 bit counts, read-only.

Differences from KriaTest: the registers reset to 0 (KriaTest SPEC_MAX reset was 0xFFFFFFFF: write SPEC_MAX before starting); the window/rebin stage is pipelined one clock more (same histogram).

Resources & Timing

  • Latency: a few clocks per event (read-modify-write, one event per 3 clocks)

  • Throughput: events arriving during a RMW set the lost flag

Bins x 32 bit true-dual-port block RAM. Verified in GHDL (tb/kria_monitors).