mirror of
https://github.com/enjoy-digital/litex.git
synced 2025-01-04 09:52:26 -05:00
mibuild/platforms: use add_period_constraint
This commit is contained in:
parent
a1a57fd962
commit
518a6822d9
7 changed files with 27 additions and 53 deletions
|
@ -92,4 +92,10 @@ _io = [
|
||||||
class Platform(AlteraQuartusPlatform):
|
class Platform(AlteraQuartusPlatform):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
AlteraQuartusPlatform.__init__(self, "EP4CE22F17C6", _io,
|
AlteraQuartusPlatform.__init__(self, "EP4CE22F17C6", _io,
|
||||||
lambda p: CRG_SE(p, "clk50", "key", 20.0, True))
|
lambda p: CRG_SE(p, "clk50", None))
|
||||||
|
|
||||||
|
def do_finalize(self, fragment):
|
||||||
|
try:
|
||||||
|
self.add_period_constraint(self.lookup_request("clk50"), 20)
|
||||||
|
except ConstraintError:
|
||||||
|
pass
|
||||||
|
|
|
@ -115,22 +115,17 @@ CONFIG VCCAUX = "3.3";
|
||||||
|
|
||||||
def do_finalize(self, fragment):
|
def do_finalize(self, fragment):
|
||||||
try:
|
try:
|
||||||
self.add_platform_command("""
|
self.add_period_constraint(self.lookup_request("clk_y3"), 10)
|
||||||
NET "{clk_y3}" TNM_NET = "GRPclky3";
|
|
||||||
TIMESPEC "TSclky3" = PERIOD "GRPclky3" 10 ns HIGH 50%;
|
|
||||||
""", clk_y3=self.lookup_request("clk_y3"))
|
|
||||||
except ConstraintError:
|
except ConstraintError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
try:
|
try:
|
||||||
eth_clocks = self.lookup_request("eth_clocks")
|
eth_clocks = self.lookup_request("eth_clocks")
|
||||||
|
self.add_period_constraint(eth_clocks.rx, 40)
|
||||||
|
self.add_period_constraint(eth_clocks.tx, 40)
|
||||||
self.add_platform_command("""
|
self.add_platform_command("""
|
||||||
NET "{phy_rx_clk}" TNM_NET = "GRPphy_rx_clk";
|
TIMESPEC "TS{phy_tx_clk}_io" = FROM "GRP{phy_tx_clk}" TO "PADS" 10 ns;
|
||||||
NET "{phy_tx_clk}" TNM_NET = "GRPphy_tx_clk";
|
TIMESPEC "TS{phy_rx_clk}_io" = FROM "PADS" TO "GRP{phy_rx_clk}" 10 ns;
|
||||||
TIMESPEC "TSphy_rx_clk" = PERIOD "GRPphy_rx_clk" 40 ns HIGH 50%;
|
|
||||||
TIMESPEC "TSphy_tx_clk" = PERIOD "GRPphy_tx_clk" 40 ns HIGH 50%;
|
|
||||||
TIMESPEC "TSphy_tx_clk_io" = FROM "GRPphy_tx_clk" TO "PADS" 10 ns;
|
|
||||||
TIMESPEC "TSphy_rx_clk_io" = FROM "PADS" TO "GRPphy_rx_clk" 10 ns;
|
|
||||||
""", phy_rx_clk=eth_clocks.rx, phy_tx_clk=eth_clocks.tx)
|
""", phy_rx_clk=eth_clocks.rx, phy_tx_clk=eth_clocks.tx)
|
||||||
except ContraintError:
|
except ContraintError:
|
||||||
pass
|
pass
|
||||||
|
|
|
@ -123,22 +123,17 @@ class Platform(XilinxISEPlatform):
|
||||||
|
|
||||||
def do_finalize(self, fragment):
|
def do_finalize(self, fragment):
|
||||||
try:
|
try:
|
||||||
self.add_platform_command("""
|
self.add_period_constraint(self.lookup_request("clk50"), 20)
|
||||||
NET "{clk50}" TNM_NET = "GRPclk50";
|
|
||||||
TIMESPEC "TSclk50" = PERIOD "GRPclk50" 20 ns HIGH 50%;
|
|
||||||
""", clk50=self.lookup_request("clk50"))
|
|
||||||
except ConstraintError:
|
except ConstraintError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
try:
|
try:
|
||||||
eth_clocks = self.lookup_request("eth_clocks")
|
eth_clocks = self.lookup_request("eth_clocks")
|
||||||
|
self.add_period_constraint(eth_clocks.rx, 40)
|
||||||
|
self.add_period_constraint(eth_clocks.tx, 40)
|
||||||
self.add_platform_command("""
|
self.add_platform_command("""
|
||||||
NET "{phy_rx_clk}" TNM_NET = "GRPphy_rx_clk";
|
TIMESPEC "TS{phy_tx_clk}_io" = FROM "GRP{phy_tx_clk}" TO "PADS" 10 ns;
|
||||||
NET "{phy_tx_clk}" TNM_NET = "GRPphy_tx_clk";
|
TIMESPEC "TS{phy_rx_clk}_io" = FROM "PADS" TO "GRP{phy_rx_clk}" 10 ns;
|
||||||
TIMESPEC "TSphy_rx_clk" = PERIOD "GRPphy_rx_clk" 40 ns HIGH 50%;
|
|
||||||
TIMESPEC "TSphy_tx_clk" = PERIOD "GRPphy_tx_clk" 40 ns HIGH 50%;
|
|
||||||
TIMESPEC "TSphy_tx_clk_io" = FROM "GRPphy_tx_clk" TO "PADS" 10 ns;
|
|
||||||
TIMESPEC "TSphy_rx_clk_io" = FROM "PADS" TO "GRPphy_rx_clk" 10 ns;
|
|
||||||
""", phy_rx_clk=eth_clocks.rx, phy_tx_clk=eth_clocks.tx)
|
""", phy_rx_clk=eth_clocks.rx, phy_tx_clk=eth_clocks.tx)
|
||||||
except ConstraintError:
|
except ConstraintError:
|
||||||
pass
|
pass
|
||||||
|
@ -146,10 +141,6 @@ TIMESPEC "TSphy_rx_clk_io" = FROM "PADS" TO "GRPphy_rx_clk" 10 ns;
|
||||||
for i in range(2):
|
for i in range(2):
|
||||||
si = "dviclk"+str(i)
|
si = "dviclk"+str(i)
|
||||||
try:
|
try:
|
||||||
self.add_platform_command("""
|
self.add_period_constraint(self.lookup_request("dvi_in", i).clk, 26.7)
|
||||||
NET "{dviclk}" TNM_NET = "GRP"""+si+"""";
|
|
||||||
NET "{dviclk}" CLOCK_DEDICATED_ROUTE = FALSE;
|
|
||||||
TIMESPEC "TS"""+si+"""" = PERIOD "GRP"""+si+"""" 26.7 ns HIGH 50%;
|
|
||||||
""", dviclk=self.lookup_request("dvi_in", i).clk)
|
|
||||||
except ConstraintError:
|
except ConstraintError:
|
||||||
pass
|
pass
|
||||||
|
|
|
@ -160,32 +160,23 @@ class Platform(XilinxISEPlatform):
|
||||||
|
|
||||||
def do_finalize(self, fragment):
|
def do_finalize(self, fragment):
|
||||||
try:
|
try:
|
||||||
self.add_platform_command("""
|
self.add_period_constraint(self.lookup_request("clk50"), 20)
|
||||||
NET "{clk50}" TNM_NET = "GRPclk50";
|
|
||||||
TIMESPEC "TSclk50" = PERIOD "GRPclk50" 20 ns HIGH 50%;
|
|
||||||
""", clk50=self.lookup_request("clk50"))
|
|
||||||
except ConstraintError:
|
except ConstraintError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
try:
|
try:
|
||||||
eth_clocks = self.lookup_request("eth_clocks")
|
eth_clocks = self.lookup_request("eth_clocks")
|
||||||
|
self.add_period_constraint(eth_clocks.rx, 40)
|
||||||
|
self.add_period_constraint(eth_clocks.tx, 40)
|
||||||
self.add_platform_command("""
|
self.add_platform_command("""
|
||||||
NET "{phy_rx_clk}" TNM_NET = "GRPphy_rx_clk";
|
TIMESPEC "TS{phy_tx_clk}_io" = FROM "GRP{phy_tx_clk}" TO "PADS" 10 ns;
|
||||||
NET "{phy_tx_clk}" TNM_NET = "GRPphy_tx_clk";
|
TIMESPEC "TS{phy_rx_clk}_io" = FROM "PADS" TO "GRP{phy_rx_clk}" 10 ns;
|
||||||
TIMESPEC "TSphy_rx_clk" = PERIOD "GRPphy_rx_clk" 40 ns HIGH 50%;
|
|
||||||
TIMESPEC "TSphy_tx_clk" = PERIOD "GRPphy_tx_clk" 40 ns HIGH 50%;
|
|
||||||
TIMESPEC "TSphy_tx_clk_io" = FROM "GRPphy_tx_clk" TO "PADS" 10 ns;
|
|
||||||
TIMESPEC "TSphy_rx_clk_io" = FROM "PADS" TO "GRPphy_rx_clk" 10 ns;
|
|
||||||
""", phy_rx_clk=eth_clocks.rx, phy_tx_clk=eth_clocks.tx)
|
""", phy_rx_clk=eth_clocks.rx, phy_tx_clk=eth_clocks.tx)
|
||||||
except ConstraintError:
|
except ConstraintError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
for i in range(4):
|
for i in range(4):
|
||||||
si = "dviclk"+str(i)
|
|
||||||
try:
|
try:
|
||||||
self.add_platform_command("""
|
self.add_period_constraint(self.lookup_request("dvi_in", i).clk_p, 12)
|
||||||
NET "{dviclk}" TNM_NET = "GRP"""+si+"""";
|
|
||||||
TIMESPEC "TS"""+si+"""" = PERIOD "GRP"""+si+"""" 12.00 ns HIGH 50%;
|
|
||||||
""", dviclk=self.lookup_request("dvi_in", i).clk_p)
|
|
||||||
except ConstraintError:
|
except ConstraintError:
|
||||||
pass
|
pass
|
||||||
|
|
|
@ -54,9 +54,6 @@ class Platform(XilinxISEPlatform):
|
||||||
|
|
||||||
def do_finalize(self, fragment):
|
def do_finalize(self, fragment):
|
||||||
try:
|
try:
|
||||||
self.add_platform_command("""
|
self.add_period_constraint(self.lookup_request("clk32"), 31.25)
|
||||||
NET "{clk32}" TNM_NET = "GRPclk32";
|
|
||||||
TIMESPEC "TSclk32" = PERIOD "GRPclk32" 31.25 ns HIGH 50%;
|
|
||||||
""", clk32=self.lookup_request("clk32"))
|
|
||||||
except ConstraintError:
|
except ConstraintError:
|
||||||
pass
|
pass
|
||||||
|
|
|
@ -143,9 +143,6 @@ class Platform(XilinxISEPlatform):
|
||||||
|
|
||||||
def do_finalize(self, fragment):
|
def do_finalize(self, fragment):
|
||||||
try:
|
try:
|
||||||
self.add_platform_command("""
|
self.add_period_constraint(self.lookup_request("clk100"), 10)
|
||||||
NET "{clk100}" TNM_NET = "GRPclk100";
|
|
||||||
TIMESPEC "TSclk100" = PERIOD "GRPclk100" 10 ns HIGH 50%;
|
|
||||||
""", clk100=self.lookup_request("clk100"))
|
|
||||||
except ConstraintError:
|
except ConstraintError:
|
||||||
pass
|
pass
|
||||||
|
|
|
@ -90,10 +90,7 @@ CONFIG VCCAUX = "2.5";
|
||||||
|
|
||||||
def do_finalize(self, fragment):
|
def do_finalize(self, fragment):
|
||||||
try:
|
try:
|
||||||
self.add_platform_command("""
|
self.add_period_constraint(self.lookup_request("clk_if"), 20)
|
||||||
NET "{clk_if}" TNM_NET = "GRPclkif";
|
|
||||||
TIMESPEC "TSclkif" = PERIOD "GRPclkif" 20 ns HIGH 50%;
|
|
||||||
""", clk_if=self.lookup_request("clk_if"))
|
|
||||||
except ConstraintError:
|
except ConstraintError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue