aboutsummaryrefslogtreecommitdiffstats
path: root/nexus/archdefs.h
diff options
context:
space:
mode:
authorKeith Rothman <537074+litghost@users.noreply.github.com>2021-01-28 19:24:00 -0800
committerKeith Rothman <537074+litghost@users.noreply.github.com>2021-02-02 07:34:56 -0800
commit0338368afa369d097dfb35e0705fef10baa3d20e (patch)
tree961e59d870aa6df324ef723c72dd008390588f16 /nexus/archdefs.h
parentd03d9d839b7e49a4bf3428e949bda85574adf403 (diff)
downloadnextpnr-0338368afa369d097dfb35e0705fef10baa3d20e.tar.gz
nextpnr-0338368afa369d097dfb35e0705fef10baa3d20e.tar.bz2
nextpnr-0338368afa369d097dfb35e0705fef10baa3d20e.zip
Add Partition APIs to ice40, nexus, gowin archs.
Signed-off-by: Keith Rothman <537074+litghost@users.noreply.github.com>
Diffstat (limited to 'nexus/archdefs.h')
-rw-r--r--nexus/archdefs.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/nexus/archdefs.h b/nexus/archdefs.h
index adc1342c..12bbd228 100644
--- a/nexus/archdefs.h
+++ b/nexus/archdefs.h
@@ -114,6 +114,17 @@ struct PipId
}
};
+struct PartitionId {
+ IdString name;
+
+ bool operator==(const PartitionId &other) const { return (name == other.name); }
+ bool operator!=(const PartitionId &other) const { return (name != other.name); }
+ bool operator<(const PartitionId &other) const
+ {
+ return name < other.name;
+ }
+};
+
struct GroupId
{
enum : int8_t
@@ -250,4 +261,15 @@ template <> struct hash<NEXTPNR_NAMESPACE_PREFIX DecalId>
return seed;
}
};
+
+template <> struct hash<NEXTPNR_NAMESPACE_PREFIX PartitionId>
+{
+ std::size_t operator()(const NEXTPNR_NAMESPACE_PREFIX PartitionId &partition) const noexcept
+ {
+ std::size_t seed = 0;
+ boost::hash_combine(seed, hash<NEXTPNR_NAMESPACE_PREFIX IdString>()(partition.name));
+ return seed;
+ }
+};
+
} // namespace std