aboutsummaryrefslogtreecommitdiffstats
path: root/ecp5/archdefs.h
diff options
context:
space:
mode:
Diffstat (limited to 'ecp5/archdefs.h')
-rw-r--r--ecp5/archdefs.h23
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;
}
};