mirror of
https://github.com/enjoy-digital/litex.git
synced 2025-01-04 09:52:26 -05:00
Allow using non-milkymist cables with UrJTAG.
This commit is contained in:
parent
445f0f5d40
commit
1d1f8510d3
2 changed files with 10 additions and 5 deletions
|
@ -127,7 +127,7 @@ class Platform(XilinxPlatform):
|
||||||
XilinxPlatform.__init__(self, "xc6slx45-fgg484-2", _io)
|
XilinxPlatform.__init__(self, "xc6slx45-fgg484-2", _io)
|
||||||
|
|
||||||
def create_programmer(self):
|
def create_programmer(self):
|
||||||
return UrJTAG("fjmem-m1.bit")
|
return UrJTAG(cable="milkymist", flash_proxy_basename="fjmem-m1.bit")
|
||||||
|
|
||||||
def do_finalize(self, fragment):
|
def do_finalize(self, fragment):
|
||||||
XilinxPlatform.do_finalize(self, fragment)
|
XilinxPlatform.do_finalize(self, fragment)
|
||||||
|
|
|
@ -14,17 +14,21 @@ def _run_urjtag(cmds):
|
||||||
class UrJTAG(GenericProgrammer):
|
class UrJTAG(GenericProgrammer):
|
||||||
needs_bitreverse = True
|
needs_bitreverse = True
|
||||||
|
|
||||||
|
def __init__(self, cable, flash_proxy_basename=None):
|
||||||
|
GenericProgrammer.__init__(self, flash_proxy_basename)
|
||||||
|
self.cable = cable
|
||||||
|
|
||||||
def load_bitstream(self, bitstream_file):
|
def load_bitstream(self, bitstream_file):
|
||||||
cmds = """cable milkymist
|
cmds = """cable {cable}
|
||||||
detect
|
detect
|
||||||
pld load {bitstream}
|
pld load {bitstream}
|
||||||
quit
|
quit
|
||||||
""".format(bitstream=bitstream_file)
|
""".format(bitstream=bitstream_file, cable=self.cable)
|
||||||
_run_urjtag(cmds)
|
_run_urjtag(cmds)
|
||||||
|
|
||||||
def flash(self, address, data_file):
|
def flash(self, address, data_file):
|
||||||
flash_proxy = self.find_flash_proxy()
|
flash_proxy = self.find_flash_proxy()
|
||||||
cmds = """cable milkymist
|
cmds = """cable {cable}
|
||||||
detect
|
detect
|
||||||
pld load "{flash_proxy}"
|
pld load "{flash_proxy}"
|
||||||
initbus fjmem opcode=000010
|
initbus fjmem opcode=000010
|
||||||
|
@ -32,7 +36,8 @@ frequency 6000000
|
||||||
detectflash 0
|
detectflash 0
|
||||||
endian big
|
endian big
|
||||||
flashmem "{address}" "{data_file}" noverify
|
flashmem "{address}" "{data_file}" noverify
|
||||||
""".format(flash_proxy=flash_proxy, address=address, data_file=data_file)
|
""".format(flash_proxy=flash_proxy, address=address, data_file=data_file,
|
||||||
|
cable=self.cable)
|
||||||
_run_urjtag(cmds)
|
_run_urjtag(cmds)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue