From: Florent Kermarrec Date: Sat, 21 Mar 2015 19:27:11 +0000 (+0100) Subject: mibuild/xilinx/programmer: add iMPACT programmer (for sb: I need it in Windows for... X-Git-Tag: 24jan2021_ls180~2099^2~151 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=7440ccd65b71ecb19d20ea664c306b489538a1b3;p=litex.git mibuild/xilinx/programmer: add iMPACT programmer (for sb: I need it in Windows for now since I was not able to get XC3SPROG working) --- diff --git a/mibuild/xilinx/programmer.py b/mibuild/xilinx/programmer.py index 12c8b6cb..0a09efa3 100644 --- a/mibuild/xilinx/programmer.py +++ b/mibuild/xilinx/programmer.py @@ -63,6 +63,23 @@ class FpgaProg(GenericProgrammer): subprocess.call(["fpgaprog", "-v", "-sa", "-r", "-b", flash_proxy, "-f", data_file]) +def _run_impact(cmds): + with subprocess.Popen("impact -batch", stdin=subprocess.PIPE) as process: + process.stdin.write(cmds.encode("ASCII")) + process.communicate() + +class iMPACT(GenericProgrammer): + needs_bitreverse = False + + def load_bitstream(self, bitstream_file): + cmds = """setMode -bs +setCable -p auto +addDevice -p 1 -file {bitstream} +program -p 1 +quit +""".format(bitstream=bitstream_file) + _run_impact(cmds) + def _run_vivado(path, ver, cmds): if sys.platform == "win32" or sys.platform == "cygwin": vivado_cmd = "vivado -mode tcl"