mirror of
https://github.com/NawfalMotii79/PLFM_RADAR.git
synced 2026-06-11 07:51:17 +00:00
fix(fpga): PR-X.1 F-7.7 — wire AD9484 OR sticky to shared clear pulse
Stage-7 ADC chain audit. radar_receiver_final.v's adc_overrange_sticky_400m had no clear path other than full system reset_n — once latched, the only way to acknowledge the AD9484 overrange flag was a reboot. The DDC's analogous diagnostic flags (cdc_cic_fir_overrun_sticky, mixer_saturation) already clear on the DDC's `reset_monitors` port; the OR sticky in the receiver wrapper was the lone outlier. Introduce a shared `clear_monitors_pulse` wire at the receiver scope and route it both to the OR sticky's clear branch and to the DDC's `reset_monitors` port (replacing the literal `1'b0`). Today the wire is tied 1'b0, preserving the prior reset_n-only behaviour bit- for-bit. When a future host opcode for "clear diagnostic stickies" lands, both the receiver-level OR sticky and the DDC's internal sticky flags clear from the same pulse — no per-flag re-plumbing. Local FPGA regression 36/1/6 unchanged (1 FAIL = pre-existing T-6 drift, deferred PR-M.4).
This commit is contained in:
@@ -320,14 +320,27 @@ ad9484_interface_400m adc (
|
|||||||
.mmcm_locked()
|
.mmcm_locked()
|
||||||
);
|
);
|
||||||
|
|
||||||
// Audit F-0.1: stickify the 400 MHz OR pulse, then CDC to clk_100m via 2FF.
|
// Audit F-0.1 / F-7.7: stickify the 400 MHz OR pulse, then CDC to clk_100m
|
||||||
// Same reasoning as ddc_cic_fir_overrun: single-bit, low→high-only once
|
// via 2FF. Single-bit, low→high-only once latched, so a 2FF sync is
|
||||||
// latched, so a 2FF sync is sufficient for a GPIO-class diagnostic. Cleared
|
// sufficient for a GPIO-class diagnostic.
|
||||||
// only by global reset_n.
|
//
|
||||||
reg adc_overrange_sticky_400m;
|
// F-7.7 fix: clear path now follows the same `clear_monitors_pulse` wire
|
||||||
|
// as the DDC's `reset_monitors` port (see ddc instance below). Today
|
||||||
|
// clear_monitors_pulse is tied 1'b0, matching the prior reset_n-only
|
||||||
|
// behaviour; once a host opcode for "clear diagnostic stickies" lands,
|
||||||
|
// both this OR sticky and the DDC's overrun/saturation flags clear from
|
||||||
|
// the same edge — no per-flag re-plumbing needed.
|
||||||
|
//
|
||||||
|
// Compare with ddc_400m.v `cdc_cic_fir_overrun_sticky` which already
|
||||||
|
// uses reset_monitors as a clear, and the new symmetric path here keeps
|
||||||
|
// the AD9484 overrange diagnostic consistent.
|
||||||
|
wire clear_monitors_pulse = 1'b0; // future host-driven clear hook
|
||||||
|
reg adc_overrange_sticky_400m;
|
||||||
always @(posedge clk_400m or negedge reset_n) begin
|
always @(posedge clk_400m or negedge reset_n) begin
|
||||||
if (!reset_n)
|
if (!reset_n)
|
||||||
adc_overrange_sticky_400m <= 1'b0;
|
adc_overrange_sticky_400m <= 1'b0;
|
||||||
|
else if (clear_monitors_pulse)
|
||||||
|
adc_overrange_sticky_400m <= 1'b0;
|
||||||
else if (adc_overrange_400m)
|
else if (adc_overrange_400m)
|
||||||
adc_overrange_sticky_400m <= 1'b1;
|
adc_overrange_sticky_400m <= 1'b1;
|
||||||
end
|
end
|
||||||
@@ -391,7 +404,10 @@ ddc_400m_enhanced ddc(
|
|||||||
.test_mode(2'b00),
|
.test_mode(2'b00),
|
||||||
.test_phase_inc(16'h0000),
|
.test_phase_inc(16'h0000),
|
||||||
.force_saturation(1'b0),
|
.force_saturation(1'b0),
|
||||||
.reset_monitors(1'b0),
|
// F-7.7: routed through the shared clear_monitors_pulse wire so the
|
||||||
|
// DDC's internal stickies and the AD9484 OR sticky above clear from
|
||||||
|
// the same future host opcode.
|
||||||
|
.reset_monitors(clear_monitors_pulse),
|
||||||
.debug_sample_count(),
|
.debug_sample_count(),
|
||||||
.debug_internal_i(),
|
.debug_internal_i(),
|
||||||
.debug_internal_q(),
|
.debug_internal_q(),
|
||||||
|
|||||||
Reference in New Issue
Block a user