build/openfpgaloader: Allow reuse of programmer for consecutive commands and fix --offset.
- Avoid appending to self.cmd on each load_bitstream/flash call to allow reused of programmer object. - Convert address to str.
This commit is contained in:
parent
8fa4de5ede
commit
d16d4917d6
|
@ -22,14 +22,14 @@ class OpenFPGALoader(GenericProgrammer):
|
||||||
self.cmd += ["--freq", str(int(float(freq)))]
|
self.cmd += ["--freq", str(int(float(freq)))]
|
||||||
|
|
||||||
def load_bitstream(self, bitstream_file):
|
def load_bitstream(self, bitstream_file):
|
||||||
self.cmd += ["--bitstream", bitstream_file]
|
cmd = self.cmd + ["--bitstream", bitstream_file]
|
||||||
self.call(self.cmd)
|
self.call(cmd)
|
||||||
|
|
||||||
def flash(self, address, data_file, external=False):
|
def flash(self, address, data_file, external=False):
|
||||||
self.cmd += ["--write-flash", "--bitstream", data_file]
|
cmd = self.cmd + ["--write-flash", "--bitstream", data_file]
|
||||||
if external:
|
if external:
|
||||||
self.cmd += ["--external-flash"]
|
cmd += ["--external-flash"]
|
||||||
if address:
|
if address:
|
||||||
self.cmd.append("--offset")
|
cmd += ["--offset"]
|
||||||
self.cmd.append(address)
|
cmd += [str(address)]
|
||||||
self.call(self.cmd)
|
self.call(cmd)
|
||||||
|
|
Loading…
Reference in New Issue