From 974ca143e80ac48b0e87054001a48b0d6597c6fa Mon Sep 17 00:00:00 2001 From: David Shah Date: Tue, 24 Jul 2018 16:09:29 +0200 Subject: Remove implementations of deprecated APIs Signed-off-by: David Shah --- generic/arch.cc | 7 ------- generic/arch.h | 1 - 2 files changed, 8 deletions(-) (limited to 'generic') diff --git a/generic/arch.cc b/generic/arch.cc index 0fff2e4c..af245a4b 100644 --- a/generic/arch.cc +++ b/generic/arch.cc @@ -368,13 +368,6 @@ const std::vector &Arch::getGroupGroups(GroupId group) const { return g // --------------------------------------------------------------- -void Arch::estimatePosition(BelId bel, int &x, int &y, bool &gb) const -{ - x = bels.at(bel).x; - y = bels.at(bel).y; - gb = bels.at(bel).gb; -} - delay_t Arch::estimateDelay(WireId src, WireId dst) const { const WireInfo &s = wires.at(src); diff --git a/generic/arch.h b/generic/arch.h index 61e6b033..3025bda0 100644 --- a/generic/arch.h +++ b/generic/arch.h @@ -191,7 +191,6 @@ struct Arch : BaseCtx const std::vector &getGroupPips(GroupId group) const; const std::vector &getGroupGroups(GroupId group) const; - void estimatePosition(BelId bel, int &x, int &y, bool &gb) const; delay_t estimateDelay(WireId src, WireId dst) const; delay_t getDelayEpsilon() const { return 0.01; } delay_t getRipupDelayPenalty() const { return 1.0; } -- cgit v1.2.3 From a82a8840d2c3995a1b746020a54315acd7fba7b8 Mon Sep 17 00:00:00 2001 From: Clifford Wolf Date: Tue, 24 Jul 2018 16:28:06 +0200 Subject: Add missing implementations of generic Arch methods Signed-off-by: Clifford Wolf --- generic/arch.cc | 33 +++++++++++++++++++++++++++++---- generic/arch.h | 2 +- 2 files changed, 30 insertions(+), 5 deletions(-) (limited to 'generic') diff --git a/generic/arch.cc b/generic/arch.cc index af245a4b..ac79ebea 100644 --- a/generic/arch.cc +++ b/generic/arch.cc @@ -77,18 +77,18 @@ void Arch::addBel(IdString name, IdString type, Loc loc, bool gb) bel_ids.push_back(name); bel_by_loc[loc] = name; - if (bels_by_tile.size() <= loc.x) + if (int(bels_by_tile.size()) <= loc.x) bels_by_tile.resize(loc.x + 1); - if (bels_by_tile[loc.x].size() <= loc.y) + if (int(bels_by_tile[loc.x].size()) <= loc.y) bels_by_tile[loc.x].resize(loc.y + 1); bels_by_tile[loc.x][loc.y].push_back(name); - if (tileDimZ.size() <= loc.x) + if (int(tileDimZ.size()) <= loc.x) tileDimZ.resize(loc.x + 1); - if (tileDimZ[loc.x].size() <= loc.y) + if (int(tileDimZ[loc.x].size()) <= loc.y) tileDimZ[loc.x].resize(loc.y + 1); gridDimX = std::max(gridDimX, loc.x + 1); @@ -193,6 +193,30 @@ BelId Arch::getBelByName(IdString name) const IdString Arch::getBelName(BelId bel) const { return bel; } +Loc Arch::getBelLocation(BelId bel) const +{ + auto &info = bels.at(bel); + return Loc(info.x, info.y, info.z); +} + +BelId Arch::getBelByLocation(Loc loc) const +{ + auto it = bel_by_loc.find(loc); + if (it != bel_by_loc.end()) + return it->second; + return BelId(); +} + +const std::vector &Arch::getBelsByTile(int x, int y) const +{ + return bels_by_tile.at(x).at(y); +} + +bool Arch::getBelGlobalBuf(BelId bel) const +{ + return bels.at(bel).gb; +} + uint32_t Arch::getBelChecksum(BelId bel) const { // FIXME @@ -234,6 +258,7 @@ std::vector Arch::getBelPins(BelId bel) const std::vector ret; for (auto &it : bels.at(bel).pins) ret.push_back(it.first); + return ret; } // --------------------------------------------------------------- diff --git a/generic/arch.h b/generic/arch.h index 3025bda0..97ed1ac2 100644 --- a/generic/arch.h +++ b/generic/arch.h @@ -141,7 +141,7 @@ struct Arch : BaseCtx IdString getBelName(BelId bel) const; Loc getBelLocation(BelId bel) const; BelId getBelByLocation(Loc loc) const; - std::vector getBelsByTile(int x, int y) const; + const std::vector &getBelsByTile(int x, int y) const; bool getBelGlobalBuf(BelId bel) const; uint32_t getBelChecksum(BelId bel) const; void bindBel(BelId bel, IdString cell, PlaceStrength strength); -- cgit v1.2.3 From c9c3d970c918f9c91d9886467d7957cbc49bd6b1 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Tue, 24 Jul 2018 20:21:31 +0200 Subject: Fixed pybiding so generic can work and ecp5 expose all needed --- generic/arch_pybindings.cc | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'generic') diff --git a/generic/arch_pybindings.cc b/generic/arch_pybindings.cc index a99723f2..186b2c13 100644 --- a/generic/arch_pybindings.cc +++ b/generic/arch_pybindings.cc @@ -20,12 +20,22 @@ #ifndef NO_PYTHON +#include "arch_pybindings.h" #include "nextpnr.h" #include "pybindings.h" NEXTPNR_NAMESPACE_BEGIN -void arch_wrap_python() { class_("ArchArgs"); } +void arch_wrap_python() +{ + using namespace PythonConversion; + auto arch_cls = class_, boost::noncopyable>("Arch", init()); + auto ctx_cls = class_, boost::noncopyable>("Context", no_init) + .def("checksum", &Context::checksum) + .def("pack", &Context::pack) + .def("place", &Context::place) + .def("route", &Context::route); +} NEXTPNR_NAMESPACE_END -- cgit v1.2.3