Quellcode durchsuchen

fix(prod2u): allow temporary image bitgen with advisory TD checks

Codex Resource Selftest vor 4 Monaten
Ursprung
Commit
73df4eede2

+ 51 - 37
td/phy/prod2u_p4_normal_v3.tcl

@@ -1,25 +1,3 @@
-proc phy_block {reason} {
-    error "PROD2U_P4_NORMAL_V3_PHY_BLOCKED|$reason"
-}
-
-proc phy_apply_cdc_input_false_paths {input_pairs} {
-    set endpoints {}
-    foreach {source_port pattern} $input_pairs {
-        set source_matches [get_ports -quiet $source_port]
-        if {[llength $source_matches] != 1} {
-            phy_block "expected exactly one asynchronous input port for $source_port, got [llength $source_matches]"
-        }
-        set endpoint_matches [get_regs -quiet $pattern]
-        if {[llength $endpoint_matches] != 1} {
-            phy_block "expected exactly one first-stage CDC endpoint for $pattern, got [llength $endpoint_matches]"
-        }
-        set endpoint [lindex $endpoint_matches 0]
-        set_false_path -from [lindex $source_matches 0] -to $endpoint
-        lappend endpoints $endpoint
-    }
-    return $endpoints
-}
-
 import_device ef2_4.db -package EF2L45BG256B
 import_device ef2_4.db -package EF2L45BG256B
 set_param place async_reg on
 set_param place async_reg on
 import_db ../syn/prod2u_p4_normal_v3_gate.db
 import_db ../syn/prod2u_p4_normal_v3_gate.db
@@ -36,16 +14,26 @@ set cdc_patterns {
     */u_core/u_motors/u_y_axis/limit_sync_pipe[1]
     */u_core/u_motors/u_y_axis/limit_sync_pipe[1]
     */u_core/u_motors/u_y_axis/limit_sync_pipe[2]
     */u_core/u_motors/u_y_axis/limit_sync_pipe[2]
 }
 }
