diff options
author | Miodrag Milanović <mmicko@gmail.com> | 2019-12-28 15:46:02 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-12-28 15:46:02 +0100 |
commit | 247e18cf027334d5201be00735aa607250e6253d (patch) | |
tree | 850d77245b0469a57ddf522e7fb68e3a805e3498 /ecp5/archdefs.h | |
parent | 0d43aff2682d91817ea4a1fb5dff6e169ae9a659 (diff) | |
parent | fb5480cde349008ab74e6b7179ac1b1fc8ffef1f (diff) | |
download | nextpnr-247e18cf027334d5201be00735aa607250e6253d.tar.gz nextpnr-247e18cf027334d5201be00735aa607250e6253d.tar.bz2 nextpnr-247e18cf027334d5201be00735aa607250e6253d.zip |
Merge pull request #344 from YosysHQ/mmicko/ecp5_gui
ECP5 display improvement
Diffstat (limited to 'ecp5/archdefs.h')
-rw-r--r-- | ecp5/archdefs.h | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/ecp5/archdefs.h b/ecp5/archdefs.h index 8faa41ed..b176eec0 100644 --- a/ecp5/archdefs.h +++ b/ecp5/archdefs.h @@ -128,10 +128,15 @@ struct PipId struct GroupId { - int32_t index = -1; + enum : int8_t + { + TYPE_NONE, + TYPE_SWITCHBOX + } type = TYPE_NONE; + Location location; - bool operator==(const GroupId &other) const { return index == other.index; } - bool operator!=(const GroupId &other) const { return index != other.index; } + bool operator==(const GroupId &other) const { return (type == other.type) && (location == other.location); } + bool operator!=(const GroupId &other) const { return (type != other.type) || (location != other.location); } }; struct DecalId @@ -139,8 +144,11 @@ struct DecalId enum { TYPE_NONE, - TYPE_BEL - } type; + TYPE_BEL, + TYPE_WIRE, + TYPE_PIP, + TYPE_GROUP + } type = TYPE_NONE; Location location; uint32_t z = 0; bool active = false; @@ -222,7 +230,10 @@ template <> struct hash<NEXTPNR_NAMESPACE_PREFIX GroupId> { std::size_t operator()(const NEXTPNR_NAMESPACE_PREFIX GroupId &group) const noexcept { - return std::hash<int>()(group.index); + 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; } }; |