Skip to content

Commit

Permalink
xilinx/programmer: add source of vivado's settings (need to be tested…
Browse files Browse the repository at this point in the history
… on a linux machine)
enjoy-digital committed Feb 28, 2015

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent e82531c commit 87d8ff2
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions mibuild/xilinx/programmer.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import subprocess

from mibuild.generic_programmer import GenericProgrammer
from mibuild.xilinx import common

def _run_urjtag(cmds):
with subprocess.Popen("jtag", stdin=subprocess.PIPE) as process:
@@ -62,6 +63,12 @@ def flash(self, address, data_file):
subprocess.call(["fpgaprog", "-v", "-sa", "-r", "-b", flash_proxy,
"-f", data_file])

def _source_vivado(vivado_path, ver=None):
if sys.platform == "win32" or sys.platform == "cygwin":
pass
else:
settings = common.settings(vivado_path, ver)
subprocess.call(["source", settings])

def _run_vivado(cmds):
with subprocess.Popen("vivado -mode tcl", stdin=subprocess.PIPE, shell=True) as process:
@@ -70,6 +77,9 @@ def _run_vivado(cmds):

class VivadoProgrammer(GenericProgrammer):
needs_bitreverse = False
def __init__(self, vivado_path="/opt/Xilinx/Vivado"):
GenericProgrammer.__init__(self)
_source_vivado(vivado_path)

def load_bitstream(self, bitstream_file):
cmds = """open_hw

2 comments on commit 87d8ff2

@sbourdeauducq
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I fixed it for Linux.

@enjoy-digital
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool, thanks.

Please sign in to comment.