+set cdc_report [open {prod2u_p4_normal_v3_cdc.rpt} w]
+puts $cdc_report {schema=prod2u-p4-normal-v3-cdc-v2}
+set cdc_failures {}
 set cdc_regs {}
 set cdc_regs {}
 foreach pattern $cdc_patterns {
 foreach pattern $cdc_patterns {
     set matches [get_regs -quiet $pattern]
     set matches [get_regs -quiet $pattern]
     if {[llength $matches] != 1} {
     if {[llength $matches] != 1} {
-        phy_block "expected exactly one imported CDC register for $pattern, got [llength $matches]"
+        set reason "retained_sync_register_count:$pattern:[llength $matches]"
+        lappend cdc_failures $reason
+        puts $cdc_report "structural_failure=$reason"
+    }
+    foreach reg $matches {
+        lappend cdc_regs $reg
+        puts $cdc_report "retained_sync_register=$reg"
     }
     }
-    lappend cdc_regs [lindex $matches 0]
 }
 }
 if {[llength $cdc_regs] != 8} {
 if {[llength $cdc_regs] != 8} {
-    phy_block "expected eight imported CDC registers, got [llength $cdc_regs]"
+    set reason "retained_sync_register_total:[llength $cdc_regs]"
+    lappend cdc_failures $reason
+    puts $cdc_report "structural_failure=$reason"
 }
 }
 
 
 set cdc_input_pairs {
 set cdc_input_pairs {
@@ -53,16 +41,34 @@ set cdc_input_pairs {
     x_limit_raw */u_core/u_motors/u_x_axis/limit_sync_pipe[0]
     x_limit_raw */u_core/u_motors/u_x_axis/limit_sync_pipe[0]
     y_limit_raw */u_core/u_motors/u_y_axis/limit_sync_pipe[0]
     y_limit_raw */u_core/u_motors/u_y_axis/limit_sync_pipe[0]
 }
 }
-set first_stage_endpoints [phy_apply_cdc_input_false_paths $cdc_input_pairs]
-set cdc_report [open {prod2u_p4_normal_v3_cdc.rpt} w]
-puts $cdc_report {schema=prod2u-p4-normal-v3-cdc-v2}
-foreach reg $cdc_regs {
-    puts $cdc_report "retained_sync_register=$reg"
-}
-foreach endpoint $first_stage_endpoints {
-    puts $cdc_report "false_path_endpoint=$endpoint"
+foreach {source_port pattern} $cdc_input_pairs {
+    set source_matches [get_ports -quiet $source_port]
+    if {[llength $source_matches] != 1} {
+        set reason "asynchronous_input_port_count:$source_port:[llength $source_matches]"
+        lappend cdc_failures $reason
+        puts $cdc_report "structural_failure=$reason"
+        continue
+    }
+    set source [lindex $source_matches 0]
+    set endpoint_matches [get_regs -quiet $pattern]
+    if {[llength $endpoint_matches] == 1} {
+        set endpoint [lindex $endpoint_matches 0]
+        set_false_path -from $source -to $endpoint
+        puts $cdc_report "false_path_endpoint=$endpoint"
+    } else {
+        set_false_path -from $source
+        puts $cdc_report "false_path_source=$source_port"
+        set reason "first_stage_endpoint_count:$source_port:$pattern:[llength $endpoint_matches]"
+        lappend cdc_failures $reason
+        puts $cdc_report "structural_failure=$reason"
+    }
 }
 }
 close $cdc_report
 close $cdc_report
+if {[llength $cdc_failures] == 0} {
+    puts {CDC_GATE_PASS=1}
+} else {
+    puts "CDC_GATE_ADVISORY_FAIL=[llength $cdc_failures]"
+}
 
 
 set phase_groups {
 set phase_groups {
     x {*/u_core/u_motors/u_x_axis/motion_phase*}
     x {*/u_core/u_motors/u_x_axis/motion_phase*}
@@ -70,6 +76,7 @@ set phase_groups {
 }
 }
 set fsm_report [open {prod2u_p4_normal_v3_fsm_encoding.rpt} w]
 set fsm_report [open {prod2u_p4_normal_v3_fsm_encoding.rpt} w]
 puts $fsm_report {schema=prod2u-p4-normal-v3-fsm-encoding-v2}
 puts $fsm_report {schema=prod2u-p4-normal-v3-fsm-encoding-v2}
+set fsm_failures {}
 foreach {axis pattern} $phase_groups {
 foreach {axis pattern} $phase_groups {
     set matches {}
     set matches {}
     foreach candidate [get_regs -quiet $pattern] {
     foreach candidate [get_regs -quiet $pattern] {
@@ -78,13 +85,20 @@ foreach {axis pattern} $phase_groups {
         }
         }
     }
     }
     if {[llength $matches] != 3} {
     if {[llength $matches] != 3} {
-        close $fsm_report
-        phy_block "expected three imported sequential motion_phase registers for $axis, got [llength $matches]"
+        puts $fsm_report "motion_phase=${axis}:[llength $matches]:unknown"
+        set reason "motion_phase_register_count:$axis:[llength $matches]"
+        lappend fsm_failures $reason
+        puts $fsm_report "structural_failure=$reason"
+    } else {
+        puts $fsm_report "motion_phase=${axis}:[llength $matches]:sequential"
     }
     }
-    puts $fsm_report "motion_phase=${axis}:[llength $matches]:sequential"
 }
 }
 close $fsm_report
 close $fsm_report
-puts {FSM_ENCODING_GATE_PASS=sequential}
+if {[llength $fsm_failures] == 0} {
+    puts {FSM_ENCODING_GATE_PASS=sequential}
+} else {
+    puts "FSM_ENCODING_GATE_ADVISORY_FAIL=[llength $fsm_failures]"
+}
 
 
 set_param route effort routability
 set_param route effort routability
 place
 place

+ 54 - 39
td/syn/prod2u_p4_normal_v3.tcl

@@ -1,25 +1,3 @@
-proc syn_block {reason} {
-    error "PROD2U_P4_NORMAL_V3_SYN_BLOCKED|$reason"
-}
-
-proc syn_apply_cdc_input_false_paths {input_pairs} {
-    set endpoints {}
-    foreach {source_port pattern} $input_pairs {
-        set source_matches [get_ports -quiet $source_port]
-        if {[llength $source_matches] != 1} {
-            syn_block "expected exactly one asynchronous input port for $source_port, got [llength $source_matches]"
-        }
-        set endpoint_matches [get_regs -quiet $pattern]
-        if {[llength $endpoint_matches] != 1} {
-            syn_block "expected exactly one first-stage CDC endpoint for $pattern, got [llength $endpoint_matches]"
-        }
-        set endpoint [lindex $endpoint_matches 0]
-        set_false_path -from [lindex $source_matches 0] -to $endpoint
-        lappend endpoints $endpoint
-    }
-    return $endpoints
-}
-
 import_device ef2_4.db -package EF2L45BG256B
 import_device ef2_4.db -package EF2L45BG256B
 set_param rtl directive:async_reg on
 set_param rtl directive:async_reg on
 set_param place async_reg on
 set_param place async_reg on
@@ -54,33 +32,63 @@ set cdc_patterns {
     */u_core/u_motors/u_y_axis/limit_sync_pipe[1]
     */u_core/u_motors/u_y_axis/limit_sync_pipe[1]
     */u_core/u_motors/u_y_axis/limit_sync_pipe[2]
     */u_core/u_motors/u_y_axis/limit_sync_pipe[2]
 }
 }
