fix: regenerate golden hex for dual-16pt Doppler and add real-data TBs to regression

Regenerate all real-data golden reference hex files against the current
dual 16-point FFT Doppler architecture (staggered-PRI sub-frames).
The old hex files were generated against the previous 32-point single-FFT
architecture and caused 2048/2048 mismatches in both strict real-data TBs.

Changes:
- Regenerate doppler_ref_i/q.hex, fullchain_doppler_ref_i/q.hex, and all
  downstream golden files (MTI, DC notch, CFAR) via golden_reference.py
- Add tb_doppler_realdata (exact-match, ADI CN0566 data) to regression
- Add tb_fullchain_realdata (exact-match, decim->Doppler chain) to regression
- Both TBs now pass: 2048/2048 bins exact match, MAX_ERROR=0
- Update CI comment: 23 -> 25 testbenches
- Fill in STALE_NOTICE.md with regeneration instructions

Regression: 25/25 pass, 0 fail, 0 skip. ruff check: 0 errors.
This commit is contained in:
Jason
2026-04-09 02:36:14 +03:00
parent 11aa590cf2
commit 519c95f452
32 changed files with 30884 additions and 30738 deletions
+1 -1
View File
@@ -67,7 +67,7 @@ jobs:
working-directory: 9_Firmware/9_1_Microcontroller/tests working-directory: 9_Firmware/9_1_Microcontroller/tests
# =========================================================================== # ===========================================================================
# FPGA RTL Regression (23 testbenches + lint) # FPGA RTL Regression (25 testbenches + lint)
# =========================================================================== # ===========================================================================
fpga-regression: fpga-regression:
name: FPGA Regression name: FPGA Regression
+12
View File
@@ -403,6 +403,18 @@ run_test "DDC Chain (NCO→CIC→FIR)" \
tb/tb_ddc_cosim.v ddc_400m.v nco_400m_enhanced.v \ tb/tb_ddc_cosim.v ddc_400m.v nco_400m_enhanced.v \
cic_decimator_4x_enhanced.v fir_lowpass.v cdc_modules.v cic_decimator_4x_enhanced.v fir_lowpass.v cdc_modules.v
# Real-data co-simulation: committed golden hex vs RTL (exact match required).
# These catch architecture mismatches (e.g. 32-pt → dual 16-pt Doppler FFT)
# that self-blessing golden-generate/compare tests cannot detect.
run_test "Doppler Real-Data (ADI CN0566, exact match)" \
tb/tb_doppler_realdata.vvp \
tb/tb_doppler_realdata.v doppler_processor.v xfft_16.v fft_engine.v
run_test "Full-Chain Real-Data (decim→Doppler, exact match)" \
tb/tb_fullchain_realdata.vvp \
tb/tb_fullchain_realdata.v range_bin_decimator.v \
doppler_processor.v xfft_16.v fft_engine.v
if [[ "$QUICK" -eq 0 ]]; then if [[ "$QUICK" -eq 0 ]]; then
# Golden generate # Golden generate
run_test "Receiver (golden generate)" \ run_test "Receiver (golden generate)" \
@@ -0,0 +1,42 @@
# Golden Reference Hex Files
These hex files are **committed golden references** for strict bit-exact
real-data regression tests (`tb_doppler_realdata.v`, `tb_fullchain_realdata.v`).
## When to regenerate
Regenerate whenever the Doppler processing pipeline changes:
- `doppler_processor.v` (FFT size, window, sub-frame structure)
- `xfft_16.v` / `fft_engine.v` (butterfly arithmetic, twiddle lookup)
- `range_bin_decimator.v` (decimation mode, peak detection logic)
- `fft_twiddle_16.mem` (twiddle factor ROM)
## How to regenerate
```bash
cd 9_Firmware/9_2_FPGA
python3 tb/cosim/real_data/golden_reference.py
# Then copy the Doppler-specific files:
python3 -c "
import numpy as np, os, shutil
h = 'tb/cosim/real_data/hex'
# Regenerate packed stimulus from range FFT npy
ri = np.load(f'{h}/range_fft_all_i.npy')
rq = np.load(f'{h}/range_fft_all_q.npy')
with open(f'{h}/doppler_input_realdata.hex','w') as f:
for c in range(32):
for r in range(64):
i=int(ri[c,r])&0xFFFF; q=int(rq[c,r])&0xFFFF
f.write(f'{(q<<16)|i:08X}\n')
shutil.copy2(f'{h}/doppler_map_i.hex', f'{h}/doppler_ref_i.hex')
shutil.copy2(f'{h}/doppler_map_q.hex', f'{h}/doppler_ref_q.hex')
"
```
## Architecture
Generated against the **dual 16-point FFT** Doppler architecture
(2 staggered-PRI sub-frames x 16-point Hamming-windowed FFT).
Source data: ADI CN0566 Phaser radar (10.525 GHz X-band FMCW, 4 MSPS).
@@ -1,291 +1,361 @@
# AERIS-10 Golden Reference Detections # AERIS-10 Golden Reference Detections
# Threshold: 10000 # Threshold: 10000
# Format: range_bin doppler_bin magnitude # Format: range_bin doppler_bin magnitude
0 0 44371 0 0 35364
0 1 24165 0 1 16147
0 31 17748 0 15 11821
1 0 34391 0 16 24536
1 1 17923 0 17 11208
1 31 18610 0 31 10122
2 0 28512 1 0 25697
2 1 13818 1 1 12174
2 31 15787 1 15 13421
3 0 47402 1 16 20002
3 1 25214 1 17 11568
3 31 23504 1 31 11299
4 0 51870 2 0 16788
4 1 32733 2 16 20207
4 31 31545 2 31 10711
5 0 31752 3 0 29174
5 1 13486 3 1 13965
5 31 19300 3 15 13305
6 0 63406 3 16 31517
6 1 33383 3 17 13478
6 31 36672 3 31 14101
7 0 37576 4 0 41986
7 1 21215 4 1 19241
7 31 27773 4 15 21030
8 0 14823 4 16 39714
10 0 30062 4 17 17538
10 1 13616 4 31 20394
10 31 17149 5 0 23766
5 1 11599
5 15 14843
5 16 18211
5 31 12009
6 0 42015
6 1 21423
6 15 21018
6 16 47402
6 17 22815
6 31 22736
7 0 32152
7 1 15393
7 15 14318
7 16 28911
7 17 13876
7 31 17156
8 0 11067
10 0 18848
10 15 10020
10 16 20027
10 31 10048
11 0 65534 11 0 65534
11 1 60963 11 1 37617
11 2 14848 11 2 14940
11 3 12082 11 15 43078
11 4 18060 11 16 65534
11 29 10045 11 17 39344
11 30 20661 11 31 45926
11 31 65536 12 0 58975
12 0 65536 12 1 22078
12 1 44569 12 15 34440
12 4 11189 12 16 59096
12 30 13936 12 17 22512
12 31 57036 12 31 28677
13 0 47038 13 0 38442
13 1 40212 13 1 29490
13 2 14655 13 15 37679
13 4 10242 13 16 44951
13 30 14945 13 17 27726
13 31 40237 13 31 39144
14 0 65534 14 0 52660
14 1 43568 14 1 27797
14 3 10974 14 2 13534
14 4 11491 14 15 39671
14 30 15272 14 16 57929
14 31 57983 14 17 24160
15 0 34501 14 31 31478
15 1 22496 15 0 30021
15 31 25197 15 1 12219
16 0 32784 15 15 17232
16 1 19309 15 16 29524
16 31 14005 15 17 13424
17 0 23063 15 31 17850
17 1 13730 16 0 17593
18 0 17087 16 16 24710
18 1 12092 16 31 13046
19 0 65535 17 0 17606
19 1 49084 17 1 11119
19 2 11399 17 16 13182
19 30 13119 18 16 15914
19 31 48411 19 0 55785
20 0 65509 19 1 29069
20 1 37881 19 15 29418
20 31 35014 19 16 55308
21 0 39614 19 17 27886
21 1 23389 19 31 30649
21 31 22417 20 0 49230
22 0 27174 20 1 24486
22 1 12577 20 15 21233
22 31 15278 20 16 45472
23 0 39885 20 17 21749
23 1 29247 20 31 21614
23 31 33561 21 0 26167
24 0 29644 21 1 13823
24 28 11071 21 15 10487
24 31 20937 21 16 29034
21 17 15861
21 31 10454
22 0 12791
22 16 22520
22 17 11384
22 31 11790
23 0 29337
23 1 17065
23 15 14174
23 16 39414
23 17 23310
23 31 17173
24 0 16889
24 15 15710
24 16 22395
24 31 15003
25 0 65535 25 0 65535
25 1 54580 25 1 40375
25 2 20278 25 15 54011
25 30 20041 25 16 61127
25 31 59445 25 17 38944
26 0 58162 25 31 48889
26 1 46544 26 0 46367
26 2 17230 26 1 39852
26 3 10127 26 15 29630
26 31 44711 26 16 53587
26 17 40655
26 31 34936
27 0 65535 27 0 65535
27 1 65535 27 1 65535
27 2 44599 27 15 64456
27 3 17124 27 16 65535
27 28 15139 27 17 65535
27 29 26067 27 31 58334
27 30 54631
27 31 65535
28 0 65535 28 0 65535
28 1 65535 28 1 57641
28 2 43056 28 15 65535
28 3 14647 28 16 65535
28 4 11808 28 17 54928
28 29 15256
28 30 50518
28 31 65535 28 31 65535
29 0 65535 29 0 65535
29 1 61621 29 1 44117
29 2 28859 29 2 13478
29 3 19523 29 14 11179
29 4 21765 29 15 65535
29 5 12687 29 16 65535
29 27 13175 29 17 45898
29 28 19619 29 18 10817
29 29 24365 29 31 60442
29 30 48682 30 0 44530
29 31 65535 30 1 36909
30 0 55399 30 2 14573
30 1 46683 30 15 43430
30 2 21192 30 16 51839
30 3 15905 30 17 37271
30 4 18003 30 31 47866
30 29 11105 31 0 40957
30 30 22360 31 1 52081
30 31 40830 31 2 12755
31 0 46504 31 15 42794
31 1 44346 31 16 41071
31 2 34200 31 17 50472
31 3 20677 31 18 11556
31 4 18570 31 31 43866
31 5 10430 32 0 35747
31 29 12684 32 1 19597
31 30 31778 32 15 25173
31 31 36195 32 16 39213
32 0 39540 32 17 21782
32 1 36657 32 31 29106
32 31 35394 33 0 34216
33 0 35482 33 1 41661
33 1 32886 33 15 42368
33 2 15041 33 16 38638
33 28 10103 33 17 40522
33 29 11617 33 31 45908
33 30 17465 34 0 36589
33 31 34603 34 1 17165
34 0 47950 34 15 16488
34 1 25855 34 16 26972
34 31 23198 34 17 12089
34 31 13576
35 0 65536 35 0 65536
35 1 63059 35 1 42536
35 2 24416 35 15 61612
35 30 27412 35 16 65536
35 31 65534 35 17 43084
36 0 65535 35 31 60807
36 1 41914 36 0 55831
36 2 11341 36 1 26499
36 30 11276 36 15 28393
36 31 41419 36 16 50059
38 0 63253 36 17 24420
38 1 46689 36 31 23905
38 2 13576 38 0 52721
38 30 14208 38 1 33692
38 31 49979 38 15 32463
39 0 33480 38 16 53145
39 1 25439 38 17 37178
39 31 23094 38 31 30632
40 0 52003 39 0 32288
40 1 47059 39 1 19461
40 2 13164 39 15 20183
40 31 37992 39 16 27198
39 17 16723
39 31 14041
40 0 47793
40 1 29861
40 15 23082
40 16 43109
40 17 30298
40 31 31219
41 0 65536 41 0 65536
41 1 65534 41 1 57642
41 2 25844 41 15 52984
41 3 14580 41 16 65536
41 4 12743 41 17 57420
41 30 22231 41 31 57035
41 31 65534 42 0 46393
42 0 52097 42 1 24862
42 1 45022 42 15 27123
42 2 10317 42 16 44734
42 28 11984 42 17 25836
42 29 10182 42 31 33316
42 30 13078 43 0 65535
42 31 40477 43 1 43056
43 0 61723 43 13 10481
43 1 48104 43 14 22074
43 2 17623 43 15 24792
43 3 10105 43 16 39506
43 28 28331 43 17 36481
43 29 24102 43 30 24870
43 31 45085 43 31 39062
44 0 65535 44 0 65535
44 1 65535 44 1 65535
44 2 60795 44 2 19166
44 3 25438 44 3 21321
44 27 39330 44 13 32864
44 28 60025 44 14 41461
44 29 52445 44 15 65535
44 30 35091 44 16 65535
44 17 58493
44 19 13967
44 29 29756
44 30 54069
44 31 65535 44 31 65535
45 0 65535 45 0 65535
45 1 65535 45 1 58886
45 2 27652 45 14 22013
45 3 14416 45 15 65116
45 4 10622 45 16 65535
45 27 16323 45 17 65535
45 28 40935 45 29 13068
45 29 30694 45 30 25759
45 30 29375 45 31 61393
45 31 65535 46 0 53411
46 0 65536 46 1 44267
46 1 57696 46 15 30631
46 2 14924 46 16 58196
46 30 14433 46 17 36338
46 31 45164 46 31 28840
47 0 59141 47 0 54574
47 1 44129 47 1 35574
47 2 15305 47 15 38960
47 28 13092 47 16 46623
47 30 13754 47 17 32070
47 31 47415 47 31 40091
48 0 27722 48 0 22302
48 1 13381 48 1 10865
48 31 16907 48 15 13917
49 0 51936 48 16 18042
49 1 43775 48 31 10930
49 2 13004 49 0 49013
49 31 40023 49 1 28270
50 0 45430 49 15 25242
50 1 39187 49 16 41969
50 2 15881 49 17 24924
50 30 12925 49 31 26704
50 31 38207 50 0 43858
51 0 34026 50 1 35227
51 1 33081 50 15 39737
51 31 34429 50 16 39085
52 0 34415 50 17 36353
52 1 15408 50 31 38658
52 31 19344 51 0 33868
53 0 52351 51 1 23364
53 1 42915 51 15 23348
53 2 14442 51 16 33246
53 30 13099 51 17 24398
53 31 42143 51 31 27415
54 0 62356 52 0 24500
54 1 49279 52 1 10467
54 2 15596 52 15 13661
54 30 15478 52 16 21073
54 31 46574 52 17 10681
55 0 33829 52 31 10164
55 1 15941 53 0 46806
55 31 18110 53 1 31121
56 0 65535 53 15 34423
56 1 46926 53 16 44568
56 2 11443 53 17 28497
56 28 12373 53 31 35229
56 29 12101 54 0 49713
56 30 14660 54 1 32292
56 31 53058 54 15 40878
54 16 54060
54 17 34252
54 31 43616
55 0 25597
55 1 13662
55 15 13184
55 16 20525
55 17 10363
55 31 12295
56 0 53620
56 1 23575
56 14 12578
56 15 34783
56 16 64499
56 17 32442
56 31 32139
58 0 65535 58 0 65535
58 1 56769 58 1 35008
58 2 14110 58 15 43324
58 28 12576 58 16 64959
58 29 16059 58 17 35348
58 30 18858 58 31 39154
58 31 63517 59 0 13238
59 0 30703 59 1 11374
59 1 24206 59 14 16623
59 28 17534 59 16 22346
59 29 12652 59 17 12583
60 0 35136 60 0 31259
60 1 21277 60 1 17900
60 31 25048 60 15 19638
61 0 28692 60 16 26331
61 1 11267 60 17 12543
61 28 11881 60 31 18056
61 31 17628 61 0 14596
62 0 35795 61 15 13600
62 1 18879 61 16 23597
62 31 18083 61 17 10681
63 0 65535 61 31 14915
63 1 40428 62 0 22096
63 28 11884 62 1 10515
63 29 13271 62 16 23642
63 30 14869 62 17 11146
63 31 52574 62 31 10180
63 0 58324
63 1 25269
63 15 32920
63 16 54165
63 17 27625
63 31 29816
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -76,22 +76,50 @@
0 0
0 0
0 0
0
0
0
0
0
0
0
0
0
0
0
0
0
1 1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1 1
1 1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1 1
0 0
0 0
@@ -2018,31 +2046,3 @@
0 0
0 0
0 0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
@@ -2,7 +2,7 @@
# Chain: decim -> MTI -> Doppler -> DC notch(w=2) -> CA-CFAR # Chain: decim -> MTI -> Doppler -> DC notch(w=2) -> CA-CFAR
# CFAR: guard=2, train=8, alpha=0x30, mode=CA # CFAR: guard=2, train=8, alpha=0x30, mode=CA
# Format: range_bin doppler_bin magnitude threshold # Format: range_bin doppler_bin magnitude threshold
2 27 40172 38280 2 14 57128 48153
2 28 65534 40749 2 29 20281 15318
2 29 58080 31302 2 30 44783 22389
2 30 16565 13386 3 26 19423 19422
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -2,188 +2,210 @@
# Threshold: 10000 # Threshold: 10000
# Format: range_bin doppler_bin magnitude # Format: range_bin doppler_bin magnitude
0 0 65534 0 0 65534
0 1 59350 0 1 28729
0 2 16748 0 2 18427
0 4 18802 0 3 14971
0 29 10539 0 14 11972
0 30 18526 0 15 53110
0 31 65536 0 16 65534
0 17 39344
0 31 45926
1 0 65535 1 0 65535
1 1 65535 1 1 65535
1 2 37002 1 2 16977
1 4 12412 1 4 13219
1 5 14956 1 10 10505
1 6 12586 1 12 12931
1 7 11607 1 14 23806
1 8 11379 1 15 65535
1 24 11725 1 16 65535
1 28 17218 1 17 65535
1 29 32939 1 31 55887
1 30 58888
1 31 65535
2 0 65535 2 0 65535
2 1 65535 2 1 65535
2 2 60795 2 2 19166
2 3 25438 2 3 21321
2 27 39330 2 13 32864
2 28 60025 2 14 41461
2 29 52445 2 15 65535
2 30 35091 2 16 65535
2 17 58493
2 19 13967
2 29 29756
2 30 54069
2 31 65535 2 31 65535
3 0 65535 3 0 53605
3 1 63297 3 1 48935
3 2 32758 3 2 24589
3 3 42197 3 4 12240
3 4 35819 3 5 14117
3 5 12663 3 8 12950
3 7 19561 3 11 13274
3 8 12012 3 12 12930
3 12 13537 3 14 23437
3 13 12879 3 15 29552
3 19 10255 3 16 65433
3 20 10129 3 17 52933
3 24 17256 3 18 24719
3 25 22733 3 19 17650
3 26 10202 3 20 15096
3 28 24061 3 21 13518
3 29 19639 3 27 13184
3 31 37328 3 28 15554
4 0 46755 3 29 23742
4 1 39569 3 30 17775
4 2 12396 3 31 19771
4 28 12471 4 0 46125
4 29 12156 4 1 38769
4 30 16659 4 14 10924
4 31 40340 4 15 33844
5 0 44089 4 16 38130
5 1 23634 4 17 36763
5 31 21331 4 31 34850
6 0 48634 5 0 29649
6 1 24635 5 1 15983
6 31 25423 5 16 27615
7 0 24477 5 17 13683
7 1 14206 5 31 11456
7 31 10955 6 0 29881
8 0 41014 6 1 14520
8 1 19527 6 15 14126
8 31 21133 6 16 33068
9 0 47277 6 17 14679
9 1 28366 6 31 16608
9 31 29936 7 0 15305
10 0 47095 7 16 16195
10 1 26150 8 0 22601
10 31 24009 8 16 32614
11 0 47384 8 17 16367
11 1 25409 8 31 16217
11 31 24250 9 0 33316
12 0 24648 9 1 14993
12 1 14298 9 15 19928
12 31 13970 9 16 38915
13 0 13062 9 17 20159
15 0 10284 9 31 17219
16 0 14267 10 0 31772
17 0 16165 10 1 16438
18 0 14235 10 15 13737
18 31 12120 10 16 29059
19 0 18006 10 17 15821
19 1 14936 10 31 13104
20 0 47569 11 0 30448
20 1 33826 11 1 15802
20 31 35752 11 15 12669
21 0 47804 11 16 30129
21 1 21420 11 17 14340
21 31 30292 11 31 12767
22 0 14968 12 0 12892
26 0 16086 12 16 15956
26 31 10462 13 16 10903
30 0 16628 17 0 11395
30 1 10044 17 16 10440
38 0 23453 19 0 11910
38 1 13989 19 16 12017
38 31 10672 20 0 42212
39 0 31656 20 1 17994
39 1 17367 20 15 23540
39 31 17314 20 16 42519
40 0 19156 20 17 15949
40 1 10817 20 31 23792
40 31 10083 21 0 19822
45 0 25385 21 2 13933
45 1 11685 21 3 12130
45 31 14673 21 13 11590
46 0 12576 21 14 14794
46 4 10141 21 15 14160
46 28 12358 21 16 36543
47 0 19657 21 17 19530
47 31 15741 21 31 13754
48 0 13189 22 0 12654
48 1 10038 26 16 10634
49 0 33747 30 0 11396
49 1 16561 38 0 12032
49 31 18910 38 1 11693
50 0 20552 38 16 18530
50 31 10843 39 0 13327
51 0 20068 39 1 12416
51 1 13887 39 2 10940
51 4 10305 39 15 10351
51 28 11339 39 16 25217
53 28 10166 39 17 11785
55 0 39891 39 31 12383
55 1 17615 40 16 14316
55 31 24898 45 0 16350
56 0 62796 45 16 16146
56 1 29788 46 0 11710
56 31 38261 46 16 12568
57 0 63585 46 31 12206
57 1 59760 47 15 12053
57 2 13027 47 16 17267
57 3 43395 49 0 22212
57 4 59148 49 15 11409
57 5 31472 49 16 20817
57 6 11913 50 0 14287
57 7 13807 50 16 13382
57 8 12132 51 0 15578
57 16 14068 51 1 11129
57 17 10379 51 16 12819
57 24 15712 53 16 10532
57 25 11076 55 0 24789
57 26 14856 55 15 10455
57 27 23468 55 16 25212
57 28 38479 55 17 10510
57 29 23078 55 31 12207
57 30 17921 56 0 45192
57 31 46558 56 1 16083
58 0 54425 56 15 22284
58 1 45222 56 16 40302
58 2 11380 56 17 17318
58 4 11700 56 31 19185
58 29 12022 57 0 41535
58 30 13911 57 1 27102
58 31 45374 57 2 50048
59 0 45581 57 3 30784
59 1 31538 57 6 10595
59 2 10481 57 8 12880
59 31 34132 57 12 16303
60 0 28622 57 13 21792
60 1 12594 57 14 36737
60 3 11799 57 15 51757
60 4 13327 57 16 53641
60 28 11737 57 17 33656
60 29 11439 57 18 11096
60 31 16902 57 31 50828
61 0 28716 58 0 49157
61 1 16605 58 1 40063
61 31 15745 58 15 33919
62 0 14151 58 16 44578
62 1 15747 58 17 46214
62 4 11738 58 31 35365
62 5 12479 59 0 40306
62 26 10789 59 1 20804
62 27 16875 59 15 16849
62 28 19372 59 16 25943
62 29 16120 59 18 11684
62 30 18215 59 30 15453
62 31 10810 59 31 26587
63 0 63651 60 0 19637
63 1 35648 60 15 12275
63 30 10692 60 16 18527
63 31 38169 60 30 10157
60 31 17278
61 0 15147
61 14 10732
61 15 12364
61 16 25489
61 17 13371
61 31 14278
62 1 14922
62 2 13924
62 16 29381
62 17 20524
62 31 12898
63 0 48946
63 1 23135
63 15 21609
63 16 44144
63 17 21410
63 31 19856
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff