Skip to content

Commit fccd14e

Browse files
committedOct 11, 2017
xilinx: multireg async path constraint
1 parent 5ebd113 commit fccd14e

File tree

3 files changed

+18
-0
lines changed

3 files changed

+18
-0
lines changed
 

‎migen/build/xilinx/common.py

+6
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,12 @@ def settings(path, ver=None, sub=None):
6363
class XilinxMultiRegImpl(MultiRegImpl):
6464
def __init__(self, *args, **kwargs):
6565
MultiRegImpl.__init__(self, *args, **kwargs)
66+
i = self.i
67+
if not hasattr(i, "attr"):
68+
i0, i = i, Signal()
69+
self.comb += i.eq(i0)
70+
i.attr.add("mr_false_path")
71+
self.regs[0].attr.add("mr_ff")
6672
for r in self.regs:
6773
r.attr.add("async_reg")
6874
r.attr.add("no_shreg_extract")

‎migen/build/xilinx/ise.py

+2
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,8 @@ class XilinxISEToolchain:
129129
"keep": ("keep", "true"),
130130
"no_retiming": ("register_balancing", "no"),
131131
"async_reg": None,
132+
"mr_ff": None,
133+
"mr_false_path": None,
132134
"ars_ff1": None,
133135
"ars_ff2": None,
134136
"ars_false_path": None,

‎migen/build/xilinx/vivado.py

+10
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ class XilinxVivadoToolchain:
7575
"keep": ("dont_touch", "true"),
7676
"no_retiming": ("dont_touch", "true"),
7777
"async_reg": ("async_reg", "true"),
78+
"mr_ff": ("mr_ff", "true"), # user-defined attribute
79+
"mr_false_path": ("mr_false_path", "true"), # user-defined attribute
7880
"ars_ff1": ("ars_ff1", "true"), # user-defined attribute
7981
"ars_ff2": ("ars_ff2", "true"), # user-defined attribute
8082
"ars_false_path": ("ars_false_path", "true"), # user-defined attribute
@@ -91,6 +93,8 @@ def __init__(self):
9193

9294
def _build_batch(self, platform, sources, build_name):
9395
tcl = []
96+
tcl.append("create_property -type bool mr_ff cell")
97+
tcl.append("create_property -type bool mr_false_path net")
9498
tcl.append("create_property -type bool ars_ff1 cell")
9599
tcl.append("create_property -type bool ars_ff2 cell")
96100
tcl.append("create_property -type bool ars_false_path net")
@@ -155,6 +159,12 @@ def _convert_clocks(self, platform):
155159
del self.false_paths
156160

157161
def _constrain(self, platform):
162+
# The asynchronous input to a MultiReg is a false path
163+
platform.add_platform_command(
164+
"set_false_path -quiet "
165+
"-through [get_nets -hier -filter mr_false_path] "
166+
"-to [get_cells -hier -filter mr_ff]"
167+
)
158168
# The asychronous reset input to the AsyncResetSynchronizer is a false
159169
# path
160170
platform.add_platform_command(

0 commit comments

Comments
 (0)
Please sign in to comment.