compile fix for gui and proper size

This commit is contained in:
Miodrag Milanovic 2018-11-28 17:59:58 +01:00
parent f2fecc3c69
commit bfa2157ae6
4 changed files with 20 additions and 6 deletions

View File

@ -120,9 +120,10 @@ if (BUILD_PYTHON)
# Original source: https://github.com/BVLC/caffe/blob/master/cmake/Dependencies.cmake#L148
set(version ${PYTHONLIBS_VERSION_STRING})
STRING(REGEX REPLACE "[^0-9]" "" boost_py_version ${version})
STRING(REGEX REPLACE "[^0-9]" "" boost_py_version ${version})
find_package(Boost QUIET COMPONENTS "python-py${boost_py_version}" ${boost_libs})
set(Boost_PYTHON_FOUND ${Boost_PYTHON-PY${boost_py_version}_FOUND})
set(boost_python_lib "python-py${boost_py_version}")
while (NOT "${version}" STREQUAL "" AND NOT Boost_PYTHON_FOUND)
STRING(REGEX REPLACE "([0-9.]+).[0-9]+" "\\1" version ${version})
@ -130,6 +131,7 @@ if (BUILD_PYTHON)
STRING(REGEX REPLACE "[^0-9]" "" boost_py_version ${version})
find_package(Boost QUIET COMPONENTS "python-py${boost_py_version}" ${boost_libs})
set(Boost_PYTHON_FOUND ${Boost_PYTHON-PY${boost_py_version}_FOUND})
set(boost_python_lib "python-py${boost_py_version}")
STRING(REGEX MATCHALL "([0-9.]+).[0-9]+" has_more_version ${version})
if ("${has_more_version}" STREQUAL "")
@ -139,6 +141,7 @@ if (BUILD_PYTHON)
if (NOT Boost_PYTHON_FOUND)
find_package(Boost QUIET COMPONENTS python3 ${boost_libs})
set(boost_python_lib python3)
if ("${Boost_LIBRARIES}" MATCHES ".*(python|PYTHON).*" )
set(Boost_PYTHON_FOUND TRUE)
endif ()
@ -146,6 +149,7 @@ if (BUILD_PYTHON)
if (NOT Boost_PYTHON_FOUND)
find_package(Boost QUIET COMPONENTS python36 ${boost_libs})
set(boost_python_lib python36)
if ("${Boost_LIBRARIES}" MATCHES ".*(python|PYTHON).*" )
set(Boost_PYTHON_FOUND TRUE)
endif ()
@ -153,6 +157,7 @@ if (BUILD_PYTHON)
if (NOT Boost_PYTHON_FOUND)
find_package(Boost QUIET COMPONENTS python37 ${boost_libs})
set(boost_python_lib python37)
if ("${Boost_LIBRARIES}" MATCHES ".*(python|PYTHON).*" )
set(Boost_PYTHON_FOUND TRUE)
endif ()
@ -161,6 +166,7 @@ if (BUILD_PYTHON)
if (NOT Boost_PYTHON_FOUND)
STRING(REGEX REPLACE "([0-9]+\\.[0-9]+).*" "\\1" gentoo_version ${PYTHONLIBS_VERSION_STRING})
find_package(Boost QUIET COMPONENTS python-${gentoo_version} ${boost_libs})
set(boost_python_lib python-${gentoo_version})
if ("${Boost_LIBRARIES}" MATCHES ".*(python|PYTHON).*" )
set(Boost_PYTHON_FOUND TRUE)
endif ()

View File

@ -289,6 +289,9 @@ TorcInfo::TorcInfo(BaseCtx *ctx, const std::string &inDeviceName, const std::str
const auto &tw = arc.getSinkTilewire();
pip_to_dst_wire.emplace_back(tilewire_to_wire(tw));
}
height = (int)tiles.getRowCount();
width = (int)tiles.getColCount();
}
TorcInfo::TorcInfo(const std::string& inDeviceName, const std::string &inPackageName)
: ddb(new DDB(inDeviceName, inPackageName)), sites(ddb->getSites()), tiles(ddb->getTiles()),
@ -332,13 +335,14 @@ Arch::Arch(ArchArgs args) : args(args)
nextpnr_binary_oarchive oa(fofs, this);
oa << torc_info;
}
}
#endif
}
} else {
log_error("Unsupported XC7 chip type.\n");
}
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

@ -322,6 +322,8 @@ struct TorcInfo
std::vector<Arc> pip_to_arc;
int num_pips;
std::vector<WireId> pip_to_dst_wire;
int width;
int height;
TorcInfo(const std::string &inDeviceName, const std::string &inPackageName);
private:
@ -497,6 +499,8 @@ struct Arch : BaseCtx
bool fast_part;
const ChipInfoPOD *chip_info;
const PackageInfoPOD *package_info;
int width;
int height;
mutable std::unordered_map<IdString, int> wire_by_name;
mutable std::unordered_map<IdString, int> pip_by_name;
@ -519,8 +523,8 @@ struct Arch : BaseCtx
// -------------------------------------------------
int getGridDimX() const { return 34; }
int getGridDimY() const { return 34; }
int getGridDimX() const { return width; }
int getGridDimY() const { return height; }
int getTileBelDimZ(int, int) const { return 8; }
int getTilePipDimZ(int, int) const { return 1; }

View File

@ -1,7 +1,7 @@
include_directories(/opt/torc/src)
#include_directories(torc/externals/zlib)
find_package(Boost REQUIRED COMPONENTS serialization iostreams ${boost_libs})
find_package(Boost REQUIRED COMPONENTS serialization iostreams ${boost_libs} ${boost_python_lib})
target_link_libraries(
nextpnr-${family}