options = ["-S"]
if mode == "flash":
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)
subprocess.run([iceprog, *options, bitstream_file.name], check=True)
def toolchain_program(self, products, name):
iceburn = os.environ.get("ICEBURN", "iCEburn")
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)
subprocess.run([iceburn, "-evw", bitstream_file.name], check=True)
tinyprog = os.environ.get("TINYPROG", "tinyprog")
options = ["-p"]
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)
subprocess.run([tinyprog, *options, bitstream_file.name], check=True)