Skip to content

Commit

Permalink
vendor._lattice: Add clock constraints to oxide .pdc template.
Browse files Browse the repository at this point in the history
  • Loading branch information
polymerizedsage committed Apr 19, 2024
1 parent dde8334 commit 43cd939
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions amaranth/vendor/_lattice.py
Original file line number Diff line number Diff line change
Expand Up @@ -527,6 +527,13 @@ class LatticePlatform(TemplatedPlatform):
ldc_set_port -iobuf {{ '{' }}{%- for key, value in attrs.items() %}{{key}}={{value}} {% endfor %}{{ '}' }} {{'['}}get_ports {{port_name}}{{']'}}
{% endif %}
{% endfor %}
{% for net_signal, port_signal, frequency in platform.iter_clock_constraints() -%}
{% if port_signal is not none -%}
create_clock -name {{port_signal.name|tcl_quote}} -period {{1000000000/frequency}} [get_ports {{port_signal.name|tcl_quote}}]
{% else -%}
create_clock -name {{net_signal.name|tcl_quote}} -period {{1000000000/frequency}} [get_nets {{net_signal|hierarchy("/")|tcl_quote}}]
{% endif %}
{% endfor %}
{{get_override("add_preferences")|default("# (add_preferences placeholder)")}}
"""
}
Expand Down

0 comments on commit 43cd939

Please sign in to comment.