Chan Select (chan_select)
Selects one channel from a positional 16-sample interleaved frame and batches its IQ samples into large output messages, stripping positional metadata.
Tested platforms include xsim.
Design
The chan_select worker is a positional diagnostic tap for the upstream
stages of the folded demodulator — the channelizer, decimate3, bd_x16,
and cr_x16 — all of which emit 16-sample sample_op_e messages where
bin identity is determined by position within the message (slot 0 through
slot 15), not by an embedded metadata tag.
For each incoming 16-sample message the worker:
Resets its slot counter
posto zero on everySOMbeat; this guarantees recovery from any mis-alignment on the next SOM.Compares the current slot
posagainst the configuredchannelproperty; when they match, the IQ word is pushed into a 2048-deep distributed-RAM FIFO.All non-matching slots are discarded silently.
Accumulated samples are emitted as batched sample_op_e output messages of
up to 1024 samples each (BATCH = 1024). Batching is critical for DMA
throughput: without it the per-slot message rate at channelizer output rates
saturates the host file_write consumer. At EOF any partial batch is
flushed before the output EOF is asserted.
This worker is the positional counterpart to tag_select. Use
chan_select on the channelizer/decimate3/bd_x16/cr_x16
streams; use tag_select on the tagged outputs of
ted_x16/dsd_x16/fs_x16.
Interface
<?xml version='1.0' encoding='utf-8'?>
<!-- chan_select: pick ONE channel out of the interleaved 16-channel stream and
output its IQ samples ONLY (metadata stripped). Input is the channelizer /
decimate3 stream: metadata(id=0, value=abs_bin) + sample per IQ. The worker
forwards just the sample messages whose preceding metadata tag == `channel`,
dropping all metadata and all other channels. Intended as a debug tap:
wire its output to file_write to capture/validate one channel's samples
before adding the demod. -->
<ComponentSpec>
<property name="channel" type="uchar" writable="true" default="0"
description="Absolute bin (0..63) to select; samples of all other bins are dropped"/>
<port name="input" producer="false" protocol="complex_short_timed_sample-prot"/>
<port name="output" producer="true" protocol="complex_short_timed_sample-prot"/>
</ComponentSpec>
Ports
Inputs:
input: Positional 16-sample interleaved frame stream from the channelizer, decimate3, bd_x16, or cr_x16; complex_short_timed_sample-prot, sample opcode, 16 IQ words per message.Protocol:
complex_short_timed_sample-protOptional:
False
Outputs:
output: Batched sample stream for a single selected slot; complex_short_timed_sample-prot, sample opcode only.Protocol:
complex_short_timed_sample-protOptional:
False
Opcode Handling
On the input port, chan_select consumes only sample_op_e messages.
Any other opcodes present on the input are consumed (the worker always asserts
take) but are not forwarded.
Output messages carry only the sample_op_e opcode.
Properties
channel: Absolute bin (0..63) to select; samples of all other bins are dropped.Type:
ucharAccess:
Parameter:
FalseWritable:
TrueInitial:
FalseVolatile:
False
Default value:
0
Implementations
chan_select(HDL)HDL implementation of a positional channel selection tap that extracts and batches one slot from a 16-sample interleaved frame stream.
Dependencies
The chan_select HDL worker depends on:
ieee.std_logic_1164
ieee.numeric_std
ocpi.types(OpenCPI-generated protocol opcode constants)
The 2048-entry FIFO is implemented as a ram_style="distributed" LUT RAM
inferred from the fifo_t array signal.
Limitations
Limitations of chan_select are:
The
channelproperty selects by slot position (0..15); it cannot select bins by absolute bin number (0..63) — use the absolute-bin value that corresponds to the desired slot in the given channelizer port’s assignment.FIFO depth is 2048 samples (fixed at elaboration). Sustained output back-pressure beyond 2048 kept samples results in silently dropped IQ words.
The worker always consumes input (
takeis tied toinput_in.ready), so applying back-pressure upstream is not possible.
Testing
The chan_select component has a unit test suite (chan_select.test)
driven by generate.py / verify.py. The test injects a synthetic
16-sample-frame stream, selects each slot in turn, and confirms that only the
chosen slot’s IQ samples appear in the batched output and that the batch
boundaries are correct.
Tested platforms: None