From: whitequark Date: Sun, 7 Jul 2019 00:11:33 +0000 (+0000) Subject: Replace subprocess.run(..., check=True) with subprocess.check_call(). X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=bc2d42e451d7b866f0a28c1c3888a8b54ed219d2;p=nmigen-boards.git Replace subprocess.run(..., check=True) with subprocess.check_call(). --- diff --git a/nmigen_boards/blackice.py b/nmigen_boards/blackice.py index 399e29c..591f74d 100644 --- a/nmigen_boards/blackice.py +++ b/nmigen_boards/blackice.py @@ -69,7 +69,7 @@ class BlackIcePlatform(LatticeICE40Platform): def toolchain_program(self, products, name): with products.extract("{}.bin".format(name)) as bitstream_filename: - subprocess.run(["cp", bitstream_filename, "/dev/ttyACM0"], check=True) + subprocess.check_call(["cp", bitstream_filename, "/dev/ttyACM0"]) if __name__ == "__main__": diff --git a/nmigen_boards/blackice_ii.py b/nmigen_boards/blackice_ii.py index 3107350..a9830bc 100644 --- a/nmigen_boards/blackice_ii.py +++ b/nmigen_boards/blackice_ii.py @@ -71,7 +71,7 @@ class BlackIceIIPlatform(LatticeICE40Platform): def toolchain_program(self, products, name): with products.extract("{}.bin".format(name)) as bitstream_filename: - subprocess.run(["cp", bitstream_filename, "/dev/ttyACM0"], check=True) + subprocess.check_call(["cp", bitstream_filename, "/dev/ttyACM0"]) if __name__ == "__main__": diff --git a/nmigen_boards/ice40_hx1k_blink_evn.py b/nmigen_boards/ice40_hx1k_blink_evn.py index ab280a2..418c593 100644 --- a/nmigen_boards/ice40_hx1k_blink_evn.py +++ b/nmigen_boards/ice40_hx1k_blink_evn.py @@ -42,7 +42,7 @@ class ICE40HX1KBlinkEVNPlatform(LatticeICE40Platform): def toolchain_program(self, products, name): iceburn = os.environ.get("ICEBURN", "iCEburn") with products.extract("{}.bin".format(name)) as bitstream_filename: - subprocess.run([iceburn, "-evw", bitstream_filename], check=True) + subprocess.check_call([iceburn, "-evw", bitstream_filename]) if __name__ == "__main__": diff --git a/nmigen_boards/ice40_hx8k_b_evn.py b/nmigen_boards/ice40_hx8k_b_evn.py index 1f6d6d1..4ff8d85 100644 --- a/nmigen_boards/ice40_hx8k_b_evn.py +++ b/nmigen_boards/ice40_hx8k_b_evn.py @@ -62,7 +62,7 @@ class ICE40HX8KBEVNPlatform(LatticeICE40Platform): iceprog = os.environ.get("ICEPROG", "iceprog") with products.extract("{}.bin".format(name)) as bitstream_filename: # TODO: this should be factored out and made customizable - subprocess.run([iceprog, "-S", bitstream_filename], check=True) + subprocess.check_call([iceprog, "-S", bitstream_filename]) if __name__ == "__main__": diff --git a/nmigen_boards/icebreaker.py b/nmigen_boards/icebreaker.py index 5032346..39d82d5 100644 --- a/nmigen_boards/icebreaker.py +++ b/nmigen_boards/icebreaker.py @@ -78,7 +78,7 @@ class ICEBreakerPlatform(LatticeICE40Platform): def toolchain_program(self, products, name): iceprog = os.environ.get("ICEPROG", "iceprog") with products.extract("{}.bin".format(name)) as bitstream_filename: - subprocess.run([iceprog, bitstream_filename], check=True) + subprocess.check_call([iceprog, bitstream_filename]) if __name__ == "__main__": diff --git a/nmigen_boards/icestick.py b/nmigen_boards/icestick.py index 217e411..e575aac 100644 --- a/nmigen_boards/icestick.py +++ b/nmigen_boards/icestick.py @@ -48,7 +48,7 @@ class ICEStickPlatform(LatticeICE40Platform): def toolchain_program(self, products, name): iceprog = os.environ.get("ICEPROG", "iceprog") with products.extract("{}.bin".format(name)) as bitstream_filename: - subprocess.run([iceprog, bitstream_filename], check=True) + subprocess.check_call([iceprog, bitstream_filename]) if __name__ == "__main__": diff --git a/nmigen_boards/kc705.py b/nmigen_boards/kc705.py index df3a492..22ba5fc 100644 --- a/nmigen_boards/kc705.py +++ b/nmigen_boards/kc705.py @@ -36,8 +36,10 @@ class KC705Platform(Xilinx7SeriesPlatform): def toolchain_program(self, products, name): openocd = os.environ.get("OPENOCD", "openocd") with products.extract("{}.bit".format(name)) as bitstream_filename: - subprocess.run([openocd, "-c", - "source [find board/kc705.cfg]; init; pld load 0 {}; exit".format(bitstream_filename)], check=True) + subprocess.check_call([openocd, + "-c", "source [find board/kc705.cfg]; init; pld load 0 {}; exit" + .format(bitstream_filename) + ]) if __name__ == "__main__": diff --git a/nmigen_boards/tinyfpga_bx.py b/nmigen_boards/tinyfpga_bx.py index 5dcd7aa..5db90cf 100644 --- a/nmigen_boards/tinyfpga_bx.py +++ b/nmigen_boards/tinyfpga_bx.py @@ -45,7 +45,7 @@ class TinyFPGABXPlatform(LatticeICE40Platform): def toolchain_program(self, products, name): tinyprog = os.environ.get("TINYPROG", "tinyprog") with products.extract("{}.bin".format(name)) as bitstream_filename: - subprocess.run([tinyprog, "-p", bitstream_filename], check=True) + subprocess.check_call([tinyprog, "-p", bitstream_filename]) if __name__ == "__main__": diff --git a/nmigen_boards/versa_ecp5.py b/nmigen_boards/versa_ecp5.py index 262e309..35b28be 100644 --- a/nmigen_boards/versa_ecp5.py +++ b/nmigen_boards/versa_ecp5.py @@ -171,10 +171,10 @@ class VersaECP5Platform(LatticeECP5Platform): openocd = os.environ.get("OPENOCD", "openocd") with products.extract("{}-openocd.cfg".format(name), "{}.svf".format(name)) \ as (config_filename, vector_filename): - subprocess.run([openocd, + subprocess.check_call([openocd, "-f", config_filename, "-c", "transport select jtag; init; svf -quiet {}; exit".format(vector_filename) - ], check=True) + ]) if __name__ == "__main__":