[xc7] Remove hardcoded Torc path

This commit is contained in:
Eddie Hung 2019-01-06 12:29:37 -08:00
parent 1a9b2d9803
commit ef35b41e0f
2 changed files with 9 additions and 3 deletions

View File

@ -349,7 +349,9 @@ void IdString::initialize_arch(const BaseCtx *ctx)
Arch::Arch(ArchArgs args) : args(args)
{
torc::common::DirectoryTree directoryTree("/opt/torc/src/torc");
std::stringstream ss;
ss << TORC_ROOT << "/torc/src/torc";
torc::common::DirectoryTree directoryTree(ss.str().c_str());
if (args.type == ArchArgs::Z020) {
torc_info = std::unique_ptr<TorcInfo>(new TorcInfo(this, "xc7z020", args.package));
} else if (args.type == ArchArgs::VX980) {
@ -358,8 +360,10 @@ Arch::Arch(ArchArgs args) : args(args)
log_error("Unsupported XC7 chip type.\n");
}
width = torc_info->width;
height = torc_info->height;
// TODO: FIXME
width = torc_info->width;
height = torc_info->height;
/*if (getCtx()->verbose)*/ {
log_info("Number of bels: %d\n", torc_info->num_bels);
log_info("Number of wires: %d\n", torc_info->num_wires);

View File

@ -28,8 +28,10 @@ if (NOT DEFINED TORC_ROOT)
set(TORC_ROOT ${CMAKE_CURRENT_SOURCE_DIR})
endif()
target_compile_definitions(nextpnr-${family} PRIVATE -DTORC_ROOT="${TORC_ROOT}")
target_include_directories(nextpnr-${family} PUBLIC ${TORC_ROOT}/torc/src)
if (BUILD_TESTS)
target_compile_definitions(nextpnr-${family}-test PRIVATE -DTORC_ROOT="${TORC_ROOT}")
target_include_directories(nextpnr-${family}-test PUBLIC ${TORC_ROOT}/torc/src)
endif()
if (BUILD_GUI)