aboutsummaryrefslogtreecommitdiffstats
path: root/ecp5/archdefs.h
diff options
context:
space:
mode:
Diffstat (limited to 'ecp5/archdefs.h')
-rw-r--r--ecp5/archdefs.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/ecp5/archdefs.h b/ecp5/archdefs.h
index 4facc786..79b20619 100644
--- a/ecp5/archdefs.h
+++ b/ecp5/archdefs.h
@@ -22,6 +22,8 @@
#error Include "archdefs.h" via "nextpnr.h" only.
#endif
+#include <boost/functional/hash_fwd.hpp>
+
NEXTPNR_NAMESPACE_BEGIN
typedef int delay_t;
@@ -103,6 +105,13 @@ struct PipId
bool operator!=(const PipId &other) const { return index != other.index || location != other.location; }
};
+struct DecalId
+{
+ char type = 0; // Bel/Wire/Pip/Frame (b/w/p/f)
+ Location location;
+ uint32_t z = 0;
+};
+
NEXTPNR_NAMESPACE_END
namespace std {
@@ -146,6 +155,18 @@ template <> struct hash<NEXTPNR_NAMESPACE_PREFIX PipId>
}
};
+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));
+ return seed;
+ }
+};
+
template <> struct hash<NEXTPNR_NAMESPACE_PREFIX BelType> : hash<int>
{
};