From e4ebe03115d567732ac657145663413ffe9d2d8c Mon Sep 17 00:00:00 2001 From: whitequark Date: Sun, 2 Jun 2019 04:12:50 +0000 Subject: [PATCH] vendor.fpga.lattice_ice40: use .bin suffix for bitstream tempfiles. --- nmigen/vendor/fpga/lattice_ice40.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/nmigen/vendor/fpga/lattice_ice40.py b/nmigen/vendor/fpga/lattice_ice40.py index 1ca84dc..ab6c2a2 100644 --- a/nmigen/vendor/fpga/lattice_ice40.py +++ b/nmigen/vendor/fpga/lattice_ice40.py @@ -120,7 +120,8 @@ class IceStormProgrammerMixin: 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) @@ -129,7 +130,8 @@ class IceBurnProgrammerMixin: 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) @@ -139,6 +141,7 @@ class TinyProgrammerMixin: 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) -- 2.30.2