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
def load(bitstream):
cmds = """cable milkymist
cables = {
"mixxeo": "milkymist",
"m1": "milkymist",
"papilio_pro": "Flyswatter"
}
def load(platform_name, bitstream):
cmds = """cable {cable}
detect
pld load {bitstream}
quit
""".format(bitstream=bitstream)
""".format(cable=cables[platform_name], bitstream=bitstream)
process = subprocess.Popen("jtag", stdin=subprocess.PIPE)
process.stdin.write(cmds.encode("ASCII"))
process.communicate()

View File

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