test(fpga): PR-AD AD.3 — FT601 system-opcode TB + SUPPORT_LONG_RANGE compile guard

Guards against future drift between the two USB driver command paths
(USB_MODE=0 vs USB_MODE=1) and against 200T+long-range build breakage
in usb_data_interface.v.

tb/tb_system_opcodes_ft601.v — new (~397 LOC):
  - Sibling of tb_system_opcodes.v with radar_system_top
    #(.USB_MODE(0))
  - FT601 RX BFM: 32-bit single-word read with 5-cycle word holds
    (IDLE -> OE_ASSERT -> READING -> DEASSERT -> PROCESS)
  - 28/0 PASS, same opcode coverage as the FT2232H sibling

run_regression.sh — adds 2 entries:
  - "FT601 Driver Long-Range Compile (PR-AD AD.3)" in Phase 1:
    inline iverilog -DSUPPORT_LONG_RANGE on usb_data_interface.v;
    suppresses informational warnings (timescale / dangling / @*
    sensitive) and fails on real warnings. Catches macro creep
    that would break the 200T 20-km build before Vivado synthesis.
  - "System Opcodes FT601 (tb_system_opcodes_ft601)" in Phase 2
    (non-quick block).

radar_system_top.v — header doc block documenting the
USB_MODE x SUPPORT_LONG_RANGE 4-cell build matrix and clarifying
that the flags are orthogonal (200T+FT601 with 3-km-only DSP is a
valid bring-up baseline; 50T+FT2232H+LR is rare but must still
compile). Notes that both drivers emit the identical v2 bulk frame
and that byte-equality is enforced by tb_usb_drivers_parity.v.

Regression: 46/0/0 (44 + 1 system TB + 1 LR compile guard).
Lint: 0 errors, 2 advisory (pre-existing, unrelated).
This commit is contained in:
Jason
2026-05-18 13:29:11 +05:45
parent e1abeecaa9
commit 4c9032187a
3 changed files with 454 additions and 2 deletions
+33
View File
@@ -562,6 +562,33 @@ run_test "USB Drivers Parity (PR-AD AD.2 cross-comparison)" \
tb/tb_usb_drivers_parity.vvp \
tb/tb_usb_drivers_parity.v usb_data_interface.v usb_data_interface_ft2232h.v
# PR-AD AD.3 compile-only: prove FT601 driver builds clean under the 200T
# long-range define. Driver wire protocol (NUM_RANGE_BINS=512) is unaffected
# by SUPPORT_LONG_RANGE, but RP_RANGE_BIN_WIDTH_MAX widens 9→12; this guards
# any future macro creep from breaking the long-range build path.
printf " %-45s " "FT601 Driver Long-Range Compile (PR-AD AD.3)"
lr_log=/tmp/ft601_lr_compile_$$.log
if iverilog -g2001 -DSIMULATION -DSUPPORT_LONG_RANGE -Wall \
-o /tmp/ft601_lr_compile_$$.vvp usb_data_interface.v 2>"$lr_log"; then
# Suppress informational warnings (timescale / dangling / array @* sensitivity)
lr_err=$(grep -vE 'sensitive to all|timescale|dangling' "$lr_log" | grep -c . || true)
if [[ "$lr_err" -eq 0 ]]; then
echo -e "${GREEN}PASS${NC} (compile clean, SUPPORT_LONG_RANGE)"
PASS=$((PASS + 1))
else
echo -e "${RED}FAIL${NC} ($lr_err warning(s))"
grep -vE 'sensitive to all|timescale|dangling' "$lr_log" | sed 's/^/ /'
ERRORS="$ERRORS\n FT601 Long-Range Compile: $lr_err warning(s)"
FAIL=$((FAIL + 1))
fi
else
echo -e "${RED}COMPILE FAIL${NC}"
sed 's/^/ /' "$lr_log"
ERRORS="$ERRORS\n FT601 Long-Range Compile: iverilog compile error"
FAIL=$((FAIL + 1))
fi
rm -f /tmp/ft601_lr_compile_$$.vvp "$lr_log"
run_test "Doppler Frame-Start Gate (AUDIT-S3)" \
tb/tb_doppler_frame_start_gate.vvp \
tb/tb_doppler_frame_start_gate.v doppler_processor.v xfft_16.v fft_engine.v
@@ -682,6 +709,12 @@ if [[ "$QUICK" -eq 0 ]]; then
tb/tb_system_opcodes_reg.vvp \
tb/tb_system_opcodes.v "${SYSTEM_RTL[@]}"
# PR-AD AD.3: FT601 path opcode dispatch — guards against future drift
# between the two USB driver command paths (USB_MODE=0 vs USB_MODE=1).
run_test "System Opcodes FT601 (tb_system_opcodes_ft601)" \
tb/tb_system_opcodes_ft601_reg.vvp \
tb/tb_system_opcodes_ft601.v "${SYSTEM_RTL[@]}"
run_test "System Mechanics (tb_system_mechanics)" \
tb/tb_system_mechanics_reg.vvp \
tb/tb_system_mechanics.v "${SYSTEM_RTL[@]}"