Skip to content

Commit

Permalink
mibuild/xilinx/programmer: add iMPACT programmer (for sb: I need it i…
Browse files Browse the repository at this point in the history
…n Windows for now since I was not able to get XC3SPROG working)
  • Loading branch information
enjoy-digital committed Mar 21, 2015
1 parent 1d2e7e8 commit 7440ccd
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions mibuild/xilinx/programmer.py
Expand Up @@ -63,6 +63,23 @@ def flash(self, address, data_file):
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"
Expand Down

0 comments on commit 7440ccd

Please sign in to comment.