Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Kestrel Collaboration
Kestrel LiteX
migen
Commits
1e90a659
Commit
1e90a659
authored
8 years ago
by
Sebastien Bourdeauducq
Browse files
Options
Download
Email Patches
Plain Diff
vivado: ensure period constraints are present on false path clocks
parent
3bc42058
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
14 deletions
+10
-14
migen/build/xilinx/vivado.py
migen/build/xilinx/vivado.py
+10
-14
No files found.
migen/build/xilinx/vivado.py
View file @
1e90a659
...
@@ -122,18 +122,18 @@ class XilinxVivadoToolchain:
...
@@ -122,18 +122,18 @@ class XilinxVivadoToolchain:
def
_convert_clocks
(
self
,
platform
):
def
_convert_clocks
(
self
,
platform
):
for
clk
,
period
in
sorted
(
self
.
clocks
.
items
(),
key
=
lambda
x
:
x
[
0
].
duid
):
for
clk
,
period
in
sorted
(
self
.
clocks
.
items
(),
key
=
lambda
x
:
x
[
0
].
duid
):
if
period
is
None
:
platform
.
add_platform_command
(
platform
.
add_platform_command
(
"create_clock -name {clk} -period "
+
str
(
period
)
+
"create_clock -name {clk} [get_nets {clk}]"
,
clk
=
clk
)
" [get_nets {clk}]"
,
clk
=
clk
)
else
:
platform
.
add_platform_command
(
"create_clock -name {clk} -period "
+
str
(
period
)
+
" [get_nets {clk}]"
,
clk
=
clk
)
for
from_
,
to
in
sorted
(
self
.
false_paths
,
for
from_
,
to
in
sorted
(
self
.
false_paths
,
key
=
lambda
x
:
(
x
[
0
].
duid
,
x
[
1
].
duid
)):
key
=
lambda
x
:
(
x
[
0
].
duid
,
x
[
1
].
duid
)):
if
(
from_
not
in
self
.
clocks
or
to
not
in
self
.
clocks
):
raise
ValueError
(
"Vivado requires period "
"constraints on all clocks used in false paths"
)
platform
.
add_platform_command
(
platform
.
add_platform_command
(
"set_false_path -from [get_clocks {from_}] -to [get_clocks {to}]"
,
"set_false_path -from [get_clocks {from_}] -to [get_clocks {to}]"
,
from_
=
from_
,
to
=
to
)
from_
=
from_
,
to
=
to
)
# make sure add_*_constraint cannot be used again
# make sure add_*_constraint cannot be used again
del
self
.
clocks
del
self
.
clocks
...
@@ -164,13 +164,9 @@ class XilinxVivadoToolchain:
...
@@ -164,13 +164,9 @@ class XilinxVivadoToolchain:
return
v_output
.
ns
return
v_output
.
ns
def
add_period_constraint
(
self
,
platform
,
clk
,
period
):
def
add_period_constraint
(
self
,
platform
,
clk
,
period
):
if
self
.
clocks
.
get
(
clk
,
None
)
is
not
None
:
if
clk
in
self
.
clocks
:
raise
ValueError
(
"A period constraint already exists"
)
raise
ValueError
(
"A period constraint already exists"
)
self
.
clocks
[
clk
]
=
period
self
.
clocks
[
clk
]
=
period
def
add_false_path_constraint
(
self
,
platform
,
from_
,
to
):
def
add_false_path_constraint
(
self
,
platform
,
from_
,
to
):
if
from_
not
in
self
.
clocks
:
self
.
clocks
[
from_
]
=
None
if
to
not
in
self
.
clocks
:
self
.
clocks
[
to
]
=
None
self
.
false_paths
.
add
((
from_
,
to
))
self
.
false_paths
.
add
((
from_
,
to
))
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment