diff options
Diffstat (limited to 'ice40')
-rw-r--r-- | ice40/arch.cc | 4 | ||||
-rw-r--r-- | ice40/arch.h | 32 | ||||
-rw-r--r-- | ice40/arch_pybindings.cc | 5 | ||||
-rw-r--r-- | ice40/archdefs.h | 8 |
4 files changed, 21 insertions, 28 deletions
diff --git a/ice40/arch.cc b/ice40/arch.cc index 1849d993..6fe77e4b 100644 --- a/ice40/arch.cc +++ b/ice40/arch.cc @@ -117,11 +117,11 @@ Arch::Arch(ArchArgs args) : args(args) switches_locked.resize(chip_info->num_switches); std::unordered_set<IdString> bel_types; - for(BelId bel : getBels()) { + for (BelId bel : getBels()) { bel_types.insert(getBelType(bel)); } - for(IdString bel_type : bel_types) { + for (IdString bel_type : bel_types) { cell_types.push_back(bel_type); BelBucketId bucket; diff --git a/ice40/arch.h b/ice40/arch.h index ddad1658..fd92d988 100644 --- a/ice40/arch.h +++ b/ice40/arch.h @@ -822,44 +822,40 @@ struct Arch : BaseCtx // implemented in arch_place.cc) // Whether this cell type can be placed at this BEL. - bool isValidBelForCellType(IdString cell_type, BelId bel) const { - return cell_type == getBelType(bel); - } + bool isValidBelForCellType(IdString cell_type, BelId bel) const { return cell_type == getBelType(bel); } - const std::vector<IdString> &getCellTypes() const { - return cell_types; - } + const std::vector<IdString> &getCellTypes() const { return cell_types; } - std::vector<BelBucketId> getBelBuckets() const { - return buckets; - } + std::vector<BelBucketId> getBelBuckets() const { return buckets; } - IdString getBelBucketName(BelBucketId bucket) const { - return bucket.name; - } + IdString getBelBucketName(BelBucketId bucket) const { return bucket.name; } - BelBucketId getBelBucketByName(IdString name) const { + BelBucketId getBelBucketByName(IdString name) const + { BelBucketId bucket; bucket.name = name; return bucket; } - BelBucketId getBelBucketForBel(BelId bel) const { + BelBucketId getBelBucketForBel(BelId bel) const + { BelBucketId bucket; bucket.name = getBelType(bel); return bucket; } - BelBucketId getBelBucketForCellType(IdString cell_type) const { + BelBucketId getBelBucketForCellType(IdString cell_type) const + { BelBucketId bucket; bucket.name = cell_type; return bucket; } - std::vector<BelId> getBelsInBucket(BelBucketId bucket) const { + std::vector<BelId> getBelsInBucket(BelBucketId bucket) const + { std::vector<BelId> bels; - for(BelId bel : getBels()) { - if(getBelType(bel) == bucket.name) { + for (BelId bel : getBels()) { + if (getBelType(bel) == bucket.name) { bels.push_back(bel); } } diff --git a/ice40/arch_pybindings.cc b/ice40/arch_pybindings.cc index 060cf0b1..76ce7590 100644 --- a/ice40/arch_pybindings.cc +++ b/ice40/arch_pybindings.cc @@ -75,8 +75,8 @@ void arch_wrap_python(py::module &m) typedef const PipRange UphillPipRange; typedef const PipRange DownhillPipRange; - typedef const std::vector<BelBucketId> & BelBucketRange; - typedef const std::vector<BelId> & BelRangeForBelBucket; + typedef const std::vector<BelBucketId> &BelBucketRange; + typedef const std::vector<BelId> &BelRangeForBelBucket; #include "arch_pybindings_shared.h" WRAP_RANGE(m, Bel, conv_to_str<BelId>); @@ -85,7 +85,6 @@ void arch_wrap_python(py::module &m) WRAP_RANGE(m, Pip, conv_to_str<PipId>); WRAP_RANGE(m, BelPin, wrap_context<BelPin>); - WRAP_MAP_UPTR(m, CellMap, "IdCellMap"); WRAP_MAP_UPTR(m, NetMap, "IdNetMap"); WRAP_MAP(m, HierarchyMap, wrap_context<HierarchicalCell &>, "HierarchyMap"); diff --git a/ice40/archdefs.h b/ice40/archdefs.h index 37249331..c0a6ac66 100644 --- a/ice40/archdefs.h +++ b/ice40/archdefs.h @@ -170,15 +170,13 @@ struct ArchCellInfo }; }; -struct BelBucketId { +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; - } + bool operator<(const BelBucketId &other) const { return name < other.name; } }; NEXTPNR_NAMESPACE_END |