aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgatecat <gatecat@ds0.me>2021-06-05 13:57:04 +0100
committerGitHub <noreply@github.com>2021-06-05 13:57:04 +0100
commit4e85203a1360661b03771800d9f4ddcacb002ecf (patch)
tree935488cadca1186ce65ef70dd75c960cff984fce
parenta3d8b4f9d198226ec0903e34a8d290b376b45c0b (diff)
parentbcc5158eab5910392fa6dd4f11d626f7cbcd00c7 (diff)
downloadnextpnr-4e85203a1360661b03771800d9f4ddcacb002ecf.tar.gz
nextpnr-4e85203a1360661b03771800d9f4ddcacb002ecf.tar.bz2
nextpnr-4e85203a1360661b03771800d9f4ddcacb002ecf.zip
Merge pull request #721 from YosysHQ/gatecat/mistral-cmake
Updates for latest libmistral
-rw-r--r--.github/ci/build_mistral.sh2
-rw-r--r--.github/workflows/mistral_ci.yml6
-rw-r--r--CMakeLists.txt1
-rw-r--r--mistral/arch.cc2
-rw-r--r--mistral/arch.h1
-rw-r--r--mistral/family.cmake7
-rw-r--r--mistral/main.cc5
7 files changed, 7 insertions, 17 deletions
diff --git a/.github/ci/build_mistral.sh b/.github/ci/build_mistral.sh
index 7046462f..3c809b0e 100644
--- a/.github/ci/build_mistral.sh
+++ b/.github/ci/build_mistral.sh
@@ -19,6 +19,6 @@ function build_nextpnr {
function run_archcheck {
pushd build
- ./nextpnr-mistral --mistral ${MISTRAL_PATH} --device 5CEBA2F17A7 --test
+ ./nextpnr-mistral --device 5CEBA2F17A7 --test
popd
}
diff --git a/.github/workflows/mistral_ci.yml b/.github/workflows/mistral_ci.yml
index 877e374d..bc000b46 100644
--- a/.github/workflows/mistral_ci.yml
+++ b/.github/workflows/mistral_ci.yml
@@ -18,15 +18,11 @@ jobs:
sudo apt-get update
sudo apt-get install git make cmake libboost-all-dev python3-dev libeigen3-dev tcl-dev lzma-dev clang bison flex swig
- - name: ccache
- uses: hendrikmuhs/ccache-action@v1
-
- name: Execute build nextpnr
env:
MISTRAL_PATH: ${{ github.workspace }}/deps/mistral
- MISTRAL_REVISION: 7d4e6d2cca1ec05de3be0c9fef6acaed8089d329
+ MISTRAL_REVISION: f22b32366d5fed997130712002c8f8de40eb42fc
run: |
- export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
source ./.github/ci/build_mistral.sh
get_dependencies
build_nextpnr
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 42d55a97..58b0fead 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -346,6 +346,7 @@ string(REGEX REPLACE "[^;]*nexus/chipdb/chipdb-[^;]*.cc" "" CLANGFORMAT_FILES "$
string(REGEX REPLACE "[^;]*/machxo2/chipdb/chipdb-[^;]*.cc" "" CLANGFORMAT_FILES "${CLANGFORMAT_FILES}")
string(REGEX REPLACE "[^;]*/3rdparty[^;]*" "" CLANGFORMAT_FILES "${CLANGFORMAT_FILES}")
string(REGEX REPLACE "[^;]*/generated[^;]*" "" CLANGFORMAT_FILES "${CLANGFORMAT_FILES}")
+string(REGEX REPLACE "[^;]*/libmistral/[^;]*" "" CLANGFORMAT_FILES "${CLANGFORMAT_FILES}")
add_custom_target(
clangformat
diff --git a/mistral/arch.cc b/mistral/arch.cc
index 70e8f806..ba7483e7 100644
--- a/mistral/arch.cc
+++ b/mistral/arch.cc
@@ -46,7 +46,7 @@ void IdString::initialize_arch(const BaseCtx *ctx)
Arch::Arch(ArchArgs args)
{
this->args = args;
- this->cyclonev = mistral::CycloneV::get_model(args.device, args.mistral_root);
+ this->cyclonev = mistral::CycloneV::get_model(args.device);
NPNR_ASSERT(this->cyclonev != nullptr);
// Setup fast identifier maps
diff --git a/mistral/arch.h b/mistral/arch.h
index 1a42530a..c00ee2a7 100644
--- a/mistral/arch.h
+++ b/mistral/arch.h
@@ -34,7 +34,6 @@ NEXTPNR_NAMESPACE_BEGIN
struct ArchArgs
{
std::string device;
- std::string mistral_root;
};
// These structures are used for fast ALM validity checking
diff --git a/mistral/family.cmake b/mistral/family.cmake
index 552c64ae..a18b5b27 100644
--- a/mistral/family.cmake
+++ b/mistral/family.cmake
@@ -1,13 +1,12 @@
set(MISTRAL_ROOT "" CACHE STRING "Mistral install path")
+set(MISTRAL_DONT_INSTALL ON)
-aux_source_directory(${MISTRAL_ROOT}/lib MISTRAL_LIB_FILES)
-add_library(mistral STATIC ${MISTRAL_LIB_FILES})
-target_compile_options(mistral PRIVATE -Wno-maybe-uninitialized -Wno-uninitialized -Wno-unknown-warning-option)
+add_subdirectory(${MISTRAL_ROOT}/libmistral ${CMAKE_CURRENT_BINARY_DIR}/libmistral)
find_package(LibLZMA REQUIRED)
foreach(family_target ${family_targets})
- target_include_directories(${family_target} PRIVATE ${MISTRAL_ROOT}/lib ${LIBLZMA_INCLUDE_DIRS})
+ target_include_directories(${family_target} PRIVATE ${MISTRAL_ROOT}/libmistral ${LIBLZMA_INCLUDE_DIRS})
target_link_libraries(${family_target} PRIVATE mistral ${LIBLZMA_LIBRARIES})
# Currently required to avoid issues with mistral (LTO means the warnings can end up in nextpnr)
target_link_options(${family_target} PRIVATE -Wno-maybe-uninitialized -Wno-uninitialized -Wno-unknown-warning-option)
diff --git a/mistral/main.cc b/mistral/main.cc
index 0afba3d8..bd9ef591 100644
--- a/mistral/main.cc
+++ b/mistral/main.cc
@@ -47,7 +47,6 @@ MistralCommandHandler::MistralCommandHandler(int argc, char **argv) : CommandHan
po::options_description MistralCommandHandler::getArchOptions()
{
po::options_description specific("Architecture specific options");
- specific.add_options()("mistral", po::value<std::string>(), "path to mistral root");
specific.add_options()("device", po::value<std::string>(), "device name (e.g. 5CSEBA6U23I7)");
specific.add_options()("qsf", po::value<std::string>(), "path to QSF constraints file");
specific.add_options()("rbf", po::value<std::string>(), "RBF bitstream to write");
@@ -74,13 +73,9 @@ void MistralCommandHandler::customBitstream(Context *ctx)
std::unique_ptr<Context> MistralCommandHandler::createContext(dict<std::string, Property> &values)
{
ArchArgs chipArgs;
- if (!vm.count("mistral")) {
- log_error("mistral must be specified on the command line\n");
- }
if (!vm.count("device")) {
log_error("device must be specified on the command line (e.g. --device 5CSEBA6U23I7)\n");
}
- chipArgs.mistral_root = vm["mistral"].as<std::string>();
chipArgs.device = vm["device"].as<std::string>();
auto ctx = std::unique_ptr<Context>(new Context(chipArgs));
if (vm.count("compress-rbf"))