Explorar o código

fix: load timing constraints after synthesis

Codex Resource Selftest hai 4 meses
pai
achega
185ba96e8d

+ 0 - 1
td/phy/prod2u_p4_normal_v3.tcl

@@ -1,6 +1,5 @@
 import_device ef2_4.db -package EF2L45BG256B
 import_device ef2_4.db -package EF2L45BG256B
 import_db ../syn/prod2u_p4_normal_v3_gate.db
 import_db ../syn/prod2u_p4_normal_v3_gate.db
-create_clock -name sys_clk -period 40 -waveform {0 20} [get_ports {sys_clk}]
 
 
 proc p4_find_unique_regs {patterns} {
 proc p4_find_unique_regs {patterns} {
     set matches {}
     set matches {}

+ 1 - 1
td/syn/prod2u_p4_normal_v3.tcl

@@ -22,8 +22,8 @@ analyze -file {src/top/prod2u_p4_normal_v3_top.v}
 
 
 elaborate -top {prod2u_p4_normal_v3_top}
 elaborate -top {prod2u_p4_normal_v3_top}
 read_adc {constraints/prod2u_p4_normal_v3.adc}
 read_adc {constraints/prod2u_p4_normal_v3.adc}
-read_sdc {constraints/prod2u_p4_normal_v3.sdc}
 optimize_rtl
 optimize_rtl
+read_sdc {constraints/prod2u_p4_normal_v3.sdc}
 
 
 proc p4_find_unique_regs {patterns} {
 proc p4_find_unique_regs {patterns} {
     set matches {}
     set matches {}

+ 2 - 4
tests/unit/test_new_cdc_structure.py

@@ -42,15 +42,13 @@ class NewCdcStructureTests(unittest.TestCase):
         phy = (ROOT / "td/phy/prod2u_p4_normal_v3.tcl").read_text(encoding="ascii")
         phy = (ROOT / "td/phy/prod2u_p4_normal_v3.tcl").read_text(encoding="ascii")
         self.assertNotIn("read_adc", phy)
         self.assertNotIn("read_adc", phy)
         self.assertNotIn("read_sdc", phy)
         self.assertNotIn("read_sdc", phy)
-        self.assertIn(
-            "create_clock -name sys_clk -period 40 -waveform {0 20} [get_ports {sys_clk}]",
-            phy,
-        )
+        self.assertNotIn("create_clock", phy)
 
 
     def test_syn_loads_the_clock_constraint_once_for_the_exported_db(self):
     def test_syn_loads_the_clock_constraint_once_for_the_exported_db(self):
         syn = (ROOT / "td/syn/prod2u_p4_normal_v3.tcl").read_text(encoding="ascii")
         syn = (ROOT / "td/syn/prod2u_p4_normal_v3.tcl").read_text(encoding="ascii")
         self.assertIn("read_sdc {constraints/prod2u_p4_normal_v3.sdc}", syn)
         self.assertIn("read_sdc {constraints/prod2u_p4_normal_v3.sdc}", syn)
         self.assertNotIn("create_clock -name sys_clk", syn)
         self.assertNotIn("create_clock -name sys_clk", syn)
+        self.assertLess(syn.index("optimize_rtl"), syn.index("read_sdc"))
 
 
     def test_project_adapter_receives_compile_time_project_counts(self):
     def test_project_adapter_receives_compile_time_project_counts(self):
         adapter = (ROOT / "src/project/project_adapter.v").read_text(encoding="utf-8")
         adapter = (ROOT / "src/project/project_adapter.v").read_text(encoding="utf-8")