From 9fe546f279cd643a308322ffa6af622630892315 Mon Sep 17 00:00:00 2001 From: Keith Rothman <537074+litghost@users.noreply.github.com> Date: Fri, 29 Jan 2021 14:55:10 -0800 Subject: Rename Partition -> BelBucket. Signed-off-by: Keith Rothman <537074+litghost@users.noreply.github.com> --- ice40/arch.cc | 6 +++--- ice40/arch.h | 38 +++++++++++++++++++------------------- ice40/archdefs.h | 14 +++++++------- 3 files changed, 29 insertions(+), 29 deletions(-) (limited to 'ice40') diff --git a/ice40/arch.cc b/ice40/arch.cc index fcf6506d..1849d993 100644 --- a/ice40/arch.cc +++ b/ice40/arch.cc @@ -124,9 +124,9 @@ Arch::Arch(ArchArgs args) : args(args) for(IdString bel_type : bel_types) { cell_types.push_back(bel_type); - PartitionId partition; - partition.name = bel_type; - partitions.push_back(partition); + BelBucketId bucket; + bucket.name = bel_type; + buckets.push_back(bucket); } } diff --git a/ice40/arch.h b/ice40/arch.h index 18fc3aeb..ddad1658 100644 --- a/ice40/arch.h +++ b/ice40/arch.h @@ -830,36 +830,36 @@ struct Arch : BaseCtx return cell_types; } - std::vector getPartitions() const { - return partitions; + std::vector getBelBuckets() const { + return buckets; } - IdString getPartitionName(PartitionId partition) const { - return partition.name; + IdString getBelBucketName(BelBucketId bucket) const { + return bucket.name; } - PartitionId getPartitionByName(IdString name) const { - PartitionId partition; - partition.name = name; - return partition; + BelBucketId getBelBucketByName(IdString name) const { + BelBucketId bucket; + bucket.name = name; + return bucket; } - PartitionId getPartitionForBel(BelId bel) const { - PartitionId partition; - partition.name = getBelType(bel); - return partition; + BelBucketId getBelBucketForBel(BelId bel) const { + BelBucketId bucket; + bucket.name = getBelType(bel); + return bucket; } - PartitionId getPartitionForCellType(IdString cell_type) const { - PartitionId partition; - partition.name = cell_type; - return partition; + BelBucketId getBelBucketForCellType(IdString cell_type) const { + BelBucketId bucket; + bucket.name = cell_type; + return bucket; } - std::vector getBelsForPartition(PartitionId partition) const { + std::vector getBelsInBucket(BelBucketId bucket) const { std::vector bels; for(BelId bel : getBels()) { - if(getBelType(bel) == partition.name) { + if(getBelType(bel) == bucket.name) { bels.push_back(bel); } } @@ -909,7 +909,7 @@ struct Arch : BaseCtx static const std::vector availableRouters; std::vector cell_types; - std::vector partitions; + std::vector buckets; }; void ice40DelayFuzzerMain(Context *ctx); diff --git a/ice40/archdefs.h b/ice40/archdefs.h index 1b7821b0..37249331 100644 --- a/ice40/archdefs.h +++ b/ice40/archdefs.h @@ -170,12 +170,12 @@ struct ArchCellInfo }; }; -struct PartitionId { +struct BelBucketId { 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 + bool operator==(const BelBucketId &other) const { return (name == other.name); } + bool operator!=(const BelBucketId &other) const { return (name != other.name); } + bool operator<(const BelBucketId &other) const { return name < other.name; } @@ -225,12 +225,12 @@ template <> struct hash } }; -template <> struct hash +template <> struct hash { - std::size_t operator()(const NEXTPNR_NAMESPACE_PREFIX PartitionId &partition) const noexcept + std::size_t operator()(const NEXTPNR_NAMESPACE_PREFIX BelBucketId &bucket) const noexcept { std::size_t seed = 0; - boost::hash_combine(seed, hash()(partition.name)); + boost::hash_combine(seed, hash()(bucket.name)); return seed; } }; -- cgit v1.2.3