diff options
Diffstat (limited to 'ecp5')
-rw-r--r-- | ecp5/arch.cc | 14 | ||||
-rw-r--r-- | ecp5/arch.h | 43 | ||||
-rw-r--r-- | ecp5/arch_pybindings.h | 12 | ||||
-rw-r--r-- | ecp5/archdefs.h | 19 |
4 files changed, 5 insertions, 83 deletions
diff --git a/ecp5/arch.cc b/ecp5/arch.cc index dfe47032..18fae1e2 100644 --- a/ecp5/arch.cc +++ b/ecp5/arch.cc @@ -105,18 +105,8 @@ Arch::Arch(ArchArgs args) : args(args) bel_to_cell.resize(chip_info->height * chip_info->width * max_loc_bels, nullptr); - std::unordered_set<IdString> bel_types; - for (BelId bel : getBels()) { - bel_types.insert(getBelType(bel)); - } - - for (IdString bel_type : bel_types) { - cell_types.push_back(bel_type); - - BelBucketId bucket; - bucket.name = bel_type; - buckets.push_back(bucket); - } + ArchBase::init_cell_types(); + ArchBase::init_bel_buckets(); for (int i = 0; i < chip_info->width; i++) x_ids.push_back(id(stringf("X%d", i))); diff --git a/ecp5/arch.h b/ecp5/arch.h index 5ea5206b..0d93a7a0 100644 --- a/ecp5/arch.h +++ b/ecp5/arch.h @@ -461,8 +461,8 @@ struct ArchRanges using DecalGfxRange = std::vector<GraphicElement>; // Placement validity using CellTypeRange = const std::vector<IdString> &; - using BelBucketRange = std::vector<BelBucketId>; - using BucketBelRange = std::vector<BelId>; + using BelBucketRange = const std::vector<BelBucketId> &; + using BucketBelRange = const std::vector<BelId> &; }; struct Arch : ArchBase<ArchRanges> @@ -878,45 +878,6 @@ struct Arch : ArchBase<ArchRanges> // ------------------------------------------------- // Placement validity checks - - const std::vector<IdString> &getCellTypes() const override { return cell_types; } - - std::vector<BelBucketId> getBelBuckets() const override { return buckets; } - - IdString getBelBucketName(BelBucketId bucket) const override { return bucket.name; } - - BelBucketId getBelBucketByName(IdString name) const override - { - BelBucketId bucket; - bucket.name = name; - return bucket; - } - - BelBucketId getBelBucketForBel(BelId bel) const override - { - BelBucketId bucket; - bucket.name = getBelType(bel); - return bucket; - } - - BelBucketId getBelBucketForCellType(IdString cell_type) const override - { - BelBucketId bucket; - bucket.name = cell_type; - return bucket; - } - - std::vector<BelId> getBelsInBucket(BelBucketId bucket) const override - { - std::vector<BelId> bels; - for (BelId bel : getBels()) { - if (getBelType(bel) == bucket.name) { - bels.push_back(bel); - } - } - return bels; - } - bool isValidBelForCell(CellInfo *cell, BelId bel) const override; bool isBelLocationValid(BelId bel) const override; diff --git a/ecp5/arch_pybindings.h b/ecp5/arch_pybindings.h index 4228f12b..f2a7dabe 100644 --- a/ecp5/arch_pybindings.h +++ b/ecp5/arch_pybindings.h @@ -76,18 +76,6 @@ template <> struct string_converter<PipId> } }; -template <> struct string_converter<BelBucketId> -{ - BelBucketId from_str(Context *ctx, std::string name) { return ctx->getBelBucketByName(ctx->id(name)); } - - std::string to_str(Context *ctx, BelBucketId id) - { - if (id == BelBucketId()) - throw bad_wrap(); - return ctx->getBelBucketName(id).str(ctx); - } -}; - template <> struct string_converter<BelPin> { BelPin from_str(Context *ctx, std::string name) diff --git a/ecp5/archdefs.h b/ecp5/archdefs.h index 3bc75ab4..c8fdf892 100644 --- a/ecp5/archdefs.h +++ b/ecp5/archdefs.h @@ -126,14 +126,7 @@ struct PipId } }; -struct BelBucketId -{ - IdString name; - - 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; } -}; +typedef IdString BelBucketId; struct GroupId { @@ -271,14 +264,4 @@ template <> struct hash<NEXTPNR_NAMESPACE_PREFIX DecalId> } }; -template <> struct hash<NEXTPNR_NAMESPACE_PREFIX BelBucketId> -{ - std::size_t operator()(const NEXTPNR_NAMESPACE_PREFIX BelBucketId &partition) const noexcept - { - std::size_t seed = 0; - boost::hash_combine(seed, hash<NEXTPNR_NAMESPACE_PREFIX IdString>()(partition.name)); - return seed; - } -}; - } // namespace std |