From 9b8253c016edc63d4d50dfe7d927b96cfe03bda9 Mon Sep 17 00:00:00 2001 From: David Sawatzke Date: Wed, 11 Aug 2021 18:46:16 +0200 Subject: [PATCH] build/lattice/programmer: Add ecpprog-based programmer --- litex/build/lattice/programmer.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/litex/build/lattice/programmer.py b/litex/build/lattice/programmer.py index dd0202c25..d9967de52 100644 --- a/litex/build/lattice/programmer.py +++ b/litex/build/lattice/programmer.py @@ -185,3 +185,18 @@ class EcpDapProgrammer(GenericProgrammer): "--freq", str(self.frequency_khz), bitstream_file ]) + +# EcpprogProgrammer ------------------------------------------------------------------------------- + +class EcpprogProgrammer(GenericProgrammer): + """ecpprog allows you to program ECP5 FPGAs and attached SPI flash using FTDI based JTAG probes + + You can get `ecpprog` here: https://github.com/gregdavill/ecpprog + """ + needs_bitreverse = False + + def flash(self, address, bitstream_file): + self.call(["ecpprog", "-o", str(address), bitstream_file]) + + def load_bitstream(self, bitstream_file): + self.call(["ecpprog", "-S", bitstream_file])