+set cdc_report [open {prod2u_p4_normal_v3_cdc.rpt} w]
+puts $cdc_report {schema=prod2u-p4-normal-v3-cdc-v2}
+set cdc_failures {}
 set cdc_regs {}
 set cdc_regs {}
 foreach pattern $cdc_patterns {
 foreach pattern $cdc_patterns {
     set matches [get_regs -quiet $pattern]
     set matches [get_regs -quiet $pattern]
     if {[llength $matches] != 1} {
     if {[llength $matches] != 1} {
-        syn_block "expected exactly one retained CDC register for $pattern, got [llength $matches]"
+        set reason "retained_sync_register_count:$pattern:[llength $matches]"
+        lappend cdc_failures $reason
+        puts $cdc_report "structural_failure=$reason"
+    }
+    foreach reg $matches {
+        lappend cdc_regs $reg
+        puts $cdc_report "retained_sync_register=$reg"
     }
     }
-    lappend cdc_regs [lindex $matches 0]
 }
 }
 if {[llength $cdc_regs] != 8} {
 if {[llength $cdc_regs] != 8} {
-    syn_block "expected eight retained CDC registers, got [llength $cdc_regs]"
+    set reason "retained_sync_register_total:[llength $cdc_regs]"
+    lappend cdc_failures $reason
+    puts $cdc_report "structural_failure=$reason"
+}
+if {[llength $cdc_regs] > 0} {
+    set_property async_reg true $cdc_regs
 }
 }
-set_property async_reg true $cdc_regs
 set cdc_input_pairs {
 set cdc_input_pairs {
     host_uart_rx */u_uart_rx/rx_sync_pipe[0]
     host_uart_rx */u_uart_rx/rx_sync_pipe[0]
     x_limit_raw */u_core/u_motors/u_x_axis/limit_sync_pipe[0]
     x_limit_raw */u_core/u_motors/u_x_axis/limit_sync_pipe[0]
     y_limit_raw */u_core/u_motors/u_y_axis/limit_sync_pipe[0]
     y_limit_raw */u_core/u_motors/u_y_axis/limit_sync_pipe[0]
 }
 }
-set first_stage_endpoints [syn_apply_cdc_input_false_paths $cdc_input_pairs]
-set cdc_report [open {prod2u_p4_normal_v3_cdc.rpt} w]
-puts $cdc_report {schema=prod2u-p4-normal-v3-cdc-v2}
-foreach reg $cdc_regs {
-    puts $cdc_report "retained_sync_register=$reg"
-}
-foreach endpoint $first_stage_endpoints {
-    puts $cdc_report "false_path_endpoint=$endpoint"
+foreach {source_port pattern} $cdc_input_pairs {
+    set source_matches [get_ports -quiet $source_port]
+    if {[llength $source_matches] != 1} {
+        set reason "asynchronous_input_port_count:$source_port:[llength $source_matches]"
+        lappend cdc_failures $reason
+        puts $cdc_report "structural_failure=$reason"
+        continue
+    }
+    set source [lindex $source_matches 0]
+    set endpoint_matches [get_regs -quiet $pattern]
+    if {[llength $endpoint_matches] == 1} {
+        set endpoint [lindex $endpoint_matches 0]
+        set_false_path -from $source -to $endpoint
+        puts $cdc_report "false_path_endpoint=$endpoint"
+    } else {
+        set_false_path -from $source
+        puts $cdc_report "false_path_source=$source_port"
+        set reason "first_stage_endpoint_count:$source_port:$pattern:[llength $endpoint_matches]"
+        lappend cdc_failures $reason
+        puts $cdc_report "structural_failure=$reason"
+    }
 }
 }
 close $cdc_report
 close $cdc_report
