Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[VTA] Improved RPC for VTA #2043

Merged
merged 10 commits into from
Nov 12, 2018
10 changes: 5 additions & 5 deletions vta/python/vta/exec/rpc_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ def reconfig_runtime(cfg_json):
ldflags = pkg.ldflags
lib_name = dll_path
source = pkg.lib_source
logging.info("Rebuild runtime: output=%s, cflags=%s, source=%s, ldflags=%s",
dll_path, str(cflags), str(source), str(ldflags))
logging.info("Rebuild runtime:\n output=%s,\n cflags=%s,\n source=%s,\n ldflags=%s",
dll_path, '\n\t'.join(cflags), '\n\t'.join(source), '\n\t'.join(ldflags))
cc.create_shared(lib_name, source, cflags + ldflags)
with open(cfg_path, "w") as outputfile:
outputfile.write(pkg.cfg_json)
Expand All @@ -99,10 +99,10 @@ def main():
parser = argparse.ArgumentParser()
parser.add_argument('--host', type=str, default="0.0.0.0",
help='the hostname of the server')
parser.add_argument('--port', type=int, default=9090,
help='The port of the PRC')
parser.add_argument('--port', type=int, default=9091,
help='The port of the RPC')
parser.add_argument('--port-end', type=int, default=9199,
help='The end search port of the PRC')
help='The end search port of the RPC')
parser.add_argument('--key', type=str, default="",
help="RPC key used to identify the connection type.")
parser.add_argument('--tracker', type=str, default="",
Expand Down
3 changes: 2 additions & 1 deletion vta/python/vta/libinfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,6 @@ def find_libvta(optional=False):
lib_path = [os.path.join(x, lib_name) for x in lib_search]
lib_found = [x for x in lib_path if os.path.exists(x)]
if not lib_found and not optional:
raise RuntimeError("Cannot find libvta: candidates are: " % str(lib_path))
raise RuntimeError('Cannot find the files.\n' +
'List of candidates:\n' + str('\n'.join(lib_path)))
return lib_found
14 changes: 7 additions & 7 deletions vta/tests/hardware/common/test_lib.cc
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@ uint64_t vta(
void* vta_store_handle = VTAMapRegister(VTA_STORE_ADDR, VTA_RANGE);

// Physical address pointers
uint32_t insn_phy = insns ? cma_get_phy_addr(insns) : 0;
uint32_t uop_phy = uops ? cma_get_phy_addr(uops) : 0;
uint32_t input_phy = inputs ? cma_get_phy_addr(inputs) : 0;
uint32_t weight_phy = weights ? cma_get_phy_addr(weights) : 0;
uint32_t bias_phy = biases ? cma_get_phy_addr(biases) : 0;
uint32_t output_phy = outputs ? cma_get_phy_addr(outputs) : 0;
uint32_t insn_phy = insns ? VTAMemGetPhyAddr(insns) : 0;
uint32_t uop_phy = uops ? VTAMemGetPhyAddr(uops) : 0;
uint32_t input_phy = inputs ? VTAMemGetPhyAddr(inputs) : 0;
uint32_t weight_phy = weights ? VTAMemGetPhyAddr(weights) : 0;
uint32_t bias_phy = biases ? VTAMemGetPhyAddr(biases) : 0;
uint32_t output_phy = outputs ? VTAMemGetPhyAddr(outputs) : 0;

#if VTA_DEBUG == 1
printf("INFO - Starting FPGA!\n");
Expand Down Expand Up @@ -1453,4 +1453,4 @@ int gemm_test(int batch, int in_channels, int out_channels, bool uop_compression
printf("INFO - Blocked GEMM test failed, got %d errors!\n", err);
return -1;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ OBJECTS = pynq_driver.o test_lib.o metal_test.o
EXECUTABLE = vta

# Include VTA config
VTA_CONFIG = python ../../../make/vta_config.py
VTA_CONFIG = python ../../../config/vta_config.py
CFLAGS += `${VTA_CONFIG} --cflags`
LDFLAGS += `${VTA_CONFIG} --ldflags`
VTA_TARGET := $(shell ${VTA_CONFIG} --target)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
#include <string.h>
#include <time.h>
#include <vta/driver.h>
#include "../../../src/pynq/pynq_driver.h"
#ifdef VTA_TARGET_PYNQ
# include "../../../src/pynq/pynq_driver.h"
#endif // VTA_TARGET_PYNQ
#include "../common/test_lib.h"

int main(void) {
Expand Down