Gap 2 GUI Settings: runtime chirp timing, stream control gating, status readback (18/18 FPGA, 20/20 MCU)

Register map: 0x10-0x15 chirp timing overrides, 0xFF status readback,
0x03 CFAR threshold now wired to actual compare, 0x04 stream control
gates USB write FSM. Status readback sends 7-word packet (0xBB header,
5 status words, 0x55 footer) via toggle CDC.

radar_mode_controller: 6 cfg_* input ports replace hardcoded parameters.
usb_data_interface: stream_control CDC, status_request toggle CDC,
  SEND_STATUS state (3'd7), stream gating in IDLE/HEADER/RANGE/DOPPLER.
radar_system_top: 6 host registers + command decode for 0x10-0x15/0xFF.
radar_receiver_final: 6 host_* timing passthrough ports.

Testbench coverage: RMC 81 checks (+TG16 runtime reconfig), USB 77
checks (+TG15 stream gating, TG16 status readback, TG17 chirp opcodes).
Fixed iverilog 13.0 forward-ref for status_req_toggle_100m.
This commit is contained in:
Jason
2026-03-19 23:54:48 +02:00
parent d2f20f5c15
commit 7cdfa486e5
8 changed files with 604 additions and 26 deletions
+17 -2
View File
@@ -24,10 +24,18 @@ module radar_receiver_final (
output wire signed [15:0] range_profile_q_out,
output wire range_profile_valid_out,
// Host command inputs (Gap 4: USB Read Path)
// Host command inputs (Gap 4: USB Read Path, CDC-synchronized)
// CDC-synchronized in radar_system_top.v before reaching here
input wire [1:0] host_mode, // Radar mode: 00=STM32, 01=auto-scan, 10=single-chirp
input wire host_trigger // Single-chirp trigger pulse (1 clk cycle)
input wire host_trigger, // Single-chirp trigger pulse (1 clk cycle)
// Gap 2: Host-configurable chirp timing (CDC-synchronized in radar_system_top.v)
input wire [15:0] host_long_chirp_cycles,
input wire [15:0] host_long_listen_cycles,
input wire [15:0] host_guard_cycles,
input wire [15:0] host_short_chirp_cycles,
input wire [15:0] host_short_listen_cycles,
input wire [5:0] host_chirps_per_elev
);
// ========== INTERNAL SIGNALS ==========
@@ -91,6 +99,13 @@ radar_mode_controller rmc (
.stm32_new_elevation(1'b0), // Unused in auto mode
.stm32_new_azimuth(1'b0), // Unused in auto mode
.trigger(host_trigger), // Single-chirp trigger from host via USB
// Gap 2: Runtime-configurable timing from host USB commands
.cfg_long_chirp_cycles(host_long_chirp_cycles),
.cfg_long_listen_cycles(host_long_listen_cycles),
.cfg_guard_cycles(host_guard_cycles),
.cfg_short_chirp_cycles(host_short_chirp_cycles),
.cfg_short_listen_cycles(host_short_listen_cycles),
.cfg_chirps_per_elev(host_chirps_per_elev),
.use_long_chirp(use_long_chirp),
.mc_new_chirp(mc_new_chirp),
.mc_new_elevation(mc_new_elevation),