From 4dea0b2d0f4d39b5aa4f5ceb1e7bc0c897b7fd66 Mon Sep 17 00:00:00 2001 From: Catherine Date: Sat, 12 Mar 2022 13:24:56 +0000 Subject: [PATCH] vendor.lattice_ecp5: on Diamond, only emit attributes if there are any. --- amaranth/vendor/lattice_ecp5.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/amaranth/vendor/lattice_ecp5.py b/amaranth/vendor/lattice_ecp5.py index 288296e..4d5cb7c 100644 --- a/amaranth/vendor/lattice_ecp5.py +++ b/amaranth/vendor/lattice_ecp5.py @@ -231,10 +231,12 @@ class LatticeECP5Platform(TemplatedPlatform): # {{autogenerated}} BLOCK ASYNCPATHS; BLOCK RESETPATHS; - {% for port_name, pin_name, extras in platform.iter_port_constraints_bits() -%} + {% for port_name, pin_name, attrs in platform.iter_port_constraints_bits() -%} LOCATE COMP "{{port_name}}" SITE "{{pin_name}}"; + {% if attrs -%} IOBUF PORT "{{port_name}}" - {%- for key, value in extras.items() %} {{key}}={{value}}{% endfor %}; + {%- for key, value in attrs.items() %} {{key}}={{value}}{% endfor %}; + {% endif %} {% endfor %} {{get_override("add_preferences")|default("# (add_preferences placeholder)")}} """,