Add flash method to openFPGALoader class for support with generic_programmer usage (needed for linux-on-litex-vexriscv) + add offset/address support for firmware load

This commit is contained in:
Guillaume REMBERT 2021-01-30 13:20:30 +01:00
parent 69307cfdde
commit 18a5ace637
1 changed files with 8 additions and 3 deletions

View File

@ -15,8 +15,13 @@ class OpenFPGALoader(GenericProgrammer):
def __init__(self, board):
self.board = board
def load_bitstream(self, bitstream_file, flash=False):
def load_bitstream(self, bitstream_file):
cmd = ["openFPGALoader", "--board", self.board, "--bitstream", bitstream_file]
if flash:
cmd.append("--write-flash")
self.call(cmd)
def flash(self, address, data_file):
cmd = ["openFPGALoader", "--board", self.board, "--write-flash", "--bitstream", data_file]
if address:
cmd.append("--offset")
cmd.append(address)
self.call(cmd)