Skip to content

Commit 7440ccd

Browse files
committedMar 21, 2015
mibuild/xilinx/programmer: add iMPACT programmer (for sb: I need it in Windows for now since I was not able to get XC3SPROG working)
1 parent 1d2e7e8 commit 7440ccd

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed
 

Diff for: ‎mibuild/xilinx/programmer.py

+17
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,23 @@ def flash(self, address, data_file):
6363
subprocess.call(["fpgaprog", "-v", "-sa", "-r", "-b", flash_proxy,
6464
"-f", data_file])
6565

66+
def _run_impact(cmds):
67+
with subprocess.Popen("impact -batch", stdin=subprocess.PIPE) as process:
68+
process.stdin.write(cmds.encode("ASCII"))
69+
process.communicate()
70+
71+
class iMPACT(GenericProgrammer):
72+
needs_bitreverse = False
73+
74+
def load_bitstream(self, bitstream_file):
75+
cmds = """setMode -bs
76+
setCable -p auto
77+
addDevice -p 1 -file {bitstream}
78+
program -p 1
79+
quit
80+
""".format(bitstream=bitstream_file)
81+
_run_impact(cmds)
82+
6683
def _run_vivado(path, ver, cmds):
6784
if sys.platform == "win32" or sys.platform == "cygwin":
6885
vivado_cmd = "vivado -mode tcl"

0 commit comments

Comments
 (0)
Please sign in to comment.