From: Florent Kermarrec Date: Mon, 14 Apr 2014 15:23:04 +0000 (+0200) Subject: programmer: add USBBlaster and use platform.bitstream_ext in make X-Git-Tag: 24jan2021_ls180~2729 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=2fca8d41f2b238326f98e726883adf7fcce65e3c;p=litex.git programmer: add USBBlaster and use platform.bitstream_ext in make --- diff --git a/make.py b/make.py index 0b866e52..c245e0c8 100755 --- a/make.py +++ b/make.py @@ -183,7 +183,7 @@ Subtarget: {} if actions["load-bitstream"] or actions["flash-bitstream"] or actions["flash-bios"]: prog = programmer.create_programmer(platform.name, args.flash_proxy_dir) if actions["load-bitstream"]: - prog.load_bitstream("build/" + build_name + ".bit") + prog.load_bitstream("build/" + build_name + platform.bitstream_ext) if actions["flash-bitstream"]: if prog.needs_bitreverse: flashbit = "build/" + build_name + ".fpg" diff --git a/programmer.py b/programmer.py index 7615fdea..64f455a4 100644 --- a/programmer.py +++ b/programmer.py @@ -57,9 +57,20 @@ class XC3SProg(Programmer): flash_proxy = self.find_flash_proxy("bscan_spi_lx9_papilio.bit") subprocess.call(["xc3sprog", "-c", "papilio", "-I"+flash_proxy, "{}:w:0x{:x}:BIN".format(data_file, address)]) +class USBBlaster(Programmer): + needs_bitreverse = False + + def load_bitstream(self, bitstream_file, port=0): + usb_port = "[USB-"+str(port)+"]" + subprocess.call(["quartus_pgm", "-m", "jtag", "-c", "USB-Blaster"+usb_port, "-o", "p;"+bitstream_file]) + + def flash(self, address, data_file): + raise NotImplementedError + def create_programmer(platform_name, *args, **kwargs): return { "mixxeo": UrJTAG, "m1": UrJTAG, - "papilio_pro": XC3SProg + "papilio_pro": XC3SProg, + "de0nano": USBBlaster }[platform_name](platform_name, *args, **kwargs)