From 7081cca01654030f9a3b731cebf36e68590e3ed1 Mon Sep 17 00:00:00 2001 From: Clifford Wolf Date: Wed, 11 Jul 2018 14:03:23 +0200 Subject: Add GUI Decals API Signed-off-by: Clifford Wolf --- ice40/archdefs.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'ice40/archdefs.h') 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 + 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 : hash template <> struct hash : hash { }; + +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.x)); + boost::hash_combine(seed, hash()(decal.y)); + boost::hash_combine(seed, hash()(decal.z)); + return seed; + } +}; + } // namespace std -- cgit v1.2.3