Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: m-labs/nmigen-boards
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 7ccb0b17ba72
Choose a base ref
...
head repository: m-labs/nmigen-boards
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: f563844c7f35
Choose a head ref
  • 1 commit
  • 1 file changed
  • 1 contributor

Commits on Aug 21, 2019

  1. versa_ecp5: prepare for switchable ECP5 toolchains.

    whitequark committed Aug 21, 2019
    Copy the full SHA
    f563844 View commit details
Showing with 24 additions and 22 deletions.
  1. +24 −22 nmigen_boards/versa_ecp5.py
46 changes: 24 additions & 22 deletions nmigen_boards/versa_ecp5.py
Original file line number Diff line number Diff line change
@@ -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")