From 88649defdad37c33fa0ac39e1b3df9b95c6305a2 Mon Sep 17 00:00:00 2001 From: whitequark Date: Sun, 13 Oct 2019 21:56:40 +0000 Subject: [PATCH] vendor.lattice_ice40: use pcf files instead of pre-pack Python scripts. This allows to use nextpnr-ice40 built without Python with nMigen. Requires nextpnr revision YosysHQ/nextpnr@8c0610e84fa6a38d3f351774bd81a32c96a91242 or newer. --- nmigen/vendor/lattice_ice40.py | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/nmigen/vendor/lattice_ice40.py b/nmigen/vendor/lattice_ice40.py index 20a844c..163b48e 100644 --- a/nmigen/vendor/lattice_ice40.py +++ b/nmigen/vendor/lattice_ice40.py @@ -126,19 +126,14 @@ class LatticeICE40Platform(TemplatedPlatform): {{get_override("script_after_synth")|default("# (script_after_synth placeholder)")}} write_json {{name}}.json """, - "{{name}}_pre_pack.py": r""" - # {{autogenerated}} - {% for signal, frequency in platform.iter_clock_constraints() -%} - {# Clock in MHz #} - ctx.addClock("{{signal|hierarchy(".")}}", {{frequency/1000000}}) - {% endfor%} - {{get_override("add_pre_pack")|default("# (add_pre_pack placeholder)")}} - """, "{{name}}.pcf": r""" # {{autogenerated}} {% for port_name, pin_name, attrs in platform.iter_port_constraints_bits() -%} set_io {{port_name}} {{pin_name}} {% endfor %} + {% for signal, frequency in platform.iter_clock_constraints() -%} + set_frequency "{{signal|hierarchy(".")}}" {{frequency/1000000}} + {% endfor%} {{get_override("add_constraints")|default("# (add_constraints placeholder)")}} """, } -- 2.30.2