From 470f68c370ba9dc997c275a35fab21967ed25ed1 Mon Sep 17 00:00:00 2001 From: Serhii Date: Tue, 21 Apr 2026 09:09:37 +0300 Subject: [PATCH] fix(smoke-test): decode self-test results from dedicated status fields MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit smoke_test.py:154-155 extracted self-test flags/detail from status.cfar_threshold — but that field carries the CFAR detection threshold (opcode 0x03 readback), not self-test results. RadarProtocol.parse_status_packet already exposes the correct fields via status.self_test_flags and status.self_test_detail (radar_protocol.py:257, word 5: {7'd0, self_test_busy, 8'd0, self_test_detail[7:0], 3'd0, self_test_flags[4:0]}). test_GUI_V65_Tk.py:198 pins these fields as the contract. Result: smoke_test on live hardware would have decoded garbage (CFAR threshold bits) as per-subsystem PASS/FAIL flags. Fix replaces the two assignments and refreshes the stale "simplification" comment that predated the dedicated status fields. Regression: 137 passed, 3 skipped (test_v7.py + cross_layer). 8 self_test invariant tests in test_GUI_V65_Tk.py still pass. --- 9_Firmware/9_3_GUI/smoke_test.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/9_Firmware/9_3_GUI/smoke_test.py b/9_Firmware/9_3_GUI/smoke_test.py index 679e722..857fe9d 100644 --- a/9_Firmware/9_3_GUI/smoke_test.py +++ b/9_Firmware/9_3_GUI/smoke_test.py @@ -148,11 +148,11 @@ class SmokeTest: if ptype == "status": status = RadarProtocol.parse_status_packet(raw[start:end]) if status is not None: - # Self-test results encoded in status fields - # (This is a simplification — in production, the FPGA - # would have a dedicated self-test result packet type) - result_flags = status.cfar_threshold & 0x1F - result_detail = (status.cfar_threshold >> 8) & 0xFF + # Self-test results live in dedicated status fields + # (word 5: self_test_flags[4:0], self_test_detail[7:0]). + # See radar_protocol.py:257 and test_GUI_V65_Tk.py:198. + result_flags = status.self_test_flags + result_detail = status.self_test_detail return (result_flags, result_detail) time.sleep(0.1)