Merge pull request #721 from YosysHQ/gatecat/mistral-cmake

Updates for latest libmistral
This commit is contained in:
gatecat 2021-06-05 13:57:04 +01:00 committed by GitHub
commit 4e85203a13
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 7 additions and 17 deletions

View File

@ -19,6 +19,6 @@ function build_nextpnr {
function run_archcheck { function run_archcheck {
pushd build pushd build
./nextpnr-mistral --mistral ${MISTRAL_PATH} --device 5CEBA2F17A7 --test ./nextpnr-mistral --device 5CEBA2F17A7 --test
popd popd
} }

View File

@ -18,15 +18,11 @@ jobs:
sudo apt-get update 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 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 - name: Execute build nextpnr
env: env:
MISTRAL_PATH: ${{ github.workspace }}/deps/mistral MISTRAL_PATH: ${{ github.workspace }}/deps/mistral
MISTRAL_REVISION: 7d4e6d2cca1ec05de3be0c9fef6acaed8089d329 MISTRAL_REVISION: f22b32366d5fed997130712002c8f8de40eb42fc
run: | run: |
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
source ./.github/ci/build_mistral.sh source ./.github/ci/build_mistral.sh
get_dependencies get_dependencies
build_nextpnr build_nextpnr

View File

@ -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 "[^;]*/machxo2/chipdb/chipdb-[^;]*.cc" "" CLANGFORMAT_FILES "${CLANGFORMAT_FILES}")
string(REGEX REPLACE "[^;]*/3rdparty[^;]*" "" CLANGFORMAT_FILES "${CLANGFORMAT_FILES}") string(REGEX REPLACE "[^;]*/3rdparty[^;]*" "" CLANGFORMAT_FILES "${CLANGFORMAT_FILES}")
string(REGEX REPLACE "[^;]*/generated[^;]*" "" CLANGFORMAT_FILES "${CLANGFORMAT_FILES}") string(REGEX REPLACE "[^;]*/generated[^;]*" "" CLANGFORMAT_FILES "${CLANGFORMAT_FILES}")
string(REGEX REPLACE "[^;]*/libmistral/[^;]*" "" CLANGFORMAT_FILES "${CLANGFORMAT_FILES}")
add_custom_target( add_custom_target(
clangformat clangformat

View File

@ -46,7 +46,7 @@ void IdString::initialize_arch(const BaseCtx *ctx)
Arch::Arch(ArchArgs args) Arch::Arch(ArchArgs args)
{ {
this->args = 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); NPNR_ASSERT(this->cyclonev != nullptr);
// Setup fast identifier maps // Setup fast identifier maps

View File

@ -34,7 +34,6 @@ NEXTPNR_NAMESPACE_BEGIN
struct ArchArgs struct ArchArgs
{ {
std::string device; std::string device;
std::string mistral_root;
}; };
// These structures are used for fast ALM validity checking // These structures are used for fast ALM validity checking

View File

@ -1,13 +1,12 @@
set(MISTRAL_ROOT "" CACHE STRING "Mistral install path") set(MISTRAL_ROOT "" CACHE STRING "Mistral install path")
set(MISTRAL_DONT_INSTALL ON)
aux_source_directory(${MISTRAL_ROOT}/lib MISTRAL_LIB_FILES) add_subdirectory(${MISTRAL_ROOT}/libmistral ${CMAKE_CURRENT_BINARY_DIR}/libmistral)
add_library(mistral STATIC ${MISTRAL_LIB_FILES})
target_compile_options(mistral PRIVATE -Wno-maybe-uninitialized -Wno-uninitialized -Wno-unknown-warning-option)
find_package(LibLZMA REQUIRED) find_package(LibLZMA REQUIRED)
foreach(family_target ${family_targets}) 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}) 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) # 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) target_link_options(${family_target} PRIVATE -Wno-maybe-uninitialized -Wno-uninitialized -Wno-unknown-warning-option)

View File

@ -47,7 +47,6 @@ MistralCommandHandler::MistralCommandHandler(int argc, char **argv) : CommandHan
po::options_description MistralCommandHandler::getArchOptions() po::options_description MistralCommandHandler::getArchOptions()
{ {
po::options_description specific("Architecture specific options"); 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()("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()("qsf", po::value<std::string>(), "path to QSF constraints file");
specific.add_options()("rbf", po::value<std::string>(), "RBF bitstream to write"); 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) std::unique_ptr<Context> MistralCommandHandler::createContext(dict<std::string, Property> &values)
{ {
ArchArgs chipArgs; ArchArgs chipArgs;
if (!vm.count("mistral")) {
log_error("mistral must be specified on the command line\n");
}
if (!vm.count("device")) { if (!vm.count("device")) {
log_error("device must be specified on the command line (e.g. --device 5CSEBA6U23I7)\n"); 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>(); chipArgs.device = vm["device"].as<std::string>();
auto ctx = std::unique_ptr<Context>(new Context(chipArgs)); auto ctx = std::unique_ptr<Context>(new Context(chipArgs));
if (vm.count("compress-rbf")) if (vm.count("compress-rbf"))