Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vendor._gowin: fix clock name quotes for Gowin IDE [0.5 backport] #1503

Merged
merged 1 commit into from
Sep 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions amaranth/vendor/_gowin.py
Original file line number Diff line number Diff line change
Expand Up @@ -437,13 +437,15 @@ def _osc_div(self):
file delete -force {{name}}.fs
file copy -force impl/pnr/project.fs {{name}}.fs
""",
# Gowin is using neither Tcl nor the Synopsys code to parse SDC files, so the grammar
# deviates from the usual (eg. no quotes, no nested braces).
"{{name}}.sdc": r"""
// {{autogenerated}}
{% for signal, frequency in platform.iter_signal_clock_constraints() -%}
create_clock -name {{signal.name|tcl_quote}} -period {{1000000000/frequency}} [get_nets {{signal|hierarchy("/")|tcl_quote}}]
create_clock -name {{ "{" }}{{signal.name}}{{ "}" }} -period {{1000000000/frequency}} [get_nets {{signal|hierarchy("/")|tcl_quote}}]
{% endfor %}
{% for port, frequency in platform.iter_port_clock_constraints() -%}
create_clock -name {{port.name|tcl_quote}} -period {{1000000000/frequency}} [get_ports
create_clock -name {{ "{" }}{{port.name}}{{ "}" }} -period {{1000000000/frequency}} [get_ports
{{ "{" }}{{port.name}}{{ "}" }}]
{% endfor %}
{{get_override("add_constraints")|default("// (add_constraints placeholder)")}}
Expand Down