Skip to content

Fix RTL thresholding runtime weights address space mismatch - #1685

Open
auphelia wants to merge 1 commit into
devfrom
fix/rt_writeable_thresholds
Open

Fix RTL thresholding runtime weights address space mismatch#1685
auphelia wants to merge 1 commit into
devfrom
fix/rt_writeable_thresholds

Conversation

@auphelia

@auphelia auphelia commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator

Fixes runtime writeable weights for RTL thresholding when numSteps < 2^outputBits (e.g., TFC w2a2 with 2 thresholds and INT2 output).

Problem: make_weight_file() calculated width_padded using roundup(n_steps, 2^output_bits), but RTL allocates address space using clog2(numSteps). This caused a 2x address overflow for configurations like TFC w2a2 (numSteps=2, output_bits=2), where Python generated 4 entries per channel but RTL only had space for 2.

Fix: Changed width_padded calculation to 2^clog2(numSteps) to match RTL address allocation.

Test: Added test_runtime_thresholds_tfc_like covering TFC-like configurations (ch=16/64/784, pe=4/8/49, numSteps=2/3).

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.

1 participant