+if {[llength $cdc_failures] == 0} {
+    puts {CDC_GATE_PASS=1}
+} else {
+    puts "CDC_GATE_ADVISORY_FAIL=[llength $cdc_failures]"
+}
 
 
 report_area -file prod2u_p4_normal_v3_rtl.area
 report_area -file prod2u_p4_normal_v3_rtl.area
 export_db prod2u_p4_normal_v3_rtl.db
 export_db prod2u_p4_normal_v3_rtl.db
@@ -94,6 +102,7 @@ set phase_groups {
 }
 }
 set fsm_report [open {prod2u_p4_normal_v3_fsm_encoding.rpt} w]
 set fsm_report [open {prod2u_p4_normal_v3_fsm_encoding.rpt} w]
 puts $fsm_report {schema=prod2u-p4-normal-v3-fsm-encoding-v2}
 puts $fsm_report {schema=prod2u-p4-normal-v3-fsm-encoding-v2}
+set fsm_failures {}
 foreach {axis pattern} $phase_groups {
 foreach {axis pattern} $phase_groups {
     set matches {}
     set matches {}
     foreach candidate [get_regs -quiet $pattern] {
     foreach candidate [get_regs -quiet $pattern] {
@@ -102,17 +111,23 @@ foreach {axis pattern} $phase_groups {
         }
         }
     }
     }
     if {[llength $matches] != 3} {
     if {[llength $matches] != 3} {
-        close $fsm_report
-        syn_block "expected three retained sequential motion_phase registers for $axis, got [llength $matches]"
+        puts $fsm_report "motion_phase=${axis}:[llength $matches]:unknown"
+        set reason "motion_phase_register_count:$axis:[llength $matches]"
+        lappend fsm_failures $reason
+        puts $fsm_report "structural_failure=$reason"
+    } else {
+        puts $fsm_report "motion_phase=${axis}:[llength $matches]:sequential"
     }
     }
-    puts $fsm_report "motion_phase=${axis}:[llength $matches]:sequential"
 }
 }
 close $fsm_report
 close $fsm_report
+if {[llength $fsm_failures] == 0} {
+    puts {FSM_ENCODING_GATE_PASS=sequential}
+} else {
+    puts "FSM_ENCODING_GATE_ADVISORY_FAIL=[llength $fsm_failures]"
+}
 
 
 report_area -io_info -file prod2u_p4_normal_v3_gate.area
 report_area -io_info -file prod2u_p4_normal_v3_gate.area
 report_qor -step gate -file prod2u_p4_normal_v3_gate.qor
 report_qor -step gate -file prod2u_p4_normal_v3_gate.qor
-puts {CDC_GATE_PASS=1}
-puts {FSM_ENCODING_GATE_PASS=sequential}
 legalize_phy_inst
 legalize_phy_inst
 update_timing
 update_timing
 report_timing_summary -file prod2u_p4_normal_v3_gate.timing
 report_timing_summary -file prod2u_p4_normal_v3_gate.timing

+ 68 - 0
tests/unit/test_prod2u_p4_harness.py

