From: Yann Sionneau Date: Mon, 12 Oct 2015 18:06:29 +0000 (+0200) Subject: vivado progammer: allow to specify flash chip X-Git-Tag: 24jan2021_ls180~2099^2~14 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b8283ec92cdbd8ddcccc0063da45bb3b46d07d99;p=litex.git vivado progammer: allow to specify flash chip --- diff --git a/mibuild/xilinx/programmer.py b/mibuild/xilinx/programmer.py index ce7ca8a5..e2115636 100644 --- a/mibuild/xilinx/programmer.py +++ b/mibuild/xilinx/programmer.py @@ -121,10 +121,12 @@ def _run_vivado(path, ver, cmds): class VivadoProgrammer(GenericProgrammer): needs_bitreverse = False - def __init__(self, vivado_path="/opt/Xilinx/Vivado", vivado_ver=None): + def __init__(self, vivado_path="/opt/Xilinx/Vivado", vivado_ver=None, + flash_part="n25q256-3.3v-spi-x1_x2_x4"): GenericProgrammer.__init__(self) self.vivado_path = vivado_path self.vivado_ver = vivado_ver + self.flash_part = flash_part def load_bitstream(self, bitstream_file): cmds = """open_hw @@ -146,7 +148,7 @@ quit cmds = """open_hw connect_hw_server open_hw_target [lindex [get_hw_targets -of_objects [get_hw_servers localhost]] 0] -create_hw_cfgmem -hw_device [lindex [get_hw_devices] 0] -mem_dev [lindex [get_cfgmem_parts {{n25q256-3.3v-spi-x1_x2_x4}}] 0] +create_hw_cfgmem -hw_device [lindex [get_hw_devices] 0] -mem_dev [lindex [get_cfgmem_parts {{{flash_part}}}] 0] set_property PROGRAM.BLANK_CHECK 0 [ get_property PROGRAM.HW_CFGMEM [lindex [get_hw_devices] 0 ]] set_property PROGRAM.ERASE 1 [ get_property PROGRAM.HW_CFGMEM [lindex [get_hw_devices] 0 ]] @@ -168,7 +170,7 @@ program_hw_cfgmem -hw_cfgmem [get_property PROGRAM.HW_CFGMEM [lindex [get_hw_dev endgroup quit -""".format(data=data_file) +""".format(data=data_file, flash_part=self.flash_part) _run_vivado(self.vivado_path, self.vivado_ver, cmds)