From 07d4cc70db81d8b7303d30534846771dd5ad7dd9 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Sun, 24 Nov 2013 23:51:51 +0100 Subject: [PATCH] support for bitstream loading on Papilio Pro --- jtag.py | 12 +++++++++--- make.py | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/jtag.py b/jtag.py index 6aeaf45a..853cf710 100644 --- a/jtag.py +++ b/jtag.py @@ -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() diff --git a/make.py b/make.py index 403d6b51..1740a50e 100755 --- a/make.py +++ b/make.py @@ -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") -- 2.30.2