From: whitequark Date: Wed, 21 Aug 2019 17:51:46 +0000 (+0000) Subject: versa_ecp5: prepare for switchable ECP5 toolchains. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f563844c7f35a6ed0ab1aa4609205e01a439d8ef;p=nmigen-boards.git versa_ecp5: prepare for switchable ECP5 toolchains. --- diff --git a/nmigen_boards/versa_ecp5.py b/nmigen_boards/versa_ecp5.py index e20f8cc..fdb79c0 100644 --- a/nmigen_boards/versa_ecp5.py +++ b/nmigen_boards/versa_ecp5.py @@ -146,28 +146,30 @@ class VersaECP5Platform(LatticeECP5Platform): """), # X4 ] - file_templates = { - **LatticeECP5Platform.file_templates, - "{{name}}-openocd.cfg": r""" - interface ftdi - {# FTDI descriptors is identical between non-5G and 5G recent Versa boards #} - ftdi_device_desc "Lattice ECP5_5G VERSA Board" - ftdi_vid_pid 0x0403 0x6010 - ftdi_channel 0 - ftdi_layout_init 0xfff8 0xfffb - reset_config none - adapter_khz 25000 - - # ispCLOCK device (unusable with openocd and must be bypassed) - #jtag newtap ispclock tap -irlen 8 -expected-id 0x00191043 - # ECP5 device - {% if "5G" in platform.device -%} - jtag newtap ecp5 tap -irlen 8 -expected-id 0x81112043 ; # LFE5UM5G-45F - {% else -%} - jtag newtap ecp5 tap -irlen 8 -expected-id 0x01112043 ; # LFE5UM-45F - {% endif %} - """ - } + @property + def file_templates(self): + return { + **super().file_templates, + "{{name}}-openocd.cfg": r""" + interface ftdi + {# FTDI descriptors is identical between non-5G and 5G recent Versa boards #} + ftdi_device_desc "Lattice ECP5_5G VERSA Board" + ftdi_vid_pid 0x0403 0x6010 + ftdi_channel 0 + ftdi_layout_init 0xfff8 0xfffb + reset_config none + adapter_khz 25000 + + # ispCLOCK device (unusable with openocd and must be bypassed) + #jtag newtap ispclock tap -irlen 8 -expected-id 0x00191043 + # ECP5 device + {% if "5G" in platform.device -%} + jtag newtap ecp5 tap -irlen 8 -expected-id 0x81112043 ; # LFE5UM5G-45F + {% else -%} + jtag newtap ecp5 tap -irlen 8 -expected-id 0x01112043 ; # LFE5UM-45F + {% endif %} + """ + } def toolchain_program(self, products, name): openocd = os.environ.get("OPENOCD", "openocd")