From e4de5a0c9dbdb0d1740bddf87ef0b2bd008b6415 Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Fri, 27 Feb 2015 10:18:30 +0100 Subject: [PATCH] make.py: avoid some actions in make all (do not flash if load-bitstream is specified or if bios is in blockram) --- make.py | 41 +++++++++++++++++++++++------------------ 1 file changed, 23 insertions(+), 18 deletions(-) diff --git a/make.py b/make.py index bf11452e..93af739f 100755 --- a/make.py +++ b/make.py @@ -119,8 +119,10 @@ CPU type: {} actions["clean"] = True actions["build-bitstream"] = True actions["build-bios"] = True - actions["flash-bitstream"] = True - actions["flash-bios"] = True + if not actions["load-bitstream"]: + actions["flash-bitstream"] = True + if not hasattr(soc, "init_bios_memory"): + actions["flash-bios"] = True if actions["build-bitstream"] and hasattr(soc, "init_bios_memory"): actions["build-bios"] = True if actions["build-bios"]: @@ -188,20 +190,23 @@ CPU type: {} vns = platform.build(soc, build_name=build_name, **build_kwargs) soc.do_exit(vns) - if actions["load-bitstream"] or actions["flash-bitstream"] or actions["flash-bios"]: + if actions["load-bitstream"]: prog = platform.create_programmer() - if actions["load-bitstream"]: - prog.load_bitstream("build/" + build_name + platform.bitstream_ext) - if actions["flash-bitstream"]: - prog.set_flash_proxy_dir(args.flash_proxy_dir) - if prog.needs_bitreverse: - flashbit = "build/" + build_name + ".fpg" - subprocess.call(["tools/byteswap", - "build/" + build_name + ".bin", - flashbit]) - else: - flashbit = "build/" + build_name + ".bin" - prog.flash(0, flashbit) - if actions["flash-bios"]: - prog.set_flash_proxy_dir(args.flash_proxy_dir) - prog.flash(soc.cpu_reset_address, "software/bios/bios.bin") + prog.load_bitstream("build/" + build_name + platform.bitstream_ext) + + if actions["flash-bitstream"]: + prog = platform.create_programmer() + prog.set_flash_proxy_dir(args.flash_proxy_dir) + if prog.needs_bitreverse: + flashbit = "build/" + build_name + ".fpg" + subprocess.call(["tools/byteswap", + "build/" + build_name + ".bin", + flashbit]) + else: + flashbit = "build/" + build_name + ".bin" + prog.flash(0, flashbit) + + if actions["flash-bios"]: + prog = platform.create_programmer() + prog.set_flash_proxy_dir(args.flash_proxy_dir) + prog.flash(soc.cpu_reset_address, "software/bios/bios.bin") -- 2.30.2