mirror of
https://github.com/enjoy-digital/litex.git
synced 2025-01-04 09:52:26 -05:00
use Vivado programmer instead of IMPACT
This commit is contained in:
parent
2c0115262b
commit
37fe17debe
2 changed files with 17 additions and 11 deletions
2
Makefile
2
Makefile
|
@ -3,7 +3,7 @@ CURDIR = ../sata-controller
|
||||||
PYTHON = python3
|
PYTHON = python3
|
||||||
TOOLCHAIN = vivado
|
TOOLCHAIN = vivado
|
||||||
PLATFORM = kc705
|
PLATFORM = kc705
|
||||||
PROGRAMMER = impact
|
PROGRAMMER = vivado
|
||||||
|
|
||||||
CMD = $(PYTHON) make.py -X $(CURDIR) -Op toolchain $(TOOLCHAIN) -Op programmer $(PROGRAMMER) -p $(PLATFORM) -t test
|
CMD = $(PYTHON) make.py -X $(CURDIR) -Op toolchain $(TOOLCHAIN) -Op programmer $(PROGRAMMER) -p $(PLATFORM) -t test
|
||||||
|
|
||||||
|
|
|
@ -5,22 +5,28 @@ from mibuild.xilinx_ise import XilinxISEPlatform
|
||||||
from mibuild.xilinx_vivado import XilinxVivadoPlatform
|
from mibuild.xilinx_vivado import XilinxVivadoPlatform
|
||||||
from mibuild.programmer import *
|
from mibuild.programmer import *
|
||||||
|
|
||||||
def _run_impact(cmds):
|
def _run_vivado(cmds):
|
||||||
with subprocess.Popen("impact -batch", stdin=subprocess.PIPE) as process:
|
with subprocess.Popen("vivado -mode tcl", stdin=subprocess.PIPE, shell=True) as process:
|
||||||
process.stdin.write(cmds.encode("ASCII"))
|
process.stdin.write(cmds.encode("ASCII"))
|
||||||
process.communicate()
|
process.communicate()
|
||||||
|
|
||||||
class IMPACT(Programmer):
|
class VivadoProgrammer(Programmer):
|
||||||
needs_bitreverse = False
|
needs_bitreverse = False
|
||||||
|
|
||||||
def load_bitstream(self, bitstream_file):
|
def load_bitstream(self, bitstream_file):
|
||||||
cmds = """setMode -bs
|
cmds = """open_hw
|
||||||
setCable -p auto
|
connect_hw_server
|
||||||
addDevice -p 1 -file {bitstream}
|
open_hw_target [lindex [get_hw_targets -of_objects [get_hw_servers localhost]] 0]
|
||||||
program -p 1
|
|
||||||
|
set_property PROBES.FILE {{}} [lindex [get_hw_devices] 0]
|
||||||
|
set_property PROGRAM.FILE {{{bitstream}}} [lindex [get_hw_devices] 0]
|
||||||
|
|
||||||
|
program_hw_devices [lindex [get_hw_devices] 0]
|
||||||
|
refresh_hw_device [lindex [get_hw_devices] 0]
|
||||||
|
|
||||||
quit
|
quit
|
||||||
""".format(bitstream=bitstream_file)
|
""".format(bitstream=bitstream_file)
|
||||||
_run_impact(cmds)
|
_run_vivado(cmds)
|
||||||
|
|
||||||
def flash(self, address, data_file):
|
def flash(self, address, data_file):
|
||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
|
@ -103,8 +109,8 @@ def Platform(*args, toolchain="vivado", programmer="xc3sprog", **kwargs):
|
||||||
def create_programmer(self):
|
def create_programmer(self):
|
||||||
if programmer == "xc3sprog":
|
if programmer == "xc3sprog":
|
||||||
return XC3SProg("jtaghs1_fast", "bscan_spi_kc705.bit")
|
return XC3SProg("jtaghs1_fast", "bscan_spi_kc705.bit")
|
||||||
elif programmer == "impact":
|
elif programmer == "vivado":
|
||||||
return IMPACT()
|
return VivadoProgrammer()
|
||||||
else:
|
else:
|
||||||
raise ValueError
|
raise ValueError
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue