Skip to content

rfnoc: fft: Read direction back from the block - #954

Open
sidcraftscode wants to merge 1 commit into
EttusResearch:masterfrom
sidcraftscode:fft-direction-readback
Open

sidcraftscode wants to merge 1 commit into
EttusResearch:masterfrom
sidcraftscode:fft-direction-readback

Conversation

@sidcraftscode

@sidcraftscode sidcraftscode commented Nov 8, 2026 •

Copy link
Copy Markdown

Pull Request Details

Description

_set_direction() in host/lib/rfnoc/fft_block_control.cpp pokes REG_DIRECTION and then checks it with get_direction(), which returns the _direction property. That is the value the resolver just passed in, so the check compares the value with itself and "FFT Direction readback failed!" can never fire. Length, magnitude and scaling peek their register after the write; now direction does too.

Related Issue

None.

Which devices/areas does this affect?

Host side of the RFNoC FFT block. On compat 2.x/3.x blocks the peek reads 0x1C, which fft_core.sv returns as reg_fft_direction.

Testing Done

  • Ran fft_core.sv in Verilator (FFT pipeline stubbed out) with the same poke-then-peek on 0x1C: it reads back 0 and 1 as written.
  • Built the old and new _set_direction() into a small harness with a register that ignores writes: the old code returns, the new one throws "Expected: 0, Received: 1".
  • clang-format is clean. fft_block_test and fft_block_test_v2 weren't run (no Boost here); both mocks return the poked value on peek.

Checklist

  • I have read the CONTRIBUTING document.
  • My code follows the code style of this project. See CODING.md.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes, and all previous tests pass.
  • I have checked all compat numbers if they need updating (FPGA compat,
    MPM compat, noc_shell, specific RFNoC block, ...)

_set_direction() writes REG_DIRECTION and then compares the requested
direction against get_direction(). get_direction() returns the
_direction property, which is the value the resolver just passed in,
so the "FFT Direction readback failed!" check can never trip.

Peek the register instead, the same way the length, magnitude and
scaling setters check their writes.
@github-actions

github-actions Bot commented Nov 8, 2026 •

Copy link
Copy Markdown

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

@sidcraftscode

Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA

@mbr0wn mbr0wn left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah this looks good, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants