2013-07-04 13:19:39 -04:00
|
|
|
import subprocess
|
|
|
|
|
2013-11-24 17:51:51 -05:00
|
|
|
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
|
2013-11-24 17:51:51 -05:00
|
|
|
""".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])
|