RF Kria TDM Power Spectrum
Power histogram (MCA) of the KriaTest firmware (mon_spectrum): accumulates |I|^2 + |Q|^2 of one or all channels of the channelized TDM stream into a read-only memory window.
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
Properties
Name of the register endpoint. Registers are REG_
SPEC).
Default: SPEC
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).