support for bitstream loading on Papilio Pro

This commit is contained in:
Sebastien Bourdeauducq 2013-11-24 23:51:51 +01:00
parent 08b09fb02a
commit 07d4cc70db
2 changed files with 10 additions and 4 deletions

12
jtag.py
View File

@ -1,11 +1,17 @@
import subprocess import subprocess
def load(bitstream): cables = {
cmds = """cable milkymist "mixxeo": "milkymist",
"m1": "milkymist",
"papilio_pro": "Flyswatter"
}
def load(platform_name, bitstream):
cmds = """cable {cable}
detect detect
pld load {bitstream} pld load {bitstream}
quit quit
""".format(bitstream=bitstream) """.format(cable=cables[platform_name], bitstream=bitstream)
process = subprocess.Popen("jtag", stdin=subprocess.PIPE) process = subprocess.Popen("jtag", stdin=subprocess.PIPE)
process.stdin.write(cmds.encode("ASCII")) process.stdin.write(cmds.encode("ASCII"))
process.communicate() process.communicate()

View File

@ -92,7 +92,7 @@ def main():
"build/" + build_name + ".fpg"]) "build/" + build_name + ".fpg"])
if args.load: if args.load:
jtag.load("build/" + build_name + ".bit") jtag.load(platform.name, "build/" + build_name + ".bit")
if args.flash: if args.flash:
jtag.flash("build/" + build_name + ".fpg") jtag.flash("build/" + build_name + ".fpg")