aboutsummaryrefslogtreecommitdiff
path: root/nmigen_boards/versa_ecp5.py
diff options
context:
space:
mode:
authorwhitequark <whitequark@whitequark.org>2019-08-21 17:51:46 +0000
committerwhitequark <whitequark@whitequark.org>2019-08-21 18:45:19 +0000
commitf563844c7f35a6ed0ab1aa4609205e01a439d8ef (patch)
tree00d4c46c2c468eec455ea9932aba223faac8ab9f /nmigen_boards/versa_ecp5.py
parent7ccb0b17ba726b37da1591113495948e27f43acb (diff)
versa_ecp5: prepare for switchable ECP5 toolchains.
Diffstat (limited to 'nmigen_boards/versa_ecp5.py')
-rw-r--r--nmigen_boards/versa_ecp5.py46
1 files changed, 24 insertions, 22 deletions
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")