diff --git a/.github/ci/build_interchange.sh b/.github/ci/build_interchange.sh index ed6e82bd..8168d519 100755 --- a/.github/ci/build_interchange.sh +++ b/.github/ci/build_interchange.sh @@ -57,7 +57,7 @@ function build_nextpnr { build_capnp mkdir build pushd build - cmake .. -DARCH=fpga_interchange -DRAPIDWRIGHT_PATH=${RAPIDWRIGHT_PATH} -DPYTHON_INTERCHANGE_PATH=${PYTHON_INTERCHANGE_PATH} -DUSE_ABSEIL=on + cmake .. -DARCH=fpga_interchange -DRAPIDWRIGHT_PATH=${RAPIDWRIGHT_PATH} -DPYTHON_INTERCHANGE_PATH=${PYTHON_INTERCHANGE_PATH} make nextpnr-fpga_interchange -j`nproc` popd } diff --git a/.gitmodules b/.gitmodules index c0c178bf..a22fbc41 100644 --- a/.gitmodules +++ b/.gitmodules @@ -4,6 +4,3 @@ [submodule "fpga-interchange-schema"] path = 3rdparty/fpga-interchange-schema url = https://github.com/SymbiFlow/fpga-interchange-schema.git -[submodule "3rdparty/abseil-cpp"] - path = 3rdparty/abseil-cpp - url = https://github.com/abseil/abseil-cpp.git diff --git a/3rdparty/abseil-cpp b/3rdparty/abseil-cpp deleted file mode 160000 index a7669879..00000000 --- a/3rdparty/abseil-cpp +++ /dev/null @@ -1 +0,0 @@ -Subproject commit a76698790753d2ec71f655cdc84d61bcb27780d4 diff --git a/CMakeLists.txt b/CMakeLists.txt index 233d5797..42d55a97 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,7 +20,6 @@ option(EXTERNAL_CHIPDB "Create build with pre-built chipdb binaries" OFF) option(WERROR "pass -Werror to compiler (used for CI)" OFF) option(PROFILER "Link against libprofiler" OFF) option(USE_IPO "Compile nextpnr with IPO" ON) -option(USE_ABSEIL "Compile nextpnr with Abseil for faster hash map" OFF) if (USE_IPO) if (ipo_supported) @@ -199,10 +198,6 @@ if (NOT DEFINED CURRENT_GIT_VERSION) ) endif() -if (USE_ABSEIL) - add_subdirectory(3rdparty/abseil-cpp EXCLUDE_FROM_ALL) -endif() - if (BUILD_TESTS) add_subdirectory(3rdparty/googletest/googletest ${CMAKE_CURRENT_BINARY_DIR}/generated/3rdparty/googletest EXCLUDE_FROM_ALL) enable_testing() @@ -252,13 +247,7 @@ else() endif() set(EXTRA_LIB_DEPS) -if (USE_ABSEIL) - if (NOT USE_THREADS) - message(FATAL_ERROR "Abseil without threads is not supported") - endif() - list(APPEND EXTRA_LIB_DEPS absl::flat_hash_map) - list(APPEND EXTRA_LIB_DEPS absl::flat_hash_set) -endif() + if(PROFILER) list(APPEND EXTRA_LIB_DEPS profiler) endif() @@ -336,9 +325,6 @@ foreach (family ${ARCH}) target_compile_definitions(${target} PRIVATE QT_NO_KEYWORDS) target_link_libraries(${target} LINK_PUBLIC gui_${family} ${GUI_LIBRARY_FILES_${ufamily}}) endif() - if (USE_ABSEIL) - target_compile_definitions(${target} PRIVATE USE_ABSEIL) - endif() if (BUILD_PYTHON) target_link_libraries(${target} LINK_PUBLIC ${PYTHON_LIBRARIES}) if (STATIC_BUILD) diff --git a/common/base_arch.h b/common/base_arch.h index c7d9f380..457e6582 100644 --- a/common/base_arch.h +++ b/common/base_arch.h @@ -148,7 +148,7 @@ template struct BaseArch : ArchAPI virtual char getNameDelimiter() const override { return ' '; } // Bel methods - virtual uint32_t getBelChecksum(BelId bel) const override { return uint32_t(std::hash()(bel)); } + virtual uint32_t getBelChecksum(BelId bel) const override { return bel.hash(); } virtual void bindBel(BelId bel, CellInfo *cell, PlaceStrength strength) override { NPNR_ASSERT(bel != BelId()); @@ -196,7 +196,7 @@ template struct BaseArch : ArchAPI { return empty_if_possible(); } - virtual uint32_t getWireChecksum(WireId wire) const override { return uint32_t(std::hash()(wire)); } + virtual uint32_t getWireChecksum(WireId wire) const override { return wire.hash(); } virtual void bindWire(WireId wire, NetInfo *net, PlaceStrength strength) override { @@ -244,7 +244,7 @@ template struct BaseArch : ArchAPI { return empty_if_possible(); } - virtual uint32_t getPipChecksum(PipId pip) const override { return uint32_t(std::hash()(pip)); } + virtual uint32_t getPipChecksum(PipId pip) const override { return pip.hash(); } virtual void bindPip(PipId pip, NetInfo *net, PlaceStrength strength) override { NPNR_ASSERT(pip != PipId()); diff --git a/common/hash_table.h b/common/hash_table.h deleted file mode 100644 index 21ca8887..00000000 --- a/common/hash_table.h +++ /dev/null @@ -1,63 +0,0 @@ -/* - * nextpnr -- Next Generation Place and Route - * - * Copyright (C) 2021 Symbiflow Authors - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * - */ - -#ifndef HASH_TABLE_H -#define HASH_TABLE_H - -#if defined(USE_ABSEIL) -#include -#include -#else -#include -#include -#endif - -#include - -#include "nextpnr_namespaces.h" - -NEXTPNR_NAMESPACE_BEGIN - -namespace HashTables { -#if defined(USE_ABSEIL) -template > -using HashMap = absl::flat_hash_map; -template > using HashSet = absl::flat_hash_set; -#else -template > -using HashMap = std::unordered_map; -template > using HashSet = std::unordered_set; -#endif - -}; // namespace HashTables - -struct PairHash -{ - template std::size_t operator()(const std::pair &idp) const noexcept - { - std::size_t seed = 0; - boost::hash_combine(seed, std::hash()(idp.first)); - boost::hash_combine(seed, std::hash()(idp.second)); - return seed; - } -}; - -NEXTPNR_NAMESPACE_END - -#endif /* HASH_TABLE_H */ diff --git a/common/idstring.h b/common/idstring.h index aba40ae6..5a7719fa 100644 --- a/common/idstring.h +++ b/common/idstring.h @@ -62,14 +62,4 @@ struct IdString NEXTPNR_NAMESPACE_END -namespace std { -template <> struct hash -{ - std::size_t operator()(const NEXTPNR_NAMESPACE_PREFIX IdString &obj) const noexcept - { - return std::hash()(obj.index); - } -}; -} // namespace std - #endif /* IDSTRING_H */ diff --git a/common/idstringlist.h b/common/idstringlist.h index 753b408c..f101ecca 100644 --- a/common/idstringlist.h +++ b/common/idstringlist.h @@ -80,18 +80,4 @@ struct IdStringList NEXTPNR_NAMESPACE_END -namespace std { -template <> struct hash -{ - std::size_t operator()(const NEXTPNR_NAMESPACE_PREFIX IdStringList &obj) const noexcept - { - std::size_t seed = 0; - boost::hash_combine(seed, hash()(obj.size())); - for (auto &id : obj) - boost::hash_combine(seed, hash()(id)); - return seed; - } -}; -} // namespace std - #endif /* IDSTRING_LIST_H */ diff --git a/common/nextpnr_base_types.h b/common/nextpnr_base_types.h index ba1af68c..1707559b 100644 --- a/common/nextpnr_base_types.h +++ b/common/nextpnr_base_types.h @@ -130,19 +130,4 @@ enum PlaceStrength NEXTPNR_NAMESPACE_END -namespace std { -template <> struct hash -{ - std::size_t operator()(const NEXTPNR_NAMESPACE_PREFIX Loc &obj) const noexcept - { - std::size_t seed = 0; - boost::hash_combine(seed, hash()(obj.x)); - boost::hash_combine(seed, hash()(obj.y)); - boost::hash_combine(seed, hash()(obj.z)); - return seed; - } -}; - -} // namespace std - #endif /* NEXTPNR_BASE_TYPES_H */ diff --git a/common/placer1.cc b/common/placer1.cc index e8c6aa64..a832e08f 100644 --- a/common/placer1.cc +++ b/common/placer1.cc @@ -46,19 +46,6 @@ #include "timing.h" #include "util.h" -namespace std { -template <> struct hash> -{ - std::size_t operator()(const std::pair &idp) const noexcept - { - std::size_t seed = 0; - boost::hash_combine(seed, hash()(idp.first)); - boost::hash_combine(seed, hash()(idp.second)); - return seed; - } -}; -} // namespace std - NEXTPNR_NAMESPACE_BEGIN class SAPlacer diff --git a/common/util.h b/common/util.h index b3e8cbf0..542bd395 100644 --- a/common/util.h +++ b/common/util.h @@ -102,42 +102,6 @@ bool bool_or_default(const Container &ct, const KeyType &key, bool def = false) return bool(int_or_default(ct, key, int(def))); }; -// Wrap an unordered_map, and allow it to be iterated over sorted by key -template std::map sorted(const std::unordered_map> &orig) -{ - std::map retVal; - for (auto &item : orig) - retVal.emplace(std::make_pair(item.first, item.second.get())); - return retVal; -}; - -// Wrap an unordered_map, and allow it to be iterated over sorted by key -template std::map sorted_ref(std::unordered_map &orig) -{ - std::map retVal; - for (auto &item : orig) - retVal.emplace(std::make_pair(item.first, std::ref(item.second))); - return retVal; -}; - -// Wrap an unordered_map, and allow it to be iterated over sorted by key -template std::map sorted_cref(const std::unordered_map &orig) -{ - std::map retVal; - for (auto &item : orig) - retVal.emplace(std::make_pair(item.first, std::ref(item.second))); - return retVal; -}; - -// Wrap an unordered_set, and allow it to be iterated over sorted by key -template std::set sorted(const std::unordered_set &orig) -{ - std::set retVal; - for (auto &item : orig) - retVal.insert(item); - return retVal; -}; - // Return a net if port exists, or nullptr inline const NetInfo *get_net_or_empty(const CellInfo *cell, const IdString port) { diff --git a/docs/archapi.md b/docs/archapi.md index 80aa1d96..f2571f08 100644 --- a/docs/archapi.md +++ b/docs/archapi.md @@ -171,7 +171,7 @@ Returns true if the given bel is a global buffer. A global buffer does not "pull Return a (preferably unique) number that represents this bel. This is used in design state checksum calculations. -*BaseArch default: returns `std::hash` of `BelId` cast to `uint32_t`* +*BaseArch default: returns `bel.hash()`* ### void bindBel(BelId bel, CellInfo \*cell, PlaceStrength strength) @@ -276,7 +276,7 @@ unused. An implementation may simply return an empty range. Return a (preferably unique) number that represents this wire. This is used in design state checksum calculations. -*BaseArch default: returns `std::hash` of `WireId` cast to `uint32_t`* +*BaseArch default: returns `wire.hash()`* ### void bindWire(WireId wire, NetInfo \*net, PlaceStrength strength) @@ -374,7 +374,7 @@ for pips a X/Y/Z location refers to a group of pips, not an individual pip. Return a (preferably unique) number that represents this pip. This is used in design state checksum calculations. -*BaseArch default: returns `std::hash` of `WireId` cast to `uint32_t`* +*BaseArch default: returns `pip.hash()`* ### void bindPip(PipId pip, NetInfo \*net, PlaceStrength strength) diff --git a/ecp5/archdefs.h b/ecp5/archdefs.h index 57168af3..6243a9df 100644 --- a/ecp5/archdefs.h +++ b/ecp5/archdefs.h @@ -21,8 +21,6 @@ #ifndef ECP5_ARCHDEFS_H #define ECP5_ARCHDEFS_H -#include - #include "base_clusterinfo.h" #include "hashlib.h" #include "idstring.h" @@ -187,72 +185,4 @@ struct ArchCellInfo : BaseClusterInfo }; NEXTPNR_NAMESPACE_END - -namespace std { -template <> struct hash -{ - std::size_t operator()(const NEXTPNR_NAMESPACE_PREFIX Location &loc) const noexcept - { - std::size_t seed = std::hash()(loc.x); - seed ^= std::hash()(loc.y) + 0x9e3779b9 + (seed << 6) + (seed >> 2); - return seed; - } -}; - -template <> struct hash -{ - std::size_t operator()(const NEXTPNR_NAMESPACE_PREFIX BelId &bel) const noexcept - { - std::size_t seed = std::hash()(bel.location); - seed ^= std::hash()(bel.index) + 0x9e3779b9 + (seed << 6) + (seed >> 2); - return seed; - } -}; - -template <> struct hash -{ - std::size_t operator()(const NEXTPNR_NAMESPACE_PREFIX WireId &wire) const noexcept - { - std::size_t seed = std::hash()(wire.location); - seed ^= std::hash()(wire.index) + 0x9e3779b9 + (seed << 6) + (seed >> 2); - return seed; - } -}; - -template <> struct hash -{ - std::size_t operator()(const NEXTPNR_NAMESPACE_PREFIX PipId &pip) const noexcept - { - std::size_t seed = std::hash()(pip.location); - seed ^= std::hash()(pip.index) + 0x9e3779b9 + (seed << 6) + (seed >> 2); - return seed; - } -}; - -template <> struct hash -{ - std::size_t operator()(const NEXTPNR_NAMESPACE_PREFIX GroupId &group) const noexcept - { - std::size_t seed = 0; - boost::hash_combine(seed, hash()(group.type)); - boost::hash_combine(seed, hash()(group.location)); - return seed; - } -}; - -template <> struct hash -{ - std::size_t operator()(const NEXTPNR_NAMESPACE_PREFIX DecalId &decal) const noexcept - { - std::size_t seed = 0; - boost::hash_combine(seed, hash()(decal.type)); - boost::hash_combine(seed, hash()(decal.location)); - boost::hash_combine(seed, hash()(decal.z)); - boost::hash_combine(seed, hash()(decal.active)); - return seed; - } -}; - -} // namespace std - #endif /* ECP5_ARCHDEFS_H */ diff --git a/fpga_interchange/archdefs.h b/fpga_interchange/archdefs.h index 2d27cccf..a50df43a 100644 --- a/fpga_interchange/archdefs.h +++ b/fpga_interchange/archdefs.h @@ -21,7 +21,6 @@ #ifndef FPGA_INTERCHANGE_ARCHDEFS_H #define FPGA_INTERCHANGE_ARCHDEFS_H -#include #include #include "hashlib.h" @@ -126,68 +125,4 @@ struct ArchCellInfo NEXTPNR_NAMESPACE_END -namespace std { -template <> struct hash -{ - std::size_t operator()(const NEXTPNR_NAMESPACE_PREFIX BelId &bel) const noexcept - { - std::size_t seed = 0; - boost::hash_combine(seed, hash()(bel.tile)); - boost::hash_combine(seed, hash()(bel.index)); - return seed; - } -}; - -template <> struct hash -{ - std::size_t operator()(const NEXTPNR_NAMESPACE_PREFIX WireId &wire) const noexcept - { - std::size_t seed = 0; - boost::hash_combine(seed, hash()(wire.tile)); - boost::hash_combine(seed, hash()(wire.index)); - return seed; - } -}; - -template <> struct hash -{ - std::size_t operator()(const NEXTPNR_NAMESPACE_PREFIX PipId &pip) const noexcept - { - std::size_t seed = 0; - boost::hash_combine(seed, hash()(pip.tile)); - boost::hash_combine(seed, hash()(pip.index)); - return seed; - } -}; - -template <> struct hash -{ - std::size_t operator()(const NEXTPNR_NAMESPACE_PREFIX GroupId &group) const noexcept - { - std::size_t seed = 0; - return seed; - } -}; - -template <> struct hash -{ - std::size_t operator()(const NEXTPNR_NAMESPACE_PREFIX DecalId &decal) const noexcept - { - std::size_t seed = 0; - return seed; - } -}; - -template <> struct hash -{ - std::size_t operator()(const NEXTPNR_NAMESPACE_PREFIX BelBucketId &bucket) const noexcept - { - std::size_t seed = 0; - boost::hash_combine(seed, hash()(bucket.name)); - return seed; - } -}; - -} // namespace std - #endif /* FPGA_INTERCHANGE_ARCHDEFS_H */ diff --git a/frontend/frontend_base.h b/frontend/frontend_base.h index 4fb71076..bc85fabb 100644 --- a/frontend/frontend_base.h +++ b/frontend/frontend_base.h @@ -134,7 +134,7 @@ template struct GenericFrontend m.path = top; ctx->top_module = top; // Do the actual import, starting from the top level module - import_module(m, top.str(ctx), top.str(ctx), mod_refs.at(top)); + import_module(m, top.str(ctx), top.str(ctx), mod_refs.at(top.str(ctx))); ctx->design_loaded = true; } @@ -149,7 +149,7 @@ template struct GenericFrontend using bitvector_t = typename FrontendType::BitVectorDataType; dict mods; - std::unordered_map mod_refs; + std::unordered_map mod_refs; IdString top; // Process the list of modules and determine @@ -159,7 +159,7 @@ template struct GenericFrontend impl.foreach_module([&](const std::string &name, const mod_dat_t &mod) { IdString mod_id = ctx->id(name); auto &mi = mods[mod_id]; - mod_refs.emplace(mod_id, mod); + mod_refs.emplace(name, mod); impl.foreach_attr(mod, [&](const std::string &name, const Property &value) { if (name == "top") mi.is_top = (value.intval != 0); @@ -531,7 +531,7 @@ template struct GenericFrontend ctx->hierarchy[m.path].hier_cells[ctx->id(name)] = submod.path; // Do the submodule import auto type = impl.get_cell_type(cd); - import_module(submod, name, type, mod_refs.at(ctx->id(type))); + import_module(submod, name, type, mod_refs.at(type)); } // Import the cells section of a module diff --git a/gui/CMakeLists.txt b/gui/CMakeLists.txt index 21d0c1e0..1deffcfb 100644 --- a/gui/CMakeLists.txt +++ b/gui/CMakeLists.txt @@ -40,10 +40,6 @@ endif() target_compile_definitions(gui_${family} PRIVATE NEXTPNR_NAMESPACE=nextpnr_${family} ARCH_${ufamily} ARCHNAME=${family} QT_NO_KEYWORDS) -if (USE_ABSEIL) - target_compile_definitions(gui_${family} PRIVATE USE_ABSEIL) -endif() - target_link_libraries(gui_${family} Qt5::Widgets) foreach(lib_dep ${EXTRA_LIB_DEPS}) diff --git a/ice40/archdefs.h b/ice40/archdefs.h index 2d962851..6ef5432f 100644 --- a/ice40/archdefs.h +++ b/ice40/archdefs.h @@ -20,8 +20,6 @@ #ifndef ICE40_ARCHDEFS_H #define ICE40_ARCHDEFS_H -#include - #include "base_clusterinfo.h" #include "hashlib.h" #include "idstring.h" @@ -165,48 +163,4 @@ typedef IdString ClusterId; NEXTPNR_NAMESPACE_END -namespace std { -template <> struct hash -{ - std::size_t operator()(const NEXTPNR_NAMESPACE_PREFIX BelId &bel) const noexcept { return hash()(bel.index); } -}; - -template <> struct hash -{ - std::size_t operator()(const NEXTPNR_NAMESPACE_PREFIX WireId &wire) const noexcept - { - return hash()(wire.index); - } -}; - -template <> struct hash -{ - std::size_t operator()(const NEXTPNR_NAMESPACE_PREFIX PipId &pip) const noexcept { return hash()(pip.index); } -}; - -template <> struct hash -{ - std::size_t operator()(const NEXTPNR_NAMESPACE_PREFIX GroupId &group) const noexcept - { - std::size_t seed = 0; - boost::hash_combine(seed, hash()(group.type)); - boost::hash_combine(seed, hash()(group.x)); - boost::hash_combine(seed, hash()(group.y)); - return seed; - } -}; - -template <> struct hash -{ - std::size_t operator()(const NEXTPNR_NAMESPACE_PREFIX DecalId &decal) const noexcept - { - std::size_t seed = 0; - boost::hash_combine(seed, hash()(decal.type)); - boost::hash_combine(seed, hash()(decal.index)); - return seed; - } -}; - -} // namespace std - #endif /* ICE40_ARCHDEFS_H */ diff --git a/machxo2/archdefs.h b/machxo2/archdefs.h index afcc72aa..de633673 100644 --- a/machxo2/archdefs.h +++ b/machxo2/archdefs.h @@ -124,47 +124,4 @@ struct ArchCellInfo : BaseClusterInfo NEXTPNR_NAMESPACE_END -namespace std { -template <> struct hash -{ - std::size_t operator()(const NEXTPNR_NAMESPACE_PREFIX Location &loc) const noexcept - { - std::size_t seed = std::hash()(loc.x); - seed ^= std::hash()(loc.y) + 0x9e3779b9 + (seed << 6) + (seed >> 2); - return seed; - } -}; - -template <> struct hash -{ - std::size_t operator()(const NEXTPNR_NAMESPACE_PREFIX BelId &bel) const noexcept - { - std::size_t seed = std::hash()(bel.location); - seed ^= std::hash()(bel.index) + 0x9e3779b9 + (seed << 6) + (seed >> 2); - return seed; - } -}; - -template <> struct hash -{ - std::size_t operator()(const NEXTPNR_NAMESPACE_PREFIX WireId &wire) const noexcept - { - std::size_t seed = std::hash()(wire.location); - seed ^= std::hash()(wire.index) + 0x9e3779b9 + (seed << 6) + (seed >> 2); - return seed; - } -}; - -template <> struct hash -{ - std::size_t operator()(const NEXTPNR_NAMESPACE_PREFIX PipId &pip) const noexcept - { - std::size_t seed = std::hash()(pip.location); - seed ^= std::hash()(pip.index) + 0x9e3779b9 + (seed << 6) + (seed >> 2); - return seed; - } -}; - -} // namespace std - #endif /* MACHXO2_ARCHDEFS_H */ diff --git a/mistral/archdefs.h b/mistral/archdefs.h index 71e14ec2..8b4256ab 100644 --- a/mistral/archdefs.h +++ b/mistral/archdefs.h @@ -20,8 +20,6 @@ #ifndef MISTRAL_ARCHDEFS_H #define MISTRAL_ARCHDEFS_H -#include - #include "base_clusterinfo.h" #include "cyclonev.h" @@ -30,6 +28,8 @@ #include "nextpnr_assertions.h" #include "nextpnr_namespaces.h" +#include + NEXTPNR_NAMESPACE_BEGIN using mistral::CycloneV; @@ -210,31 +210,4 @@ struct ArchCellInfo : BaseClusterInfo NEXTPNR_NAMESPACE_END -namespace std { -template <> struct hash -{ - std::size_t operator()(const NEXTPNR_NAMESPACE_PREFIX BelId &bel) const noexcept - { - return hash()((static_cast(bel.pos) << 16) | bel.z); - } -}; - -template <> struct hash -{ - std::size_t operator()(const NEXTPNR_NAMESPACE_PREFIX WireId &wire) const noexcept - { - return hash()(wire.node); - } -}; - -template <> struct hash -{ - std::size_t operator()(const NEXTPNR_NAMESPACE_PREFIX PipId &pip) const noexcept - { - return hash()((uint64_t(pip.dst) << 32) | pip.src); - } -}; - -} // namespace std - #endif diff --git a/nexus/archdefs.h b/nexus/archdefs.h index 76ba605b..f2b5a45d 100644 --- a/nexus/archdefs.h +++ b/nexus/archdefs.h @@ -20,8 +20,6 @@ #ifndef NEXUS_ARCHDEFS_H #define NEXUS_ARCHDEFS_H -#include - #include "base_clusterinfo.h" #include "hashlib.h" #include "idstring.h" @@ -188,63 +186,4 @@ struct ArchCellInfo : BaseClusterInfo NEXTPNR_NAMESPACE_END -namespace std { -template <> struct hash -{ - std::size_t operator()(const NEXTPNR_NAMESPACE_PREFIX BelId &bel) const noexcept - { - std::size_t seed = 0; - boost::hash_combine(seed, hash()(bel.tile)); - boost::hash_combine(seed, hash()(bel.index)); - return seed; - } -}; - -template <> struct hash -{ - std::size_t operator()(const NEXTPNR_NAMESPACE_PREFIX WireId &wire) const noexcept - { - std::size_t seed = 0; - boost::hash_combine(seed, hash()(wire.tile)); - boost::hash_combine(seed, hash()(wire.index)); - return seed; - } -}; - -template <> struct hash -{ - std::size_t operator()(const NEXTPNR_NAMESPACE_PREFIX PipId &pip) const noexcept - { - std::size_t seed = 0; - boost::hash_combine(seed, hash()(pip.tile)); - boost::hash_combine(seed, hash()(pip.index)); - return seed; - } -}; - -template <> struct hash -{ - std::size_t operator()(const NEXTPNR_NAMESPACE_PREFIX GroupId &group) const noexcept - { - std::size_t seed = 0; - boost::hash_combine(seed, hash()(group.type)); - boost::hash_combine(seed, hash()(group.x)); - boost::hash_combine(seed, hash()(group.y)); - return seed; - } -}; - -template <> struct hash -{ - std::size_t operator()(const NEXTPNR_NAMESPACE_PREFIX DecalId &decal) const noexcept - { - std::size_t seed = 0; - boost::hash_combine(seed, hash()(decal.type)); - boost::hash_combine(seed, hash()(decal.index)); - return seed; - } -}; - -} // namespace std - #endif /* NEXUS_ARCHDEFS_H */