boards/nexys_video: use ethernet constraints similar to kc705
authorFlorent Kermarrec <florent@enjoy-digital.fr>
Tue, 1 Dec 2015 10:50:05 +0000 (11:50 +0100)
committerFlorent Kermarrec <florent@enjoy-digital.fr>
Tue, 1 Dec 2015 10:50:05 +0000 (11:50 +0100)
litex/boards/platforms/nexys_video.py
litex/boards/targets/nexys_video.py

index 52fbc1c88ced15e4f63c8429f9d3df84894b5162..c42434e4457bbe8619f2c0514960883691972755 100644 (file)
@@ -150,3 +150,10 @@ class Platform(XilinxPlatform):
         else:
             raise ValueError("{} programmer is not supported"
                              .format(self.programmer))
+
+    def do_finalize(self, fragment):
+        XilinxPlatform.do_finalize(self, fragment)
+        try:
+            self.add_period_constraint(self.lookup_request("eth_clocks").rx, 8.0)
+        except ConstraintError:
+            pass
index 4704c9ce8f4fb7e9b03848678b4289ea1771a205..810f594da5f26c260ae266c4324c0615ef9b67cc 100644 (file)
@@ -99,22 +99,6 @@ class MiniSoC(BaseSoC):
         self.add_wb_slave(mem_decoder(self.mem_map["ethmac"]), self.ethmac.bus)
         self.add_memory_region("ethmac", self.mem_map["ethmac"] | self.shadow_base, 0x2000)
 
-        self.specials += [
-            Keep(self.ethphy.crg.cd_eth_rx.clk),
-            Keep(self.ethphy.crg.cd_eth_tx.clk)
-        ]
-        self.platform.add_platform_command("""
-create_clock -name sys_clk -period 10 [get_nets sys_clk]
-create_clock -name eth_rx_clk -period 8 [get_nets eth_clocks_tx]
-create_clock -name eth_tx_clk -period 8 [get_nets eth_clocks_rx]
-
-set_false_path -from [get_clocks eth_rx_clk] -to [get_clocks sys_clk]
-set_false_path -from [get_clocks sys_clk] -to [get_clocks eth_rx_clk]
-set_false_path -from [get_clocks eth_tx_clk] -to [get_clocks sys_clk]
-set_false_path -from [get_clocks sys_clk] -to [get_clocks eth_tx_clk]
-""")
-
-
 def main():
     parser = argparse.ArgumentParser(description="LiteX SoC port to Nexys Video")
     builder_args(parser)