Skip to content

Commit ed0bd91

Browse files
vendor._lattice: Add clock constraints to oxide .pdc template.
1 parent d2b2c9b commit ed0bd91

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

amaranth/vendor/_lattice.py

+7
Original file line numberDiff line numberDiff line change
@@ -527,6 +527,13 @@ class LatticePlatform(TemplatedPlatform):
527527
ldc_set_port -iobuf {{ '{' }}{%- for key, value in attrs.items() %}{{key}}={{value}} {% endfor %}{{ '}' }} {{'['}}get_ports {{port_name}}{{']'}}
528528
{% endif %}
529529
{% endfor %}
530+
{% for net_signal, port_signal, frequency in platform.iter_clock_constraints() -%}
531+
{% if port_signal is not none -%}
532+
create_clock -name {{port_signal.name|tcl_quote}} -period {{1000000000/frequency}} [get_ports {{port_signal.name|tcl_quote}}]
533+
{% else -%}
534+
create_clock -name {{net_signal.name|tcl_quote}} -period {{1000000000/frequency}} [get_nets {{net_signal|hierarchy("/")|tcl_quote}}]
535+
{% endif %}
536+
{% endfor %}
530537
{{get_override("add_preferences")|default("# (add_preferences placeholder)")}}
531538
"""
532539
}

0 commit comments

Comments
 (0)