Block equalizer

A receiver’s equalizer as a pipeline of free-running modules on streams. Symbols arrive in rows, each row through its own channel h[i] with noise of variance N[i]; the kernel computes, per row, the MMSE equalizer

\[g_i = \frac{\overline{h_i}}{|h_i|^2 + N_i}\]

and applies it to every symbol of the row: $z_{i,j} = g_i \, r_{i,j}$. If those terms are new, start with What an equalizer does.

It is the second kernel example because it adds exactly one thing to the free-running polynomial: several modules. A division once a row and a multiply once a symbol run at different rates, so they are two stages; one input carries what both need, so the framework’s StreamBroadcast gives each its own copy; and gain hands its result to apply on a stream between them.

flowchart LR
  src(["source"])
  sink_out(["sink"])
  sink_st(["sink"])
  subgraph beq["block_eq"]
    direction LR
    bc["StreamBroadcast(2)"]
    gain["gain"]
    apply["apply"]
    bc --> gain
    bc --> apply
    gain -- "g" --> apply
  end
  src -- "s_in" --> bc
  apply -- "m_out" --> sink_out
  apply -- "m_status" --> sink_st

Learning Objectives

Only what this example adds to the free-running polynomial, in the order the pages teach it:

  1. Compute a row’s MMSE equalizer gain g = conj(h) / (|h|^2 + N) by hand, and say what it does that 1/h does not on a weak channel.
  2. Define a protocol whose one input carries several kinds of data per command (the command, the estimates, the symbols: three bursts), and a message between stages that carries the command and its errors to the last stage.
  3. Write a float32 golden in a fixed operation order – one rounding per operation, no fused multiply-add – and compare results by their bits, signed zeros included.
  4. Split a computation into stages where its rate changes: a division once a row, a multiply once a symbol.
  5. Give two stages one input with a StreamBroadcast, and order each stage’s reads by the keep-consuming rule, so the broadcast’s lockstep cannot deadlock.
  6. Write a composite of free-running modules: children, internal framed streams with depths sized against what can pile up in them, a boundary.
  7. Write each stage’s HLS body once, with its port types as template parameters, so the same body runs as a stage alone and inside the composite.
  8. Verify each stage alone in its own harness – the downstream stage driven by the golden’s link messages – then the composite: four systems on one build DAG, in pysim and at RTL.

The pages

  • What an equalizer does – the channel, the equalizer, the MMSE gain, in plain words and one worked number.
  • The protocol – one input, three bursts a command; the two outputs; fatal errors.
  • The golden – the schemas, the float32 operation order, the worked examples, the scenarios.
  • The stages – why two, the broadcast and its rule, gain and apply in Python, the composite and its link depths.
  • The HLS bodies – each stage’s body loop by loop; one body, two placements.
  • The system flow – four systems on one DAG; the gates.

Running it

python -m examples.block_eq.block_eq_build --through pysim          # pysim only
python -m examples.block_eq.block_eq_build                          # the composite through compare
python -m examples.block_eq.block_eq_build --through gain_compare   # gain alone, at RTL
python -m examples.block_eq.block_eq_build --through apply_compare  # apply alone, at RTL
python -m examples.block_eq.block_eq_build --through early_compare  # the fatal early TLAST, at RTL

The gates are tests/examples/test_block_eq.py. Measured with Vitis HLS and Vivado 2025.1.


Table of contents