aboutsummaryrefslogtreecommitdiffstats
path: root/ecp5/archdefs.h
diff options
context:
space:
mode:
Diffstat (limited to 'ecp5/archdefs.h')
-rw-r--r--ecp5/archdefs.h21
1 files changed, 15 insertions, 6 deletions
diff --git a/ecp5/archdefs.h b/ecp5/archdefs.h
index da12eeaa..67c016cc 100644
--- a/ecp5/archdefs.h
+++ b/ecp5/archdefs.h
@@ -122,10 +122,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
@@ -133,8 +138,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;
@@ -216,7 +224,8 @@ 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 = std::hash<NEXTPNR_NAMESPACE_PREFIX Location>()(group.location);
+ return seed;
}
};