Пример #1
0
def program_fpga(remote, bitstream=None):
    """Upload and program bistream

    Parameters
    ----------
    remote : RPCSession
        The TVM RPC session

    bitstream : str, optional
        Path to a local bistream file. If unset, tries to download from cache server.
    """
    env = get_env()

    if bitstream:
        assert os.path.isfile(bitstream)
    else:
        bitstream = get_bitstream_path()
        if not os.path.isfile(bitstream):
            if env.TARGET == "de10nano":
                return
            download_bitstream()

    if isinstance(remote, rpc.LocalSession):
        program_bitstream.bitstream_program(env.TARGET, bitstream)
    else:
        fprogram = remote.get_function("tvm.contrib.vta.init")
        remote.upload(bitstream)
        fprogram(os.path.basename(bitstream))
Пример #2
0
 def program_fpga(file_name):
     from pynq import xlnk
     # Reset xilinx driver
     xlnk.Xlnk().xlnk_reset()
     path = tvm.get_global_func("tvm.rpc.server.workpath")(file_name)
     env = get_env()
     program_bitstream.bitstream_program(env.TARGET, path)
     logging.info("Program FPGA with %s ", file_name)
Пример #3
0
 def program_fpga(file_name):
     # pylint: disable=import-outside-toplevel
     env = get_env()
     if env.TARGET == "pynq":
         from pynq import xlnk
         # Reset xilinx driver
         xlnk.Xlnk().xlnk_reset()
     elif env.TARGET == "de10nano":
         # Load the de10nano program function.
         load_vta_dll()
     path = tvm.get_global_func("tvm.rpc.server.workpath")(file_name)
     program_bitstream.bitstream_program(env.TARGET, path)
     logging.info("Program FPGA with %s ", file_name)
Пример #4
0
 def program_fpga(file_name):
     path = tvm.get_global_func("tvm.rpc.server.workpath")(file_name)
     env = get_env()
     program_bitstream.bitstream_program(env.TARGET, path)
     logging.info("Program FPGA with %s ", file_name)