From: whitequark Date: Sun, 2 Jun 2019 04:12:50 +0000 (+0000) Subject: vendor.fpga.lattice_ice40: use .bin suffix for bitstream tempfiles. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=acdeb7e8bbe4a84b5e98dc0802a5deb97af56b9f;p=nmigen.git vendor.fpga.lattice_ice40: use .bin suffix for bitstream tempfiles. --- 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)