From 310f9f7b842018e7df46ff0fca13212228f5d571 Mon Sep 17 00:00:00 2001 From: Keith Rothman <537074+litghost@users.noreply.github.com> Date: Fri, 29 Jan 2021 11:29:38 -0800 Subject: Finish implementing new generic APIs. Signed-off-by: Keith Rothman <537074+litghost@users.noreply.github.com> --- generic/arch.h | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'generic/arch.h') 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 getCellTypes() const { - return {}; + std::vector cell_types; + cell_types.reserve(bels.size()); + for(auto bel : bels) { + cell_types.push_back(bel.first); + } + + return cell_types; } std::vector getPartitions() const { - return {}; + return getCellTypes(); } IdString getPartitionName(PartitionId partition) const { @@ -296,7 +302,13 @@ struct Arch : BaseCtx } std::vector getBelsForPartition(PartitionId partition) const { - return {}; + std::vector bels; + for(BelId bel : getBels()) { + if(partition == getPartitionForBel(bel)) { + bels.push_back(bel); + } + } + return bels; } const std::vector &getDecalGraphics(DecalId decal) const; -- cgit v1.2.3