vendor.lattice_{ecp5,ice40}: allow clock constraints on arbitrary signals.

Fixes #88.
This commit is contained in:
whitequark 2019-09-20 16:11:01 +00:00
parent 378e924280
commit 91ef2f58e3
2 changed files with 3 additions and 3 deletions

View file

@ -121,7 +121,7 @@ class LatticeECP5Platform(TemplatedPlatform):
{%- for key, value in extras.items() %} {{key}}={{value}}{% endfor %}; {%- for key, value in extras.items() %} {{key}}={{value}}{% endfor %};
{% endfor %} {% endfor %}
{% for signal, frequency in platform.iter_clock_constraints() -%} {% for signal, frequency in platform.iter_clock_constraints() -%}
FREQUENCY PORT "{{signal.name}}" {{frequency}} HZ; FREQUENCY NET "{{signal|hierarchy(".")}}" {{frequency}} HZ;
{% endfor %} {% endfor %}
""" """
} }
@ -203,7 +203,7 @@ class LatticeECP5Platform(TemplatedPlatform):
{%- for key, value in extras.items() %} {{key}}={{value}}{% endfor %}; {%- for key, value in extras.items() %} {{key}}={{value}}{% endfor %};
{% endfor %} {% endfor %}
{% for signal, frequency in platform.iter_clock_constraints() -%} {% for signal, frequency in platform.iter_clock_constraints() -%}
FREQUENCY PORT "{{signal.name}}" {{frequency/1000000}} MHZ; FREQUENCY NET "{{signal|hierarchy("/")}}" {{frequency/1000000}} MHZ;
{% endfor %} {% endfor %}
{{get_override("add_preferences")|default("# (add_preferences placeholder)")}} {{get_override("add_preferences")|default("# (add_preferences placeholder)")}}
""", """,

View file

@ -97,7 +97,7 @@ class LatticeICE40Platform(TemplatedPlatform):
# {{autogenerated}} # {{autogenerated}}
{% for signal, frequency in platform.iter_clock_constraints() -%} {% for signal, frequency in platform.iter_clock_constraints() -%}
{# Clock in MHz #} {# Clock in MHz #}
ctx.addClock("{{signal.name}}", {{frequency/1000000}}) ctx.addClock("{{signal|hierarchy(".")}}", {{frequency/1000000}})
{% endfor%} {% endfor%}
""", """,
} }