Files
PLFM_RADAR/9_Firmware
Jason ddcc03d89c chirp-v2 PR-F follow-up 2: TB widenings + 50T include + comment
Closes the four deferred items from project_chirp_v2_pr_f_review_followups
that were carved out of 51a94f0 to keep that diff narrow.

A. TB doppler_bin / dbg_doppler_bin / dbg_range_bin still 5 / 6 bits,
   ports widened to 6 / 9 in PR-F:
     - tb/tb_doppler_cosim.v
     - tb/tb_doppler_frame_start_gate.v
     - tb/tb_system_e2e.v
     - tb/radar_system_tb.v
     - tb/tb_radar_receiver_final.v
   All five files now include radar_params.vh and use
   `RP_DOPPLER_BIN_WIDTH / `RP_RANGE_BIN_WIDTH_MAX. tb_doppler_cosim.v
   was already structured around CHIRPS=32 and would have stalled
   forever against the new 48-chirp default — added explicit parameter
   overrides (CHIRPS_PER_FRAME=32, CHIRPS_PER_SUBFRAME=16, RANGE_BINS=512)
   to keep its legacy 2-subframe golden vectors valid, mirroring the
   pattern already used by tb_doppler_realdata / tb_fullchain_realdata.

B. tb_radar_receiver_final hardcoded NUM_DOPPLER_BINS=32 across the
   golden buffer, the per-range bitmap, the duplicate-detect mask, the
   gidx multiplier, and the S5/S6/S7/B3/B4 expected counts. All bumped
   to `RP_NUM_DOPPLER_BINS (=48) via NUM_DBINS / NUM_RBINS / GOLDEN_ENTRIES
   localparams; per-range index_seen widened to 64-bit so
   `(64'd1 << doppler_bin)` covers bins 32..47. Note: under iverilog the
   doppler-frame checks (S4-S9, B2a, B3, B4, G1) remain gated on
   FFT_USE_XILINX_IP — the in-house fft_engine is too slow to land a
   48-chirp Doppler frame in 20 ms sim; under XSim with the IP the
   widened logic now exercises the full 24576-cell output (was 16384).
   The 8-test active subset under iverilog is unchanged.

C. radar_system_top_50t.v adds `\`include "radar_params.vh"`, which is
   needed for the `\`RP_DOPPLER_BIN_WIDTH-1:0]` reference added in PR-F.
   Previously worked only because alphabetical Vivado file ordering
   processes radar_system_top.v (which does include) first and the
   macros leak across the same compilation unit. While here, also bumps
   the dbg_range_bin_nc tie-off wire from a literal [5:0] to
   `RP_RANGE_BIN_WIDTH_MAX-1:0] so the wrapper width matches the port.

D. usb_data_interface_ft2232h.v:392 stale comment ("FRAME_CELLS = 24576
   < 32768") rewritten to reflect that PR-F's pad-to-power-of-2 makes
   FRAME_CELLS = NUM_RANGE_BINS * (1<<DOPPLER_BIN_BITS) = 32768 (the
   full 15-bit address space).

Tests (parity with PR-F baseline numbers in 7862f4d / 51a94f0):
  - tb_doppler_cosim (3 scenarios): 14/14 each + Python golden compare PASS
  - tb_doppler_frame_start_gate:    21/21 PASS
  - tb_doppler_realdata:            2056/2056 PASS
  - tb_cfar_ca:                     24/0  PASS
  - tb_chirp_controller:            43/43 PASS
  - tb_chirp_contract:              10/10 PASS
  - tb_mti_canceller:               43/43 PASS
  - tb_radar_receiver_final:        8/8   PASS
  - tb_system_e2e:                  33/49 PASS
  - radar_system_tb (USB_MODE=1):   smoke (no PASS/FAIL markers; runs to $finish)
  Lint (iverilog -Wall on full PROD_RTL + 50t wrapper): no new
  width / Padding / Truncating warnings introduced.
2026-05-01 04:35:08 +05:45
..