mirror of
https://github.com/NawfalMotii79/PLFM_RADAR.git
synced 2026-06-10 15:31:21 +00:00
fix(fpga): reset chirp_counter at DONE; source CHIRP_MAX from radar_params
C-3: plfm_chirp_controller_enhanced never reset chirp_counter when the frame completed. Counter sat at CHIRP_MAX after frame 1, so the LONG_LISTEN -> GUARD transition guard (== CHIRP_MAX/2-1) never matched correctly on subsequent frames and frame 2+ ran extra chirps until the 6-bit counter wrapped. Reset chirp_counter in the DONE state. S-2: Replace hardcoded CHIRP_MAX = 32 with RP_CHIRPS_PER_FRAME from radar_params.vh so the TX FSM tracks the single source of truth. S-1: Correct misleading labels in tb_system_e2e G14.1-G14.3. Per radar_params.vh the range_mode encoding is 2'b00 = 3 km, 2'b01 = long-range, 2'b10/2'b11 = reserved. The TB strings previously called 2'b01 "short" and 2'b10 "long", which is inverted and inconsistent with the RTL comments in radar_mode_controller.v. Regression: 32/32 PASS.
This commit is contained in:
@@ -1161,20 +1161,20 @@ initial begin
|
||||
// The registers were re-loaded in G9. Send fresh values to verify write path.
|
||||
|
||||
// --- Range Mode Register (0x20, Fix 7) ---
|
||||
// G14.1: Set range_mode to short-range (0x01)
|
||||
// G14.1: Set range_mode to long-range (0x01)
|
||||
bfm_send_cmd(8'h20, 8'h00, 16'h0001);
|
||||
check(dut.host_range_mode == 2'b01,
|
||||
"G14.1: Opcode 0x20 -> host_range_mode = 2'b01 (short)");
|
||||
"G14.1: Opcode 0x20 -> host_range_mode = 2'b01 (long-range)");
|
||||
|
||||
// G14.2: Set range_mode to long-range (0x02)
|
||||
// G14.2: Set range_mode to reserved value 0x02 (permissive: stored as-is)
|
||||
bfm_send_cmd(8'h20, 8'h00, 16'h0002);
|
||||
check(dut.host_range_mode == 2'b10,
|
||||
"G14.2: Opcode 0x20 -> host_range_mode = 2'b10 (long)");
|
||||
"G14.2: Opcode 0x20 -> host_range_mode = 2'b10 (reserved)");
|
||||
|
||||
// G14.3: Restore range_mode to auto (0x00)
|
||||
// G14.3: Restore range_mode to 3 km (0x00)
|
||||
bfm_send_cmd(8'h20, 8'h00, 16'h0000);
|
||||
check(dut.host_range_mode == 2'b00,
|
||||
"G14.3: Opcode 0x20 -> host_range_mode = 2'b00 (auto)");
|
||||
"G14.3: Opcode 0x20 -> host_range_mode = 2'b00 (3 km)");
|
||||
|
||||
// --- CFAR Guard Cells (0x21) ---
|
||||
// G14.4: Set guard cells to 4
|
||||
|
||||
Reference in New Issue
Block a user