aboutsummaryrefslogtreecommitdiffstats
path: root/gowin/arch.h
diff options
context:
space:
mode:
authorDavid Shah <dave@ds0.me>2021-02-02 16:55:13 +0000
committerGitHub <noreply@github.com>2021-02-02 16:55:13 +0000
commitd1ef3ae1bac8f108b642c42c4fbfbdd4899c7641 (patch)
tree3657232a91e97f839cd9114f40aa0c565afc23d4 /gowin/arch.h
parentefc98c517eb1d2eb4a8ecc2ae82e770aaa1a0edd (diff)
parentda74a425d23352d7cddf9d1c4b0b7c86dd567c40 (diff)
downloadnextpnr-d1ef3ae1bac8f108b642c42c4fbfbdd4899c7641.tar.gz
nextpnr-d1ef3ae1bac8f108b642c42c4fbfbdd4899c7641.tar.bz2
nextpnr-d1ef3ae1bac8f108b642c42c4fbfbdd4899c7641.zip
Merge pull request #557 from litghost/refactor_placer_arch_api
RFC: Initial refactoring of placer API.
Diffstat (limited to 'gowin/arch.h')
-rw-r--r--gowin/arch.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/gowin/arch.h b/gowin/arch.h
index 5591744d..f12c604e 100644
--- a/gowin/arch.h
+++ b/gowin/arch.h
@@ -422,6 +422,31 @@ struct Arch : BaseCtx
// Get the TimingClockingInfo of a port
TimingClockingInfo getPortClockingInfo(const CellInfo *cell, IdString port, int index) const;
+ bool isValidBelForCellType(IdString cell_type, BelId bel) const { return cell_type == getBelType(bel); }
+
+ const std::vector<IdString> &getCellTypes() const { return cell_types; }
+
+ std::vector<BelBucketId> getBelBuckets() const { return cell_types; }
+
+ IdString getBelBucketName(BelBucketId bucket) const { return bucket; }
+
+ BelBucketId getBelBucketByName(IdString name) const { return name; }
+
+ BelBucketId getBelBucketForBel(BelId bel) const { return getBelType(bel); }
+
+ BelBucketId getBelBucketForCellType(IdString cell_type) const { return cell_type; }
+
+ std::vector<BelId> getBelsInBucket(BelBucketId bucket) const
+ {
+ std::vector<BelId> bels;
+ for (BelId bel : getBels()) {
+ if (getBelType(bel) == bucket) {
+ bels.push_back(bel);
+ }
+ }
+ return bels;
+ }
+
bool isValidBelForCell(CellInfo *cell, BelId bel) const;
bool isBelLocationValid(BelId bel) const;
@@ -434,6 +459,8 @@ struct Arch : BaseCtx
// Internal usage
void assignArchInfo();
bool cellsCompatible(const CellInfo **cells, int count) const;
+
+ std::vector<IdString> cell_types;
};
NEXTPNR_NAMESPACE_END