mirror of
https://github.com/enjoy-digital/litex.git
synced 2025-01-04 09:52:26 -05:00
programmer: add USBBlaster and use platform.bitstream_ext in make
This commit is contained in:
parent
97311fc211
commit
2fca8d41f2
2 changed files with 13 additions and 2 deletions
2
make.py
2
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"
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue