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
+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 \
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
# 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
# Threshold: 10000
# Format: range_bin doppler_bin magnitude
0 0 44371
0 1 24165
0 31 17748
1 0 34391
1 1 17923
1 31 18610
2 0 28512
2 1 13818
2 31 15787
3 0 47402
3 1 25214
3 31 23504
4 0 51870
4 1 32733
4 31 31545
5 0 31752
5 1 13486
5 31 19300
6 0 63406
6 1 33383
6 31 36672
7 0 37576
7 1 21215
7 31 27773
8 0 14823
10 0 30062
10 1 13616
10 31 17149
0 0 35364
0 1 16147
0 15 11821
0 16 24536
0 17 11208
0 31 10122
1 0 25697
1 1 12174
1 15 13421
1 16 20002
1 17 11568
1 31 11299
2 0 16788
2 16 20207
2 31 10711
3 0 29174
3 1 13965
3 15 13305
3 16 31517
3 17 13478
3 31 14101
4 0 41986
4 1 19241
4 15 21030
4 16 39714
4 17 17538
4 31 20394
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 1 60963
11 2 14848
11 3 12082
11 4 18060
11 29 10045
11 30 20661
11 31 65536
12 0 65536
12 1 44569
12 4 11189
12 30 13936
12 31 57036
13 0 47038
13 1 40212
13 2 14655
13 4 10242
13 30 14945
13 31 40237
14 0 65534
14 1 43568
14 3 10974
14 4 11491
14 30 15272
14 31 57983
15 0 34501
15 1 22496
15 31 25197
16 0 32784
16 1 19309
16 31 14005
17 0 23063
17 1 13730
18 0 17087
18 1 12092
19 0 65535
19 1 49084
19 2 11399
19 30 13119
19 31 48411
20 0 65509
20 1 37881
20 31 35014
21 0 39614
21 1 23389
21 31 22417
22 0 27174
22 1 12577
22 31 15278
23 0 39885
23 1 29247
23 31 33561
24 0 29644
24 28 11071
24 31 20937
11 1 37617
11 2 14940
11 15 43078
11 16 65534
11 17 39344
11 31 45926
12 0 58975
12 1 22078
12 15 34440
12 16 59096
12 17 22512
12 31 28677
13 0 38442
13 1 29490
13 15 37679
13 16 44951
13 17 27726
13 31 39144
14 0 52660
14 1 27797
14 2 13534
14 15 39671
14 16 57929
14 17 24160
14 31 31478
15 0 30021
15 1 12219
15 15 17232
15 16 29524
15 17 13424
15 31 17850
16 0 17593
16 16 24710
16 31 13046
17 0 17606
17 1 11119
17 16 13182
18 16 15914
19 0 55785
19 1 29069
19 15 29418
19 16 55308
19 17 27886
19 31 30649
20 0 49230
20 1 24486
20 15 21233
20 16 45472
20 17 21749
20 31 21614
21 0 26167
21 1 13823
21 15 10487
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 1 54580
25 2 20278
25 30 20041
25 31 59445
26 0 58162
26 1 46544
26 2 17230
26 3 10127
26 31 44711
25 1 40375
25 15 54011
25 16 61127
25 17 38944
25 31 48889
26 0 46367
26 1 39852
26 15 29630
26 16 53587
26 17 40655
26 31 34936
27 0 65535
27 1 65535
27 2 44599
27 3 17124
27 28 15139
27 29 26067
27 30 54631
27 31 65535
27 15 64456
27 16 65535
27 17 65535
27 31 58334
28 0 65535
28 1 65535
28 2 43056
28 3 14647
28 4 11808
28 29 15256
28 30 50518
28 1 57641
28 15 65535
28 16 65535
28 17 54928
28 31 65535
29 0 65535
29 1 61621
29 2 28859
29 3 19523
29 4 21765
29 5 12687
29 27 13175
29 28 19619
29 29 24365
29 30 48682
29 31 65535
30 0 55399
30 1 46683
30 2 21192
30 3 15905
30 4 18003
30 29 11105
30 30 22360
30 31 40830
31 0 46504
31 1 44346
31 2 34200
31 3 20677
31 4 18570
31 5 10430
31 29 12684
31 30 31778
31 31 36195
32 0 39540
32 1 36657
32 31 35394
33 0 35482
33 1 32886
33 2 15041
33 28 10103
33 29 11617
33 30 17465
33 31 34603
34 0 47950
34 1 25855
34 31 23198
29 1 44117
29 2 13478
29 14 11179
29 15 65535
29 16 65535
29 17 45898
29 18 10817
29 31 60442
30 0 44530
30 1 36909
30 2 14573
30 15 43430
30 16 51839
30 17 37271
30 31 47866
31 0 40957
31 1 52081
31 2 12755
31 15 42794
31 16 41071
31 17 50472
31 18 11556
31 31 43866
32 0 35747
32 1 19597
32 15 25173
32 16 39213
32 17 21782
32 31 29106
33 0 34216
33 1 41661
33 15 42368
33 16 38638
33 17 40522
33 31 45908
34 0 36589
34 1 17165
34 15 16488
34 16 26972
34 17 12089
34 31 13576
35 0 65536
35 1 63059
35 2 24416
35 30 27412
35 31 65534
36 0 65535
36 1 41914
36 2 11341
36 30 11276
36 31 41419
38 0 63253
38 1 46689
38 2 13576
38 30 14208
38 31 49979
39 0 33480
39 1 25439
39 31 23094
40 0 52003
40 1 47059
40 2 13164
40 31 37992
35 1 42536
35 15 61612
35 16 65536
35 17 43084
35 31 60807
36 0 55831
36 1 26499
36 15 28393
36 16 50059
36 17 24420
36 31 23905
38 0 52721
38 1 33692
38 15 32463
38 16 53145
38 17 37178
38 31 30632
39 0 32288
39 1 19461
39 15 20183
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 1 65534
41 2 25844
41 3 14580
41 4 12743
41 30 22231
41 31 65534
42 0 52097
42 1 45022
42 2 10317
42 28 11984
42 29 10182
42 30 13078
42 31 40477
43 0 61723
43 1 48104
43 2 17623
43 3 10105
43 28 28331
43 29 24102
43 31 45085
41 1 57642
41 15 52984
41 16 65536
41 17 57420
41 31 57035
42 0 46393
42 1 24862
42 15 27123
42 16 44734
42 17 25836
42 31 33316
43 0 65535
43 1 43056
43 13 10481
43 14 22074
43 15 24792
43 16 39506
43 17 36481
43 30 24870
43 31 39062
44 0 65535
44 1 65535
44 2 60795
44 3 25438
44 27 39330
44 28 60025
44 29 52445
44 30 35091
44 2 19166
44 3 21321
44 13 32864
44 14 41461
44 15 65535
44 16 65535
44 17 58493
44 19 13967
44 29 29756
44 30 54069
44 31 65535
45 0 65535
45 1 65535
45 2 27652
45 3 14416
45 4 10622
45 27 16323
45 28 40935
45 29 30694
45 30 29375
45 31 65535
46 0 65536
46 1 57696
46 2 14924
46 30 14433
46 31 45164
47 0 59141
47 1 44129
47 2 15305
47 28 13092
47 30 13754
47 31 47415
48 0 27722
48 1 13381
48 31 16907
49 0 51936
49 1 43775
49 2 13004
49 31 40023
50 0 45430
50 1 39187
50 2 15881
50 30 12925
50 31 38207
51 0 34026
51 1 33081
51 31 34429
52 0 34415
52 1 15408
52 31 19344
53 0 52351
53 1 42915
53 2 14442
53 30 13099
53 31 42143
54 0 62356
54 1 49279
54 2 15596
54 30 15478
54 31 46574
55 0 33829
55 1 15941
55 31 18110
56 0 65535
56 1 46926
56 2 11443
56 28 12373
56 29 12101
56 30 14660
56 31 53058
45 1 58886
45 14 22013
45 15 65116
45 16 65535
45 17 65535
45 29 13068
45 30 25759
45 31 61393
46 0 53411
46 1 44267
46 15 30631
46 16 58196
46 17 36338
46 31 28840
47 0 54574
47 1 35574
47 15 38960
47 16 46623
47 17 32070
47 31 40091
48 0 22302
48 1 10865
48 15 13917
48 16 18042
48 31 10930
49 0 49013
49 1 28270
49 15 25242
49 16 41969
49 17 24924
49 31 26704
50 0 43858
50 1 35227
50 15 39737
50 16 39085
50 17 36353
50 31 38658
51 0 33868
51 1 23364
51 15 23348
51 16 33246
51 17 24398
51 31 27415
52 0 24500
52 1 10467
52 15 13661
52 16 21073
52 17 10681
52 31 10164
53 0 46806
53 1 31121
53 15 34423
53 16 44568
53 17 28497
53 31 35229
54 0 49713
54 1 32292
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 1 56769
58 2 14110
58 28 12576
58 29 16059
58 30 18858
58 31 63517
59 0 30703
59 1 24206
59 28 17534
59 29 12652
60 0 35136
60 1 21277
60 31 25048
61 0 28692
61 1 11267
61 28 11881
61 31 17628
62 0 35795
62 1 18879
62 31 18083
63 0 65535
63 1 40428
63 28 11884
63 29 13271
63 30 14869
63 31 52574
58 1 35008
58 15 43324
58 16 64959
58 17 35348
58 31 39154
59 0 13238
59 1 11374
59 14 16623
59 16 22346
59 17 12583
60 0 31259
60 1 17900
60 15 19638
60 16 26331
60 17 12543
60 31 18056
61 0 14596
61 15 13600
61 16 23597
61 17 10681
61 31 14915
62 0 22096
62 1 10515
62 16 23642
62 17 11146
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
1
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
0
0
0
0
0
0
0
0
0
0
0
0
0
1
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
@@ -2,7 +2,7 @@
# Chain: decim -> MTI -> Doppler -> DC notch(w=2) -> CA-CFAR
# CFAR: guard=2, train=8, alpha=0x30, mode=CA
# Format: range_bin doppler_bin magnitude threshold
2 27 40172 38280
2 28 65534 40749
2 29 58080 31302
2 30 16565 13386
2 14 57128 48153
2 29 20281 15318
2 30 44783 22389
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
# Format: range_bin doppler_bin magnitude
0 0 65534
0 1 59350
0 2 16748
0 4 18802
0 29 10539
0 30 18526
0 31 65536
0 1 28729
0 2 18427
0 3 14971
0 14 11972
0 15 53110
0 16 65534
0 17 39344
0 31 45926
1 0 65535
1 1 65535
1 2 37002
1 4 12412
1 5 14956
1 6 12586
1 7 11607
1 8 11379
1 24 11725
1 28 17218
1 29 32939
1 30 58888
1 31 65535
1 2 16977
1 4 13219
1 10 10505
1 12 12931
1 14 23806
1 15 65535
1 16 65535
1 17 65535
1 31 55887
2 0 65535
2 1 65535
2 2 60795
2 3 25438
2 27 39330
2 28 60025
2 29 52445
2 30 35091
2 2 19166
2 3 21321
2 13 32864
2 14 41461
2 15 65535
2 16 65535
2 17 58493
2 19 13967
2 29 29756
2 30 54069
2 31 65535
3 0 65535
3 1 63297
3 2 32758
3 3 42197
3 4 35819
3 5 12663
3 7 19561
3 8 12012
3 12 13537
3 13 12879
3 19 10255
3 20 10129
3 24 17256
3 25 22733
3 26 10202
3 28 24061
3 29 19639
3 31 37328
4 0 46755
4 1 39569
4 2 12396
4 28 12471
4 29 12156
4 30 16659
4 31 40340
5 0 44089
5 1 23634
5 31 21331
6 0 48634
6 1 24635
6 31 25423
7 0 24477
7 1 14206
7 31 10955
8 0 41014
8 1 19527
8 31 21133
9 0 47277
9 1 28366
9 31 29936
10 0 47095
10 1 26150
10 31 24009
11 0 47384
11 1 25409
11 31 24250
12 0 24648
12 1 14298
12 31 13970
13 0 13062
15 0 10284
16 0 14267
17 0 16165
18 0 14235
18 31 12120
19 0 18006
19 1 14936
20 0 47569
20 1 33826
20 31 35752
21 0 47804
21 1 21420
21 31 30292
22 0 14968
26 0 16086
26 31 10462
30 0 16628
30 1 10044
38 0 23453
38 1 13989
38 31 10672
39 0 31656
39 1 17367
39 31 17314
40 0 19156
40 1 10817
40 31 10083
45 0 25385
45 1 11685
45 31 14673
46 0 12576
46 4 10141
46 28 12358
47 0 19657
47 31 15741
48 0 13189
48 1 10038
49 0 33747
49 1 16561
49 31 18910
50 0 20552
50 31 10843
51 0 20068
51 1 13887
51 4 10305
51 28 11339
53 28 10166
55 0 39891
55 1 17615
55 31 24898
56 0 62796
56 1 29788
56 31 38261
57 0 63585
57 1 59760
57 2 13027
57 3 43395
57 4 59148
57 5 31472
57 6 11913
57 7 13807
57 8 12132
57 16 14068
57 17 10379
57 24 15712
57 25 11076
57 26 14856
57 27 23468
57 28 38479
57 29 23078
57 30 17921
57 31 46558
58 0 54425
58 1 45222
58 2 11380
58 4 11700
58 29 12022
58 30 13911
58 31 45374
59 0 45581
59 1 31538
59 2 10481
59 31 34132
60 0 28622
60 1 12594
60 3 11799
60 4 13327
60 28 11737
60 29 11439
60 31 16902
61 0 28716
61 1 16605
61 31 15745
62 0 14151
62 1 15747
62 4 11738
62 5 12479
62 26 10789
62 27 16875
62 28 19372
62 29 16120
62 30 18215
62 31 10810
63 0 63651
63 1 35648
63 30 10692
63 31 38169
3 0 53605
3 1 48935
3 2 24589
3 4 12240
3 5 14117
3 8 12950
3 11 13274
3 12 12930
3 14 23437
3 15 29552
3 16 65433
3 17 52933
3 18 24719
3 19 17650
3 20 15096
3 21 13518
3 27 13184
3 28 15554
3 29 23742
3 30 17775
3 31 19771
4 0 46125
4 1 38769
4 14 10924
4 15 33844
4 16 38130
4 17 36763
4 31 34850
5 0 29649
5 1 15983
5 16 27615
5 17 13683
5 31 11456
6 0 29881
6 1 14520
6 15 14126
6 16 33068
6 17 14679
6 31 16608
7 0 15305
7 16 16195
8 0 22601
8 16 32614
8 17 16367
8 31 16217
9 0 33316
9 1 14993
9 15 19928
9 16 38915
9 17 20159
9 31 17219
10 0 31772
10 1 16438
10 15 13737
10 16 29059
10 17 15821
10 31 13104
11 0 30448
11 1 15802
11 15 12669
11 16 30129
11 17 14340
11 31 12767
12 0 12892
12 16 15956
13 16 10903
17 0 11395
17 16 10440
19 0 11910
19 16 12017
20 0 42212
20 1 17994
20 15 23540
20 16 42519
20 17 15949
20 31 23792
21 0 19822
21 2 13933
21 3 12130
21 13 11590
21 14 14794
21 15 14160
21 16 36543
21 17 19530
21 31 13754
22 0 12654
26 16 10634
30 0 11396
38 0 12032
38 1 11693
38 16 18530
39 0 13327
39 1 12416
39 2 10940
39 15 10351
39 16 25217
39 17 11785
39 31 12383
40 16 14316
45 0 16350
45 16 16146
46 0 11710
46 16 12568
46 31 12206
47 15 12053
47 16 17267
49 0 22212
49 15 11409
49 16 20817
50 0 14287
50 16 13382
51 0 15578
51 1 11129
51 16 12819
53 16 10532
55 0 24789
55 15 10455
55 16 25212
55 17 10510
55 31 12207
56 0 45192
56 1 16083
56 15 22284
56 16 40302
56 17 17318
56 31 19185
57 0 41535
57 1 27102
57 2 50048
57 3 30784
57 6 10595
57 8 12880
57 12 16303
57 13 21792
57 14 36737
57 15 51757
57 16 53641
57 17 33656
57 18 11096
57 31 50828
58 0 49157
58 1 40063
58 15 33919
58 16 44578
58 17 46214
58 31 35365
59 0 40306
59 1 20804
59 15 16849
59 16 25943
59 18 11684
59 30 15453
59 31 26587
60 0 19637
60 15 12275
60 16 18527
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