Merge pull request #792 from euryecetelecom/master

Add flash method to openFPGALoader class
This commit is contained in:
enjoy-digital 2021-01-30 21:35:09 +01:00 committed by GitHub
commit fd33e360fb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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)