litex/jtag.py

21 lines
454 B
Python
Raw Normal View History

2013-07-04 13:19:39 -04:00
import subprocess
cables = {
"mixxeo": "milkymist",
"m1": "milkymist",
"papilio_pro": "Flyswatter"
}
def load(platform_name, bitstream):
cmds = """cable {cable}
2013-07-04 13:19:39 -04:00
detect
pld load {bitstream}
quit
""".format(cable=cables[platform_name], bitstream=bitstream)
2013-07-04 13:19:39 -04:00
process = subprocess.Popen("jtag", stdin=subprocess.PIPE)
process.stdin.write(cmds.encode("ASCII"))
process.communicate()
def flash(bitstream):
subprocess.call(["m1nor-ng", bitstream])