test: add vector-driven Verilator testbench with Python model cross-check
Add gen_verilator_vectors.py to convert test_vectors.json into hex files for $readmemh, and tb_ldpc_vectors.sv to drive 20 test vectors through the RTL decoder and verify bit-exact matching against the Python model. All 11 converged vectors pass with exact decoded word, convergence flag, and zero syndrome weight. All 9 non-converged vectors match the Python model's decoded word, iteration count, and syndrome weight exactly. Three RTL bugs fixed in ldpc_decoder_core.sv during testing: - Magnitude overflow: -32 (6'b100000) negation overflowed 5-bit field to 0; now clamped to max magnitude 31 - Converged flag persistence: moved clearing from IDLE to INIT so host can read results after decode completes - msg_cn2vn zeroing: bypass stale array reads on first iteration (iter_cnt==0) to avoid Verilator scheduling issues with large 3D array initialization Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
80
tb/vectors/expected.hex
Normal file
80
tb/vectors/expected.hex
Normal file
@@ -0,0 +1,80 @@
|
||||
3FD74222
|
||||
00000001
|
||||
00000001
|
||||
00000000
|
||||
09A5626C
|
||||
00000001
|
||||
00000001
|
||||
00000000
|
||||
2FFC25FC
|
||||
00000001
|
||||
00000001
|
||||
00000000
|
||||
5DABF50B
|
||||
00000001
|
||||
00000001
|
||||
00000000
|
||||
05D8EA33
|
||||
00000001
|
||||
00000001
|
||||
00000000
|
||||
19AF1473
|
||||
00000001
|
||||
00000001
|
||||
00000000
|
||||
34D925D3
|
||||
00000001
|
||||
00000001
|
||||
00000000
|
||||
45C1E650
|
||||
00000001
|
||||
00000001
|
||||
00000000
|
||||
A4CA7D49
|
||||
00000001
|
||||
00000001
|
||||
00000000
|
||||
D849EB80
|
||||
00000001
|
||||
00000001
|
||||
00000000
|
||||
9BCA9A40
|
||||
00000001
|
||||
00000001
|
||||
00000000
|
||||
79FFC352
|
||||
00000000
|
||||
0000001E
|
||||
00000043
|
||||
5D2534DC
|
||||
00000000
|
||||
0000001E
|
||||
0000003B
|
||||
F21718ED
|
||||
00000000
|
||||
0000001E
|
||||
0000003D
|
||||
7FE0197C
|
||||
00000000
|
||||
0000001E
|
||||
00000041
|
||||
9E869CC2
|
||||
00000000
|
||||
0000001E
|
||||
0000004B
|
||||
4E7507D9
|
||||
00000000
|
||||
0000001E
|
||||
00000038
|
||||
BB5F2BF1
|
||||
00000000
|
||||
0000001E
|
||||
00000033
|
||||
AA500741
|
||||
00000000
|
||||
0000001E
|
||||
0000004C
|
||||
F98E6EFE
|
||||
00000000
|
||||
0000001E
|
||||
0000002A
|
||||
1040
tb/vectors/llr_words.hex
Normal file
1040
tb/vectors/llr_words.hex
Normal file
File diff suppressed because it is too large
Load Diff
1
tb/vectors/num_vectors.txt
Normal file
1
tb/vectors/num_vectors.txt
Normal file
@@ -0,0 +1 @@
|
||||
20
|
||||
Reference in New Issue
Block a user