Skip to content

Commit 87d8ff2

Browse files
committedFeb 28, 2015
xilinx/programmer: add source of vivado's settings (need to be tested on a linux machine)
1 parent e82531c commit 87d8ff2

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed
 

Diff for: ‎mibuild/xilinx/programmer.py

+10
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import subprocess
22

33
from mibuild.generic_programmer import GenericProgrammer
4+
from mibuild.xilinx import common
45

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

66+
def _source_vivado(vivado_path, ver=None):
67+
if sys.platform == "win32" or sys.platform == "cygwin":
68+
pass
69+
else:
70+
settings = common.settings(vivado_path, ver)
71+
subprocess.call(["source", settings])
6572

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

7178
class VivadoProgrammer(GenericProgrammer):
7279
needs_bitreverse = False
80+
def __init__(self, vivado_path="/opt/Xilinx/Vivado"):
81+
GenericProgrammer.__init__(self)
82+
_source_vivado(vivado_path)
7383

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

2 commit comments

Comments
 (2)

sbourdeauducq commented on Mar 3, 2015

@sbourdeauducq
Member

I fixed it for Linux.

enjoy-digital commented on Mar 3, 2015

@enjoy-digital
ContributorAuthor

Cool, thanks.

Please sign in to comment.