@@ -156,6 +156,74 @@ def valid_package_receipt(
 
 
 
 
 class Prod2UP4HarnessTests(unittest.TestCase):
 class Prod2UP4HarnessTests(unittest.TestCase):
+    def test_cdc_report_preserves_advisory_failures_and_source_only_paths(self) -> None:
+        with tempfile.TemporaryDirectory(dir=ROOT.parent) as temporary:
+            report_path = Path(temporary) / "cdc.rpt"
+            report_path.write_text(
+                "\n".join(
+                    (
+                        f"schema={harness.CDC_REPORT_SCHEMA}",
+                        "retained_sync_register=u_uart_rx/rx_sync_pipe[1]",
+                        "false_path_source=host_uart_rx",
+                        "structural_failure=retained_sync_register_count:host_uart_rx:0",
+                    )
+                )
+                + "\n",
+                encoding="ascii",
+            )
+
+            report = harness.parse_td_cdc_report(report_path)
+
+        self.assertIsNotNone(report)
+        assert report is not None
+        self.assertEqual(report["source_only_false_paths"], ["host_uart_rx"])
+        self.assertEqual(
+            report["structural_failures"],
+            ["retained_sync_register_count:host_uart_rx:0"],
+        )
+        gate = harness.structural_cdc_gate(
+            report,
+            async_reg_count=1,
+            input_register_count=0,
+        )
+        self.assertEqual(gate["status"], "fail")
+        self.assertIn(
+            "td_report:retained_sync_register_count:host_uart_rx:0",
+            gate["failures"],
+        )
+        self.assertIn("source_only_false_paths_used:host_uart_rx", gate["failures"])
+
+    def test_fsm_report_preserves_advisory_discovery_failures(self) -> None:
+        with tempfile.TemporaryDirectory(dir=ROOT.parent) as temporary:
+            report_path = Path(temporary) / "fsm.rpt"
+            report_path.write_text(
+                "\n".join(
+                    (
+                        f"schema={harness.FSM_REPORT_SCHEMA}",
+                        "motion_phase=x:0:unknown",
+                        "motion_phase=y:3:sequential",
+                        "structural_failure=motion_phase_register_count:x:0",
+                    )
+                )
+                + "\n",
+                encoding="ascii",
+            )
+
+            report = harness.parse_td_fsm_report(report_path)
+
+        self.assertIsNotNone(report)
+        assert report is not None
+        self.assertEqual(
+            report["structural_failures"],
+            ["motion_phase_register_count:x:0"],
+        )
+        gate = harness.structural_fsm_gate(report, syn_log="")
+        self.assertEqual(gate["status"], "fail")
+        self.assertIn(
+            "td_report:motion_phase_register_count:x:0",
+            gate["failures"],
+        )
+
     def test_bitgen_eligibility_depends_only_on_successful_route(self) -> None:
     def test_bitgen_eligibility_depends_only_on_successful_route(self) -> None:
         self.assertTrue(
         self.assertTrue(
             harness.td_bitgen_eligible(
             harness.td_bitgen_eligible(

+ 18 - 2
tests/unit/test_prod2u_p4_td_cdc_structure.py

@@ -66,7 +66,7 @@ class Prod2UP4TdCdcStructureTests(unittest.TestCase):
             observed = {line.strip() for line in block.splitlines() if line.strip()}
             observed = {line.strip() for line in block.splitlines() if line.strip()}
             with self.subTest(path=path.name):
             with self.subTest(path=path.name):
                 self.assertEqual(observed, expected_patterns)
                 self.assertEqual(observed, expected_patterns)
-                self.assertIn("expected eight", source)
+                self.assertIn("retained_sync_register_total", source)
 
 
     def test_only_async_input_to_first_stage_paths_are_false_pathed(self) -> None:
     def test_only_async_input_to_first_stage_paths_are_false_pathed(self) -> None:
         expected_pairs = {
         expected_pairs = {
@@ -80,7 +80,23 @@ class Prod2UP4TdCdcStructureTests(unittest.TestCase):
             observed = {line.strip() for line in block.splitlines() if line.strip()}
             observed = {line.strip() for line in block.splitlines() if line.strip()}
             with self.subTest(path=path.name):
             with self.subTest(path=path.name):
                 self.assertEqual(observed, expected_pairs)
                 self.assertEqual(observed, expected_pairs)
-                self.assertEqual(source.count("set_false_path -from"), 1)
+                self.assertEqual(source.count("set_false_path -from"), 2)
+
+    def test_td_structure_discovery_is_advisory_and_has_source_only_fallback(self) -> None:
+        for path in (SYN, PHY):
+            source = path.read_text(encoding="ascii")
+            with self.subTest(path=path.name):
+                self.assertNotRegex(source, r'\berror\s+"PROD2U_P4_NORMAL_V3_')
+                self.assertNotIn("_block \"expected", source)
+                self.assertIn("structural_failure=", source)
+                self.assertIn("set_false_path -from $source", source)
+                self.assertIn("set_false_path -from $source -to $endpoint", source)
+                self.assertLess(
+                    source.index("set cdc_report [open"),
+                    source.index("foreach pattern $cdc_patterns"),
+                )
+                self.assertIn("CDC_GATE_ADVISORY_FAIL=", source)
+                self.assertIn("FSM_ENCODING_GATE_ADVISORY_FAIL=", source)
 
 
     def test_td_reports_x_and_y_three_bit_sequential_motion_phase(self) -> None:
     def test_td_reports_x_and_y_three_bit_sequential_motion_phase(self) -> None:
         for path in (SYN, PHY):
         for path in (SYN, PHY):

+ 34 - 2
tools/prod2u_p4_harness.py

@@ -1980,6 +1980,8 @@ def parse_td_cdc_report(path: Path) -> dict[str, Any] | None:
         "schema": [],
         "schema": [],
         "retained_sync_register": [],
         "retained_sync_register": [],
         "false_path_endpoint": [],
         "false_path_endpoint": [],
+        "false_path_source": [],
+        "structural_failure": [],
     }
     }
     for raw_line in path.read_text(encoding="utf-8", errors="replace").splitlines():
     for raw_line in path.read_text(encoding="utf-8", errors="replace").splitlines():
         line = raw_line.strip()
         line = raw_line.strip()
@@ -1995,12 +1997,20 @@ def parse_td_cdc_report(path: Path) -> dict[str, Any] | None:
         return None
         return None
     registers = rows["retained_sync_register"]
     registers = rows["retained_sync_register"]
     endpoints = rows["false_path_endpoint"]
     endpoints = rows["false_path_endpoint"]
-    if len(registers) != len(set(registers)) or len(endpoints) != len(set(endpoints)):
+    sources = rows["false_path_source"]
+    failures = rows["structural_failure"]
+    if (
+        len(registers) != len(set(registers))
+        or len(endpoints) != len(set(endpoints))
+        or len(sources) != len(set(sources))
+    ):
         return None
         return None
     return {
     return {
         "schema": CDC_REPORT_SCHEMA,
         "schema": CDC_REPORT_SCHEMA,
         "retained_sync_registers": registers,
         "retained_sync_registers": registers,
         "false_path_endpoints": endpoints,
         "false_path_endpoints": endpoints,
+        "source_only_false_paths": sources,
+        "structural_failures": failures,
     }
     }
 
 
 
 
@@ -2010,6 +2020,7 @@ def parse_td_fsm_report(path: Path) -> dict[str, Any] | None:
     schema: str | None = None
     schema: str | None = None
     axes: dict[str, int] = {}
     axes: dict[str, int] = {}
     encodings: dict[str, str] = {}
     encodings: dict[str, str] = {}
+    failures: list[str] = []
     for raw_line in path.read_text(encoding="utf-8", errors="replace").splitlines():
     for raw_line in path.read_text(encoding="utf-8", errors="replace").splitlines():
         line = raw_line.strip()
         line = raw_line.strip()
         if not line or "=" not in line:
         if not line or "=" not in line:
@@ -2020,6 +2031,9 @@ def parse_td_fsm_report(path: Path) -> dict[str, Any] | None:
                 return None
                 return None
             schema = value
             schema = value
             continue
             continue
+        if key == "structural_failure":
+            failures.append(value)
+            continue
         if key != "motion_phase":
         if key != "motion_phase":
             return None
             return None
         match = re.fullmatch(r"([xy]):(\d+):([a-z][a-z0-9_]*)", value)
         match = re.fullmatch(r"([xy]):(\d+):([a-z][a-z0-9_]*)", value)
@@ -2030,7 +2044,12 @@ def parse_td_fsm_report(path: Path) -> dict[str, Any] | None:
         encodings[axis] = match.group(3)
         encodings[axis] = match.group(3)
     if schema != FSM_REPORT_SCHEMA:
     if schema != FSM_REPORT_SCHEMA:
         return None
         return None
-    return {"schema": schema, "axes": axes, "encodings": encodings}
+    return {
+        "schema": schema,
+        "axes": axes,
+        "encodings": encodings,
+        "structural_failures": failures,
+    }
 
 
 
 
 def structural_cdc_gate(
 def structural_cdc_gate(
@@ -2042,8 +2061,12 @@ def structural_cdc_gate(
     failures: list[str] = []
     failures: list[str] = []
     registers = report.get("retained_sync_registers") if isinstance(report, Mapping) else None
     registers = report.get("retained_sync_registers") if isinstance(report, Mapping) else None
     endpoints = report.get("false_path_endpoints") if isinstance(report, Mapping) else None
     endpoints = report.get("false_path_endpoints") if isinstance(report, Mapping) else None
+    source_only = report.get("source_only_false_paths") if isinstance(report, Mapping) else None
+    reported = report.get("structural_failures") if isinstance(report, Mapping) else None
     register_set = set(registers) if isinstance(registers, list) and all(isinstance(item, str) for item in registers) else set()
     register_set = set(registers) if isinstance(registers, list) and all(isinstance(item, str) for item in registers) else set()
     endpoint_set = set(endpoints) if isinstance(endpoints, list) and all(isinstance(item, str) for item in endpoints) else set()
     endpoint_set = set(endpoints) if isinstance(endpoints, list) and all(isinstance(item, str) for item in endpoints) else set()
+    source_set = set(source_only) if isinstance(source_only, list) and all(isinstance(item, str) for item in source_only) else set()
+    reported_failures = list(reported) if isinstance(reported, list) and all(isinstance(item, str) for item in reported) else []
 
 
     if async_reg_count != len(EXPECTED_CDC_SYNC_REGISTERS):
     if async_reg_count != len(EXPECTED_CDC_SYNC_REGISTERS):
         failures.append(f"async_reg_used:{async_reg_count}")
         failures.append(f"async_reg_used:{async_reg_count}")
@@ -2053,6 +2076,9 @@ def structural_cdc_gate(
         failures.append("retained_sync_registers_mismatch")
         failures.append("retained_sync_registers_mismatch")
     if endpoint_set != EXPECTED_CDC_FALSE_PATH_ENDPOINTS:
     if endpoint_set != EXPECTED_CDC_FALSE_PATH_ENDPOINTS:
         failures.append("false_path_endpoints_mismatch")
         failures.append("false_path_endpoints_mismatch")
+    if source_set:
+        failures.append(f"source_only_false_paths_used:{','.join(sorted(source_set))}")
+    failures.extend(f"td_report:{failure}" for failure in reported_failures)
 
 
     return {
     return {
         "status": "pass" if not failures else "fail",
         "status": "pass" if not failures else "fail",
@@ -2072,6 +2098,8 @@ def structural_cdc_gate(
             "status": "pass" if endpoint_set == EXPECTED_CDC_FALSE_PATH_ENDPOINTS else "fail",
             "status": "pass" if endpoint_set == EXPECTED_CDC_FALSE_PATH_ENDPOINTS else "fail",
             "used": len(endpoint_set),
             "used": len(endpoint_set),
         },
         },
+        "source_only_false_paths": sorted(source_set),
+        "reported_failures": reported_failures,
         "failures": failures,
         "failures": failures,
     }
     }
 
 
@@ -2084,8 +2112,10 @@ def structural_fsm_gate(
     failures: list[str] = []
     failures: list[str] = []
     axes = report.get("axes") if isinstance(report, Mapping) else None
     axes = report.get("axes") if isinstance(report, Mapping) else None
     encodings = report.get("encodings") if isinstance(report, Mapping) else None
     encodings = report.get("encodings") if isinstance(report, Mapping) else None
+    reported = report.get("structural_failures") if isinstance(report, Mapping) else None
     normalized_axes = dict(axes) if isinstance(axes, Mapping) else {}
     normalized_axes = dict(axes) if isinstance(axes, Mapping) else {}
     normalized_encodings = dict(encodings) if isinstance(encodings, Mapping) else {}
     normalized_encodings = dict(encodings) if isinstance(encodings, Mapping) else {}
+    reported_failures = list(reported) if isinstance(reported, list) and all(isinstance(item, str) for item in reported) else []
     if normalized_axes != EXPECTED_FSM_AXES:
     if normalized_axes != EXPECTED_FSM_AXES:
         failures.append("motion_phase_width_or_axis_mismatch")
         failures.append("motion_phase_width_or_axis_mismatch")
     if normalized_encodings != {axis: "sequential" for axis in EXPECTED_FSM_AXES}:
     if normalized_encodings != {axis: "sequential" for axis in EXPECTED_FSM_AXES}:
@@ -2101,12 +2131,14 @@ def structural_fsm_gate(
     )
     )
     for encoding in reencoded:
     for encoding in reencoded:
         failures.append(f"motion_phase_reencoded:{encoding.casefold()}")
         failures.append(f"motion_phase_reencoded:{encoding.casefold()}")
+    failures.extend(f"td_report:{failure}" for failure in reported_failures)
     return {
     return {
         "status": "pass" if not failures else "fail",
         "status": "pass" if not failures else "fail",
         "encoding": "sequential" if not failures else None,
         "encoding": "sequential" if not failures else None,
         "axes": normalized_axes,
         "axes": normalized_axes,
         "td_log_marker": marker_seen,
         "td_log_marker": marker_seen,
         "reencoded_motion_phase_count": len(reencoded),
         "reencoded_motion_phase_count": len(reencoded),
+        "reported_failures": reported_failures,
         "failures": failures,
         "failures": failures,
     }
     }