Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: m-labs/migen
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: a56fce045bf5
Choose a base ref
...
head repository: m-labs/migen
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: f154c2e7ec51
Choose a head ref
  • 2 commits
  • 2 files changed
  • 1 contributor

Commits on Mar 3, 2015

  1. Copy the full SHA
    154ad54 View commit details
  2. Copy the full SHA
    f154c2e View commit details
Showing with 11 additions and 12 deletions.
  1. +1 −1 mibuild/platforms/kc705.py
  2. +10 −11 mibuild/xilinx/programmer.py
2 changes: 1 addition & 1 deletion mibuild/platforms/kc705.py
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@
from mibuild.xilinx.common import CRG_DS
from mibuild.xilinx.ise import XilinxISEPlatform
from mibuild.xilinx.vivado import XilinxVivadoPlatform
from mibuild.xilinx.programmer import XC3SProg
from mibuild.xilinx.programmer import XC3SProg, VivadoProgrammer

_io = [
("user_led", 0, Pins("AB8"), IOStandard("LVCMOS15")),
21 changes: 10 additions & 11 deletions mibuild/xilinx/programmer.py
Original file line number Diff line number Diff line change
@@ -63,23 +63,22 @@ 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):
def _run_vivado(path, ver, cmds):
if sys.platform == "win32" or sys.platform == "cygwin":
pass
vivado_cmd = "vivado -mode tcl"
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:
settings = common.settings(path, ver)
vivado_cmd = "bash -c \"source " + settings + "&& vivado -mode tcl\""
with subprocess.Popen(vivado_cmd, stdin=subprocess.PIPE, shell=True) as process:
process.stdin.write(cmds.encode("ASCII"))
process.communicate()

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

def load_bitstream(self, bitstream_file):
cmds = """open_hw
@@ -94,7 +93,7 @@ def load_bitstream(self, bitstream_file):
quit
""".format(bitstream=bitstream_file)
_run_vivado(cmds)
_run_vivado(self.vivado_path, self.vivado_ver, cmds)

# XXX works to flash bitstream, adapt it to flash bios
def flash(self, address, data_file):
@@ -124,4 +123,4 @@ def flash(self, address, data_file):
quit
""".format(data=data_file)
_run_vivado(cmds)
_run_vivado(self.vivado_path, self.vivado_ver, cmds)