aboutsummaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorKeith Rothman <537074+litghost@users.noreply.github.com>2021-01-29 11:29:38 -0800
committerKeith Rothman <537074+litghost@users.noreply.github.com>2021-02-02 07:34:56 -0800
commit310f9f7b842018e7df46ff0fca13212228f5d571 (patch)
tree53a4669b4b13862b5d617366c197289e3714c4aa /generic
parent8d9390fc460bf98932afa5ef8362f932b48cf744 (diff)
downloadnextpnr-310f9f7b842018e7df46ff0fca13212228f5d571.tar.gz
nextpnr-310f9f7b842018e7df46ff0fca13212228f5d571.tar.bz2
nextpnr-310f9f7b842018e7df46ff0fca13212228f5d571.zip
Finish implementing new generic APIs.
Signed-off-by: Keith Rothman <537074+litghost@users.noreply.github.com>
Diffstat (limited to 'generic')
-rw-r--r--generic/arch.h18
1 files changed, 15 insertions, 3 deletions
diff --git a/generic/arch.h b/generic/arch.h
index b1af5175..85c98814 100644
--- a/generic/arch.h
+++ b/generic/arch.h
@@ -272,11 +272,17 @@ struct Arch : BaseCtx
bool route();
std::vector<IdString> getCellTypes() const {
- return {};
+ std::vector<IdString> cell_types;
+ cell_types.reserve(bels.size());
+ for(auto bel : bels) {
+ cell_types.push_back(bel.first);
+ }
+
+ return cell_types;
}
std::vector<PartitionId> getPartitions() const {
- return {};
+ return getCellTypes();
}
IdString getPartitionName(PartitionId partition) const {
@@ -296,7 +302,13 @@ struct Arch : BaseCtx
}
std::vector<BelId> getBelsForPartition(PartitionId partition) const {
- return {};
+ std::vector<BelId> bels;
+ for(BelId bel : getBels()) {
+ if(partition == getPartitionForBel(bel)) {
+ bels.push_back(bel);
+ }
+ }
+ return bels;
}
const std::vector<GraphicElement> &getDecalGraphics(DecalId decal) const;