From d03d9d839b7e49a4bf3428e949bda85574adf403 Mon Sep 17 00:00:00 2001 From: Keith Rothman <537074+litghost@users.noreply.github.com> Date: Thu, 28 Jan 2021 19:08:14 -0800 Subject: Working compile of ECP5. Signed-off-by: Keith Rothman <537074+litghost@users.noreply.github.com> --- ecp5/arch.cc | 2 +- ecp5/archdefs.h | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) (limited to 'ecp5') diff --git a/ecp5/arch.cc b/ecp5/arch.cc index 4368f0d0..b40b0002 100644 --- a/ecp5/arch.cc +++ b/ecp5/arch.cc @@ -126,7 +126,7 @@ Arch::Arch(ArchArgs args) : args(args) PartitionId partition; partition.name = bel_type; - partitions.push_back(partitions); + partitions.push_back(partition); } } diff --git a/ecp5/archdefs.h b/ecp5/archdefs.h index b0e01e4d..5bfe13d2 100644 --- a/ecp5/archdefs.h +++ b/ecp5/archdefs.h @@ -131,6 +131,10 @@ struct PartitionId { 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 @@ -269,4 +273,14 @@ template <> struct hash } }; +template <> struct hash +{ + std::size_t operator()(const NEXTPNR_NAMESPACE_PREFIX PartitionId &partition) const noexcept + { + std::size_t seed = 0; + boost::hash_combine(seed, hash()(partition.name)); + return seed; + } +}; + } // namespace std -- cgit v1.2.3