diff options
author | Clifford Wolf <clifford@clifford.at> | 2018-07-11 14:03:23 +0200 |
---|---|---|
committer | Clifford Wolf <clifford@clifford.at> | 2018-07-11 14:03:23 +0200 |
commit | 7081cca01654030f9a3b731cebf36e68590e3ed1 (patch) | |
tree | 8e01a719c3622a94aa77419117d72338b2746a71 /ice40/archdefs.h | |
parent | 87d88048ac14de3fd70aca7e75f7b42ff424ece0 (diff) | |
download | nextpnr-7081cca01654030f9a3b731cebf36e68590e3ed1.tar.gz nextpnr-7081cca01654030f9a3b731cebf36e68590e3ed1.tar.bz2 nextpnr-7081cca01654030f9a3b731cebf36e68590e3ed1.zip |
Add GUI Decals API
Signed-off-by: Clifford Wolf <clifford@clifford.at>
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 |