Add ECPDAP programmer

This commit is contained in:
Vadim Kaushan 2020-12-18 15:42:18 +03:00
parent 4092180662
commit 0fe2477f69
No known key found for this signature in database
GPG Key ID: A501C5DF67C05C4E
1 changed files with 27 additions and 0 deletions

View File

@ -147,3 +147,30 @@ class UJProg(GenericProgrammer):
def load_bitstream(self, bitstream_file):
self.call(["ujprog", bitstream_file])
# EcpDapProgrammer -------------------------------------------------------------------------------
class EcpDapProgrammer(GenericProgrammer):
"""ECPDAP allows you to program ECP5 FPGAs and attached SPI flash using CMSIS-DAP probes in JTAG mode.
You can get `ecpdap` here: https://github.com/adamgreig/ecpdap
"""
needs_bitreverse = False
def __init__(self, frequency=8_000_000):
self.frequency_khz = frequency // 1000
def flash(self, address, bitstream_file):
self.call(["ecpdap",
"flash", "write",
"--freq", str(self.frequency_khz),
"--offset", str(address),
bitstream_file
])
def load_bitstream(self, bitstream_file):
self.call(["ecpdap",
"program",
"--freq", str(self.frequency_khz),
bitstream_file
])