diff options
author | Keith Rothman <537074+litghost@users.noreply.github.com> | 2021-01-28 18:52:08 -0800 |
---|---|---|
committer | Keith Rothman <537074+litghost@users.noreply.github.com> | 2021-02-02 07:34:56 -0800 |
commit | 71e210dd4b12f1e91630f83396be236034f68e30 (patch) | |
tree | 04c8c16564ee0e0c92c231804b3a0c28d0e87fe5 /ecp5/arch.h | |
parent | 878fcdd22dfab32234f2537892ae844b2b4495f3 (diff) | |
download | nextpnr-71e210dd4b12f1e91630f83396be236034f68e30.tar.gz nextpnr-71e210dd4b12f1e91630f83396be236034f68e30.tar.bz2 nextpnr-71e210dd4b12f1e91630f83396be236034f68e30.zip |
Refactor ECP5 to new Partition API.
Signed-off-by: Keith Rothman <537074+litghost@users.noreply.github.com>
Diffstat (limited to 'ecp5/arch.h')
-rw-r--r-- | ecp5/arch.h | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/ecp5/arch.h b/ecp5/arch.h index 5c543cb3..921cbc29 100644 --- a/ecp5/arch.h +++ b/ecp5/arch.h @@ -953,6 +953,47 @@ struct Arch : BaseCtx bool isValidBelForCellType(IdString cell_type, BelId bel) const { return cell_type == getBelType(bel); } + + const std::vector<IdString> &getCellTypes() const { + return cell_types; + } + + std::vector<PartitionId> getPartitions() const { + return partitions; + } + + IdString getPartitionName(PartitionId partition) const { + return partition.name; + } + + PartitionId getPartitionByName(IdString name) const { + PartitionId partition; + partition.name = name; + return partition; + } + + PartitionId getPartitionForBel(BelId bel) const { + PartitionId partition; + partition.name = getBelType(bel); + return partition; + } + + PartitionId getPartitionForCellType(IdString cell_type) const { + PartitionId partition; + partition.name = cell_type; + return partition; + } + + std::vector<BelId> getBelsForPartition(PartitionId partition) const { + std::vector<BelId> bels; + for(BelId bel : getBels()) { + if(getBelType(bel) == partition.name) { + bels.push_back(bel); + } + } + return bels; + } + bool isValidBelForCell(CellInfo *cell, BelId bel) const; bool isBelLocationValid(BelId bel) const; @@ -1025,6 +1066,9 @@ struct Arch : BaseCtx static const std::vector<std::string> availablePlacers; static const std::string defaultRouter; static const std::vector<std::string> availableRouters; + + std::vector<IdString> cell_types; + std::vector<PartitionId> partitions; }; NEXTPNR_NAMESPACE_END |