aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-x.github/ci/build_interchange.sh2
-rw-r--r--.gitmodules3
m---------3rdparty/abseil-cpp0
-rw-r--r--CMakeLists.txt16
-rw-r--r--common/base_arch.h6
-rw-r--r--common/hash_table.h63
-rw-r--r--common/idstring.h10
-rw-r--r--common/idstringlist.h14
-rw-r--r--common/nextpnr_base_types.h15
-rw-r--r--common/placer1.cc13
-rw-r--r--common/util.h36
-rw-r--r--docs/archapi.md6
-rw-r--r--ecp5/archdefs.h70
-rw-r--r--fpga_interchange/archdefs.h65
-rw-r--r--frontend/frontend_base.h8
-rw-r--r--gui/CMakeLists.txt4
-rw-r--r--ice40/archdefs.h46
-rw-r--r--machxo2/archdefs.h43
-rw-r--r--mistral/archdefs.h31
-rw-r--r--nexus/archdefs.h61
20 files changed, 14 insertions, 498 deletions
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
-Subproject a76698790753d2ec71f655cdc84d61bcb27780d
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 <typename R> struct BaseArch : ArchAPI<R>
virtual char getNameDelimiter() const override { return ' '; }
// Bel methods
- virtual uint32_t getBelChecksum(BelId bel) const override { return uint32_t(std::hash<BelId>()(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 <typename R> struct BaseArch : ArchAPI<R>
{
return empty_if_possible<typename R::WireAttrsRangeT>();
}
- virtual uint32_t getWireChecksum(WireId wire) const override { return uint32_t(std::hash<WireId>()(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 <typename R> struct BaseArch : ArchAPI<R>
{
return empty_if_possible<typename R::PipAttrsRangeT>();
}
- virtual uint32_t getPipChecksum(PipId pip) const override { return uint32_t(std::hash<PipId>()(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 <absl/container/flat_hash_map.h>
-#include <absl/container/flat_hash_set.h>
-#else
-#include <unordered_map>
-#include <unordered_set>
-#endif
-
-#include <boost/functional/hash.hpp>
-
-#include "nextpnr_namespaces.h"
-
-NEXTPNR_NAMESPACE_BEGIN
-
-namespace HashTables {
-#if defined(USE_ABSEIL)
-template <typename Key, typename Value, typename Hash = std::hash<Key>>
-using HashMap = absl::flat_hash_map<Key, Value, Hash>;
-template <typename Value, typename Hash = std::hash<Value>> using HashSet = absl::flat_hash_set<Value, Hash>;
-#else
-template <typename Key, typename Value, typename Hash = std::hash<Key>>
-using HashMap = std::unordered_map<Key, Value, Hash>;
-template <typename Value, typename Hash = std::hash<Value>> using HashSet = std::unordered_set<Value, Hash>;
-#endif
-
-}; // namespace HashTables
-
-struct PairHash
-{
- template <typename T1, typename T2> std::size_t operator()(const std::pair<T1, T2> &idp) const noexcept
- {
- std::size_t seed = 0;
- boost::hash_combine(seed, std::hash<T1>()(idp.first));
- boost::hash_combine(seed, std::hash<T2>()(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<NEXTPNR_NAMESPACE_PREFIX IdString>
-{
- std::size_t operator()(const NEXTPNR_NAMESPACE_PREFIX IdString &obj) const noexcept
- {
- return std::hash<int>()(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<NEXTPNR_NAMESPACE_PREFIX IdStringList>
-{
- std::size_t operator()(const NEXTPNR_NAMESPACE_PREFIX IdStringList &obj) const noexcept
- {
- std::size_t seed = 0;
- boost::hash_combine(seed, hash<size_t>()(obj.size()));
- for (auto &id : obj)
- boost::hash_combine(seed, hash<NEXTPNR_NAMESPACE_PREFIX IdString>()(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<NEXTPNR_NAMESPACE_PREFIX Loc>
-{
- std::size_t operator()(const NEXTPNR_NAMESPACE_PREFIX Loc &obj) const noexcept
- {
- std::size_t seed = 0;
- boost::hash_combine(seed, hash<int>()(obj.x));
- boost::hash_combine(seed, hash<int>()(obj.y));
- boost::hash_combine(seed, hash<int>()(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::pair<NEXTPNR_NAMESPACE_PREFIX IdString, std::size_t>>
-{
- std::size_t operator()(const std::pair<NEXTPNR_NAMESPACE_PREFIX IdString, std::size_t> &idp) const noexcept
- {
- std::size_t seed = 0;
- boost::hash_combine(seed, hash<NEXTPNR_NAMESPACE_PREFIX IdString>()(idp.first));
- boost::hash_combine(seed, hash<std::size_t>()(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 <typename K, typename V> std::map<K, V *> sorted(const std::unordered_map<K, std::unique_ptr<V>> &orig)
-{
- std::map<K, V *> 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 <typename K, typename V> std::map<K, V &> sorted_ref(std::unordered_map<K, V> &orig)
-{
- std::map<K, V &> 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 <typename K, typename V> std::map<K, const V &> sorted_cref(const std::unordered_map<K, V> &orig)
-{
- std::map<K, const V &> 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 <typename K> std::set<K> sorted(const std::unordered_set<K> &orig)
-{
- std::set<K> 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 <boost/functional/hash.hpp>
-
#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<NEXTPNR_NAMESPACE_PREFIX Location>
-{
- std::size_t operator()(const NEXTPNR_NAMESPACE_PREFIX Location &loc) const noexcept
- {
- std::size_t seed = std::hash<int>()(loc.x);
- seed ^= std::hash<int>()(loc.y) + 0x9e3779b9 + (seed << 6) + (seed >> 2);
- return seed;
- }
-};
-
-template <> struct hash<NEXTPNR_NAMESPACE_PREFIX BelId>
-{
- std::size_t operator()(const NEXTPNR_NAMESPACE_PREFIX BelId &bel) const noexcept
- {
- std::size_t seed = std::hash<NEXTPNR_NAMESPACE_PREFIX Location>()(bel.location);
- seed ^= std::hash<int>()(bel.index) + 0x9e3779b9 + (seed << 6) + (seed >> 2);
- return seed;
- }
-};
-
-template <> struct hash<NEXTPNR_NAMESPACE_PREFIX WireId>
-{
- std::size_t operator()(const NEXTPNR_NAMESPACE_PREFIX WireId &wire) const noexcept
- {
- std::size_t seed = std::hash<NEXTPNR_NAMESPACE_PREFIX Location>()(wire.location);
- seed ^= std::hash<int>()(wire.index) + 0x9e3779b9 + (seed << 6) + (seed >> 2);
- return seed;
- }
-};
-
-template <> struct hash<NEXTPNR_NAMESPACE_PREFIX PipId>
-{
- std::size_t operator()(const NEXTPNR_NAMESPACE_PREFIX PipId &pip) const noexcept
- {
- std::size_t seed = std::hash<NEXTPNR_NAMESPACE_PREFIX Location>()(pip.location);
- seed ^= std::hash<int>()(pip.index) + 0x9e3779b9 + (seed << 6) + (seed >> 2);
- return seed;
- }
-};
-
-template <> struct hash<NEXTPNR_NAMESPACE_PREFIX GroupId>
-{
- std::size_t operator()(const NEXTPNR_NAMESPACE_PREFIX GroupId &group) const noexcept
- {
- std::size_t seed = 0;
- boost::hash_combine(seed, hash<int>()(group.type));
- boost::hash_combine(seed, hash<NEXTPNR_NAMESPACE_PREFIX Location>()(group.location));
- return seed;
- }
-};
-
-template <> struct hash<NEXTPNR_NAMESPACE_PREFIX DecalId>
-{
- std::size_t operator()(const NEXTPNR_NAMESPACE_PREFIX DecalId &decal) const noexcept
- {
- std::size_t seed = 0;
- boost::hash_combine(seed, hash<int>()(decal.type));
- boost::hash_combine(seed, hash<NEXTPNR_NAMESPACE_PREFIX Location>()(decal.location));
- boost::hash_combine(seed, hash<int>()(decal.z));
- boost::hash_combine(seed, hash<bool>()(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 <boost/functional/hash.hpp>
#include <cstdint>
#include "hashlib.h"
@@ -126,68 +125,4 @@ struct ArchCellInfo
NEXTPNR_NAMESPACE_END
-namespace std {
-template <> struct hash<NEXTPNR_NAMESPACE_PREFIX BelId>
-{
- std::size_t operator()(const NEXTPNR_NAMESPACE_PREFIX BelId &bel) const noexcept
- {
- std::size_t seed = 0;
- boost::hash_combine(seed, hash<int>()(bel.tile));
- boost::hash_combine(seed, hash<int>()(bel.index));
- return seed;
- }
-};
-
-template <> struct hash<NEXTPNR_NAMESPACE_PREFIX WireId>
-{
- std::size_t operator()(const NEXTPNR_NAMESPACE_PREFIX WireId &wire) const noexcept
- {
- std::size_t seed = 0;
- boost::hash_combine(seed, hash<int>()(wire.tile));
- boost::hash_combine(seed, hash<int>()(wire.index));
- return seed;
- }
-};
-
-template <> struct hash<NEXTPNR_NAMESPACE_PREFIX PipId>
-{
- std::size_t operator()(const NEXTPNR_NAMESPACE_PREFIX PipId &pip) const noexcept
- {
- std::size_t seed = 0;
- boost::hash_combine(seed, hash<int>()(pip.tile));
- boost::hash_combine(seed, hash<int>()(pip.index));
- return seed;
- }
-};
-
-template <> struct hash<NEXTPNR_NAMESPACE_PREFIX GroupId>
-{
- std::size_t operator()(const NEXTPNR_NAMESPACE_PREFIX GroupId &group) const noexcept
- {
- std::size_t seed = 0;
- return seed;
- }
-};
-
-template <> struct hash<NEXTPNR_NAMESPACE_PREFIX DecalId>
-{
- std::size_t operator()(const NEXTPNR_NAMESPACE_PREFIX DecalId &decal) const noexcept
- {
- std::size_t seed = 0;
- return seed;
- }
-};
-
-template <> struct hash<NEXTPNR_NAMESPACE_PREFIX BelBucketId>
-{
- std::size_t operator()(const NEXTPNR_NAMESPACE_PREFIX BelBucketId &bucket) const noexcept
- {
- std::size_t seed = 0;
- boost::hash_combine(seed, hash<NEXTPNR_NAMESPACE_PREFIX IdString>()(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 <typename FrontendType> 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 <typename FrontendType> struct GenericFrontend
using bitvector_t = typename FrontendType::BitVectorDataType;
dict<IdString, ModuleInfo> mods;
- std::unordered_map<IdString, const mod_dat_t> mod_refs;
+ std::unordered_map<std::string, const mod_dat_t> mod_refs;
IdString top;
// Process the list of modules and determine
@@ -159,7 +159,7 @@ template <typename FrontendType> 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 <typename FrontendType> 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 <boost/functional/hash.hpp>
-
#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<NEXTPNR_NAMESPACE_PREFIX BelId>
-{
- std::size_t operator()(const NEXTPNR_NAMESPACE_PREFIX BelId &bel) const noexcept { return hash<int>()(bel.index); }
-};
-
-template <> struct hash<NEXTPNR_NAMESPACE_PREFIX WireId>
-{
- std::size_t operator()(const NEXTPNR_NAMESPACE_PREFIX WireId &wire) const noexcept
- {
- return hash<int>()(wire.index);
- }
-};
-
-template <> struct hash<NEXTPNR_NAMESPACE_PREFIX PipId>
-{
- std::size_t operator()(const NEXTPNR_NAMESPACE_PREFIX PipId &pip) const noexcept { return hash<int>()(pip.index); }
-};
-
-template <> struct hash<NEXTPNR_NAMESPACE_PREFIX GroupId>
-{
- std::size_t operator()(const NEXTPNR_NAMESPACE_PREFIX GroupId &group) const noexcept
- {
- std::size_t seed = 0;
- boost::hash_combine(seed, hash<int>()(group.type));
- boost::hash_combine(seed, hash<int>()(group.x));
- boost::hash_combine(seed, hash<int>()(group.y));
- return seed;
- }
-};
-
-template <> struct hash<NEXTPNR_NAMESPACE_PREFIX DecalId>
-{
- std::size_t operator()(const NEXTPNR_NAMESPACE_PREFIX DecalId &decal) const noexcept
- {
- std::size_t seed = 0;
- boost::hash_combine(seed, hash<int>()(decal.type));
- boost::hash_combine(seed, hash<int>()(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<NEXTPNR_NAMESPACE_PREFIX Location>
-{
- std::size_t operator()(const NEXTPNR_NAMESPACE_PREFIX Location &loc) const noexcept
- {
- std::size_t seed = std::hash<int>()(loc.x);
- seed ^= std::hash<int>()(loc.y) + 0x9e3779b9 + (seed << 6) + (seed >> 2);
- return seed;
- }
-};
-
-template <> struct hash<NEXTPNR_NAMESPACE_PREFIX BelId>
-{
- std::size_t operator()(const NEXTPNR_NAMESPACE_PREFIX BelId &bel) const noexcept
- {
- std::size_t seed = std::hash<NEXTPNR_NAMESPACE_PREFIX Location>()(bel.location);
- seed ^= std::hash<int>()(bel.index) + 0x9e3779b9 + (seed << 6) + (seed >> 2);
- return seed;
- }
-};
-
-template <> struct hash<NEXTPNR_NAMESPACE_PREFIX WireId>
-{
- std::size_t operator()(const NEXTPNR_NAMESPACE_PREFIX WireId &wire) const noexcept
- {
- std::size_t seed = std::hash<NEXTPNR_NAMESPACE_PREFIX Location>()(wire.location);
- seed ^= std::hash<int>()(wire.index) + 0x9e3779b9 + (seed << 6) + (seed >> 2);
- return seed;
- }
-};
-
-template <> struct hash<NEXTPNR_NAMESPACE_PREFIX PipId>
-{
- std::size_t operator()(const NEXTPNR_NAMESPACE_PREFIX PipId &pip) const noexcept
- {
- std::size_t seed = std::hash<NEXTPNR_NAMESPACE_PREFIX Location>()(pip.location);
- seed ^= std::hash<int>()(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 <boost/functional/hash.hpp>
-
#include "base_clusterinfo.h"
#include "cyclonev.h"
@@ -30,6 +28,8 @@
#include "nextpnr_assertions.h"
#include "nextpnr_namespaces.h"
+#include <limits>
+
NEXTPNR_NAMESPACE_BEGIN
using mistral::CycloneV;
@@ -210,31 +210,4 @@ struct ArchCellInfo : BaseClusterInfo
NEXTPNR_NAMESPACE_END
-namespace std {
-template <> struct hash<NEXTPNR_NAMESPACE_PREFIX BelId>
-{
- std::size_t operator()(const NEXTPNR_NAMESPACE_PREFIX BelId &bel) const noexcept
- {
- return hash<uint32_t>()((static_cast<uint32_t>(bel.pos) << 16) | bel.z);
- }
-};
-
-template <> struct hash<NEXTPNR_NAMESPACE_PREFIX WireId>
-{
- std::size_t operator()(const NEXTPNR_NAMESPACE_PREFIX WireId &wire) const noexcept
- {
- return hash<uint32_t>()(wire.node);
- }
-};
-
-template <> struct hash<NEXTPNR_NAMESPACE_PREFIX PipId>
-{
- std::size_t operator()(const NEXTPNR_NAMESPACE_PREFIX PipId &pip) const noexcept
- {
- return hash<uint64_t>()((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 <boost/functional/hash.hpp>
-
#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<NEXTPNR_NAMESPACE_PREFIX BelId>
-{
- std::size_t operator()(const NEXTPNR_NAMESPACE_PREFIX BelId &bel) const noexcept
- {
- std::size_t seed = 0;
- boost::hash_combine(seed, hash<int>()(bel.tile));
- boost::hash_combine(seed, hash<int>()(bel.index));
- return seed;
- }
-};
-
-template <> struct hash<NEXTPNR_NAMESPACE_PREFIX WireId>
-{
- std::size_t operator()(const NEXTPNR_NAMESPACE_PREFIX WireId &wire) const noexcept
- {
- std::size_t seed = 0;
- boost::hash_combine(seed, hash<int>()(wire.tile));
- boost::hash_combine(seed, hash<int>()(wire.index));
- return seed;
- }
-};
-
-template <> struct hash<NEXTPNR_NAMESPACE_PREFIX PipId>
-{
- std::size_t operator()(const NEXTPNR_NAMESPACE_PREFIX PipId &pip) const noexcept
- {
- std::size_t seed = 0;
- boost::hash_combine(seed, hash<int>()(pip.tile));
- boost::hash_combine(seed, hash<int>()(pip.index));
- return seed;
- }
-};
-
-template <> struct hash<NEXTPNR_NAMESPACE_PREFIX GroupId>
-{
- std::size_t operator()(const NEXTPNR_NAMESPACE_PREFIX GroupId &group) const noexcept
- {
- std::size_t seed = 0;
- boost::hash_combine(seed, hash<int>()(group.type));
- boost::hash_combine(seed, hash<int>()(group.x));
- boost::hash_combine(seed, hash<int>()(group.y));
- return seed;
- }
-};
-
-template <> struct hash<NEXTPNR_NAMESPACE_PREFIX DecalId>
-{
- std::size_t operator()(const NEXTPNR_NAMESPACE_PREFIX DecalId &decal) const noexcept
- {
- std::size_t seed = 0;
- boost::hash_combine(seed, hash<int>()(decal.type));
- boost::hash_combine(seed, hash<int>()(decal.index));
- return seed;
- }
-};
-
-} // namespace std
-
#endif /* NEXUS_ARCHDEFS_H */