mibuild/platforms: use add_period_constraint

This commit is contained in:
Florent Kermarrec 2014-05-19 12:03:26 +02:00 committed by Sebastien Bourdeauducq
parent a1a57fd962
commit 518a6822d9
7 changed files with 27 additions and 53 deletions

View file

@ -92,4 +92,10 @@ _io = [
class Platform(AlteraQuartusPlatform):
def __init__(self):
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

View file

@ -115,22 +115,17 @@ CONFIG VCCAUX = "3.3";
def do_finalize(self, fragment):
try:
self.add_platform_command("""
NET "{clk_y3}" TNM_NET = "GRPclky3";
TIMESPEC "TSclky3" = PERIOD "GRPclky3" 10 ns HIGH 50%;
""", clk_y3=self.lookup_request("clk_y3"))
self.add_period_constraint(self.lookup_request("clk_y3"), 10)
except ConstraintError:
pass
try:
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("""
NET "{phy_rx_clk}" TNM_NET = "GRPphy_rx_clk";
NET "{phy_tx_clk}" TNM_NET = "GRPphy_tx_clk";
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;
TIMESPEC "TS{phy_tx_clk}_io" = FROM "GRP{phy_tx_clk}" TO "PADS" 10 ns;
TIMESPEC "TS{phy_rx_clk}_io" = FROM "PADS" TO "GRP{phy_rx_clk}" 10 ns;
""", phy_rx_clk=eth_clocks.rx, phy_tx_clk=eth_clocks.tx)
except ContraintError:
pass

View file

@ -123,22 +123,17 @@ class Platform(XilinxISEPlatform):
def do_finalize(self, fragment):
try:
self.add_platform_command("""
NET "{clk50}" TNM_NET = "GRPclk50";
TIMESPEC "TSclk50" = PERIOD "GRPclk50" 20 ns HIGH 50%;
""", clk50=self.lookup_request("clk50"))
self.add_period_constraint(self.lookup_request("clk50"), 20)
except ConstraintError:
pass
try:
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("""
NET "{phy_rx_clk}" TNM_NET = "GRPphy_rx_clk";
NET "{phy_tx_clk}" TNM_NET = "GRPphy_tx_clk";
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;
TIMESPEC "TS{phy_tx_clk}_io" = FROM "GRP{phy_tx_clk}" TO "PADS" 10 ns;
TIMESPEC "TS{phy_rx_clk}_io" = FROM "PADS" TO "GRP{phy_rx_clk}" 10 ns;
""", phy_rx_clk=eth_clocks.rx, phy_tx_clk=eth_clocks.tx)
except ConstraintError:
pass
@ -146,10 +141,6 @@ TIMESPEC "TSphy_rx_clk_io" = FROM "PADS" TO "GRPphy_rx_clk" 10 ns;
for i in range(2):
si = "dviclk"+str(i)
try:
self.add_platform_command("""
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)
self.add_period_constraint(self.lookup_request("dvi_in", i).clk, 26.7)
except ConstraintError:
pass

View file

@ -160,32 +160,23 @@ class Platform(XilinxISEPlatform):
def do_finalize(self, fragment):
try:
self.add_platform_command("""
NET "{clk50}" TNM_NET = "GRPclk50";
TIMESPEC "TSclk50" = PERIOD "GRPclk50" 20 ns HIGH 50%;
""", clk50=self.lookup_request("clk50"))
self.add_period_constraint(self.lookup_request("clk50"), 20)
except ConstraintError:
pass
try:
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("""
NET "{phy_rx_clk}" TNM_NET = "GRPphy_rx_clk";
NET "{phy_tx_clk}" TNM_NET = "GRPphy_tx_clk";
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;
TIMESPEC "TS{phy_tx_clk}_io" = FROM "GRP{phy_tx_clk}" TO "PADS" 10 ns;
TIMESPEC "TS{phy_rx_clk}_io" = FROM "PADS" TO "GRP{phy_rx_clk}" 10 ns;
""", phy_rx_clk=eth_clocks.rx, phy_tx_clk=eth_clocks.tx)
except ConstraintError:
pass
for i in range(4):
si = "dviclk"+str(i)
try:
self.add_platform_command("""
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)
self.add_period_constraint(self.lookup_request("dvi_in", i).clk_p, 12)
except ConstraintError:
pass

View file

@ -54,9 +54,6 @@ class Platform(XilinxISEPlatform):
def do_finalize(self, fragment):
try:
self.add_platform_command("""
NET "{clk32}" TNM_NET = "GRPclk32";
TIMESPEC "TSclk32" = PERIOD "GRPclk32" 31.25 ns HIGH 50%;
""", clk32=self.lookup_request("clk32"))
self.add_period_constraint(self.lookup_request("clk32"), 31.25)
except ConstraintError:
pass

View file

@ -143,9 +143,6 @@ class Platform(XilinxISEPlatform):
def do_finalize(self, fragment):
try:
self.add_platform_command("""
NET "{clk100}" TNM_NET = "GRPclk100";
TIMESPEC "TSclk100" = PERIOD "GRPclk100" 10 ns HIGH 50%;
""", clk100=self.lookup_request("clk100"))
self.add_period_constraint(self.lookup_request("clk100"), 10)
except ConstraintError:
pass

View file

@ -90,10 +90,7 @@ CONFIG VCCAUX = "2.5";
def do_finalize(self, fragment):
try:
self.add_platform_command("""
NET "{clk_if}" TNM_NET = "GRPclkif";
TIMESPEC "TSclkif" = PERIOD "GRPclkif" 20 ns HIGH 50%;
""", clk_if=self.lookup_request("clk_if"))
self.add_period_constraint(self.lookup_request("clk_if"), 20)
except ConstraintError:
pass