Просмотр исходного кода

fix(td): keep cdc paths out of exported gate db

Codex Resource Selftest 4 месяцев назад
Родитель
Сommit
0dd75dc162
2 измененных файлов с 19 добавлено и 2 удалено
  1. 7 2
      td/syn/prod2u_p4_normal_v3.tcl
  2. 12 0
      tests/unit/test_prod2u_p4_normal_v3_td_files.py

+ 7 - 2
td/syn/prod2u_p4_normal_v3.tcl

@@ -77,6 +77,7 @@ set cdc_input_pairs {
     temp_scl u_temperature_i2c/scl_sync[0]
     temp_sda u_temperature_i2c/sda_sync[0]
 }
+set cdc_false_path_pairs {}
 foreach {source_port normalized} $cdc_input_pairs {
     set source_matches [get_ports -quiet $source_port]
     if {[llength $source_matches] != 1} {
@@ -88,7 +89,7 @@ foreach {source_port normalized} $cdc_input_pairs {
     set source [lindex $source_matches 0]
     if {[info exists cdc_actual_by_normalized($normalized)]} {
         set endpoint $cdc_actual_by_normalized($normalized)
-        set_false_path -from $source -to $endpoint
+        lappend cdc_false_path_pairs [list $source $endpoint]
         puts $cdc_report "false_path_endpoint=$normalized"
     } else {
         set reason "first_stage_endpoint_count:$source_port:$normalized:0"
@@ -149,6 +150,10 @@ if {[llength $fsm_failures] == 0} {
 report_area -io_info -file prod2u_p4_normal_v3_gate.area
 report_qor -step gate -file prod2u_p4_normal_v3_gate.qor
 legalize_phy_inst
+export_db prod2u_p4_normal_v3_gate.db
+foreach cdc_false_path_pair $cdc_false_path_pairs {
+    lassign $cdc_false_path_pair source endpoint
+    set_false_path -from $source -to $endpoint
+}
 update_timing
 report_timing_summary -file prod2u_p4_normal_v3_gate.timing
-export_db prod2u_p4_normal_v3_gate.db

+ 12 - 0
tests/unit/test_prod2u_p4_normal_v3_td_files.py

@@ -83,6 +83,18 @@ class Prod2UP4NormalV3TDFilesTests(unittest.TestCase):
             ):
                 self.assertNotIn(forbidden, source)
 
+    def test_syn_exports_gate_db_before_applying_cdc_false_paths(self) -> None:
+        syn = (ROOT / "td" / "syn" / f"{STEM}.tcl").read_text(encoding="ascii")
+        phy = (ROOT / "td" / "phy" / f"{STEM}.tcl").read_text(encoding="ascii")
+        false_path = "set_false_path -from $source -to $endpoint"
+        gate_export = f"export_db {STEM}_gate.db"
+
+        self.assertEqual(syn.count(false_path), 1)
+        self.assertLess(syn.index(gate_export), syn.index(false_path))
+        self.assertEqual(phy.count(false_path), 1)
+        self.assertLess(phy.index(f"import_db ../syn/{STEM}_gate.db"), phy.index(false_path))
+        self.assertLess(phy.index(false_path), phy.index("\nplace\n"))
+
     def test_adc_uses_43_unique_pads_and_verified_temperature_balls(self) -> None:
         adc = (ROOT / "constraints" / f"{STEM}.adc").read_text(encoding="ascii")
         rows = re.findall(