vendor.fpga.lattice_ice40: use .bin suffix for bitstream tempfiles.
This commit is contained in:
parent
37152c733e
commit
e4ebe03115
9
nmigen/vendor/fpga/lattice_ice40.py
vendored
9
nmigen/vendor/fpga/lattice_ice40.py
vendored
|
@ -120,7 +120,8 @@ class IceStormProgrammerMixin:
|
||||||
options = ["-S"]
|
options = ["-S"]
|
||||||
if mode == "flash":
|
if mode == "flash":
|
||||||
options = []
|
options = []
|
||||||
with tempfile.NamedTemporaryFile(prefix="nmigen_iceprog_") as bitstream_file:
|
with tempfile.NamedTemporaryFile(prefix="nmigen_iceprog_",
|
||||||
|
suffix=".bin") as bitstream_file:
|
||||||
bitstream_file.write(bitstream)
|
bitstream_file.write(bitstream)
|
||||||
subprocess.run([iceprog, *options, bitstream_file.name], check=True)
|
subprocess.run([iceprog, *options, bitstream_file.name], check=True)
|
||||||
|
|
||||||
|
@ -129,7 +130,8 @@ class IceBurnProgrammerMixin:
|
||||||
def toolchain_program(self, products, name):
|
def toolchain_program(self, products, name):
|
||||||
iceburn = os.environ.get("ICEBURN", "iCEburn")
|
iceburn = os.environ.get("ICEBURN", "iCEburn")
|
||||||
bitstream = products.get("{}.bin".format(name))
|
bitstream = products.get("{}.bin".format(name))
|
||||||
with tempfile.NamedTemporaryFile(prefix="nmigen_iceburn_") as bitstream_file:
|
with tempfile.NamedTemporaryFile(prefix="nmigen_iceburn_",
|
||||||
|
suffix=".bin") as bitstream_file:
|
||||||
bitstream_file.write(bitstream)
|
bitstream_file.write(bitstream)
|
||||||
subprocess.run([iceburn, "-evw", bitstream_file.name], check=True)
|
subprocess.run([iceburn, "-evw", bitstream_file.name], check=True)
|
||||||
|
|
||||||
|
@ -139,6 +141,7 @@ class TinyProgrammerMixin:
|
||||||
tinyprog = os.environ.get("TINYPROG", "tinyprog")
|
tinyprog = os.environ.get("TINYPROG", "tinyprog")
|
||||||
options = ["-p"]
|
options = ["-p"]
|
||||||
bitstream = products.get("{}.bin".format(name))
|
bitstream = products.get("{}.bin".format(name))
|
||||||
with tempfile.NamedTemporaryFile(prefix="nmigen_tinyprog_") as bitstream_file:
|
with tempfile.NamedTemporaryFile(prefix="nmigen_tinyprog_",
|
||||||
|
suffix=".bin") as bitstream_file:
|
||||||
bitstream_file.write(bitstream)
|
bitstream_file.write(bitstream)
|
||||||
subprocess.run([tinyprog, *options, bitstream_file.name], check=True)
|
subprocess.run([tinyprog, *options, bitstream_file.name], check=True)
|
||||||
|
|
Loading…
Reference in a new issue