diff options
author | Clifford Wolf <cliffordvienna@gmail.com> | 2018-07-11 12:04:53 +0000 |
---|---|---|
committer | Clifford Wolf <cliffordvienna@gmail.com> | 2018-07-11 12:04:53 +0000 |
commit | ce6afb5f7f7e2e26918c01d9b818bff9ceb93601 (patch) | |
tree | cb098c84c01655b15a02051d6fbbbdd368dba9ca /ice40/archdefs.h | |
parent | 0d71ed76cbc80d6ef317a3ae743dcb92baca45ed (diff) | |
parent | 7081cca01654030f9a3b731cebf36e68590e3ed1 (diff) | |
download | nextpnr-ce6afb5f7f7e2e26918c01d9b818bff9ceb93601.tar.gz nextpnr-ce6afb5f7f7e2e26918c01d9b818bff9ceb93601.tar.bz2 nextpnr-ce6afb5f7f7e2e26918c01d9b818bff9ceb93601.zip |
Merge branch 'ice40gfx' into 'master'
Ice40gfx
See merge request SymbioticEDA/nextpnr!7
Diffstat (limited to 'ice40/archdefs.h')
-rw-r--r-- | ice40/archdefs.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/ice40/archdefs.h b/ice40/archdefs.h index be2e406d..061e9b44 100644 --- a/ice40/archdefs.h +++ b/ice40/archdefs.h @@ -21,6 +21,8 @@ #error Include "archdefs.h" via "nextpnr.h" only. #endif +#include <boost/functional/hash_fwd.hpp> + NEXTPNR_NAMESPACE_BEGIN typedef int delay_t; @@ -107,6 +109,13 @@ struct PipId bool operator!=(const PipId &other) const { return index != other.index; } }; +struct DecalId +{ + char type = 0; // Bel/Wire/Pip/Frame (b/w/p/f) + uint8_t x = 0, y = 0; + uint32_t z = 0; +}; + NEXTPNR_NAMESPACE_END namespace std { @@ -135,4 +144,17 @@ template <> struct hash<NEXTPNR_NAMESPACE_PREFIX BelType> : hash<int> template <> struct hash<NEXTPNR_NAMESPACE_PREFIX PortPin> : hash<int> { }; + +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.x)); + boost::hash_combine(seed, hash<int>()(decal.y)); + boost::hash_combine(seed, hash<int>()(decal.z)); + return seed; + } +}; + } // namespace std |