Exemplo n.º 1
0
Arquivo: arty.py Projeto: rowhit/litex
 def create_programmer(self):
     if self.programmer == "xc3sprog":
         return XC3SProg("nexys4")
     elif self.programmer == "vivado":
         return VivadoProgrammer(flash_part="n25q128-3.3v-spi-x1_x2_x4")
     else:
         raise ValueError("{} programmer is not supported".format(
             self.programmer))
Exemplo n.º 2
0
 def create_programmer(self):
     if self.programmer == "xc3sprog":
         return XC3SProg("nexys4")
     elif self.programmer == "vivado":
         return VivadoProgrammer()
     else:
         raise ValueError("{} programmer is not supported".format(
             self.programmer))
Exemplo n.º 3
0
 def create_programmer(self, programmer="vivado"):
     if programmer == "xc3sprog":
         return XC3SProg("jtaghs1_fast")
     elif programmer == "vivado":
         return VivadoProgrammer()
     else:
         raise ValueError(
             "{} programmer is not supported".format(programmer))
Exemplo n.º 4
0
 def create_programmer(self):
     if self.programmer == "xc3sprog":
         return XC3SProg("jtaghs1_fast", "bscan_spi_kc705.bit")
     elif self.programmer == "vivado":
         return VivadoProgrammer()
     elif self.programmer == "impact":
         return iMPACT()
     else:
         raise ValueError("{} programmer is not supported".format(programmer))
Exemplo n.º 5
0
 def create_programmer(self):
     if self.programmer == "openocd":
         proxy="bscan_spi_{}.bit".format(self.device.split('-')[0])
         return OpenOCD(config="board/digilent_arty.cfg", flash_proxy_basename=proxy)
     elif self.programmer == "xc3sprog":
         return XC3SProg("nexys4")
     elif self.programmer == "vivado":
         return VivadoProgrammer(flash_part="n25q128-3.3v-spi-x1_x2_x4")
     else:
         raise ValueError("{} programmer is not supported"
                          .format(self.programmer))
Exemplo n.º 6
0
    def create_programmer(self, **kwargs):
        # For xc3sprog
        # See also http://xc3sprog.sourceforge.net
        # get source with: svn checkout https://svn.code.sf.net/p/xc3sprog/code/trunk xc3sprog
        if self.programmer == "xc3sprog":
            # to program the configuration flash, the FPGA must first be
            # programmed with a bitstream which provides a way to foward
            # data to flash. This is called a "flash proxy". Flash proxies
            # for some parts are already included in xc3sprog. Additional
            # ones can be found e.g. https://github.com/quartiq/bscan_spi_bitstreams

            # defines which flash proxy bitstream to use for which part
            flash_proxy = {
                "s7-50": "bscan_spi_xc7s50.bit",
                "s7-25": "bscan_spi_xc7s25.bit"
            }[self.device_variant]
            programmer = XC3SProg("jtaghs1_fast",
                                  flash_proxy_basename=flash_proxy)
            # search part where to find proxy bitsreams. If not specified
            # defaults to one of:
            #    "~/.migen", "/usr/local/share/migen", "/usr/share/migen",
            #    "~/.mlabs", "/usr/local/share/mlabs", "/usr/share/mlabs",
            #    "~/.litex", "/usr/local/share/litex", "/usr/share/litex"
            programmer.set_flash_proxy_dir("prog")
            return programmer

        # For Xilinx Vivado programmer
        # Vivado also uses flash proxy bitstreams but they are already shipped
        # with Vivado and are used automatically. Flash_part specifies the
        # exact part used in the Arty-S7 Rev. E
        elif self.programmer == "vivado":
            return VivadoProgrammer(flash_part="mt25ql128-spi-x1_x2_x4")

        # For OpenOCD
        elif self.programmer == "openocd":
            bscan_spi = "bscan_spi_xc7s50.bit" \
                    if "xc7s50" in self.device \
                    else "bscan_spi_xc7a25.bit"
            programmer = OpenOCD("openocd_xilinx.cfg", bscan_spi)
            programmer.set_flash_proxy_dir("prog")
            return programmer

        else:
            raise ValueError("{} programmer is not supported".format(
                self.programmer))