From 1bbcc5f2c4b83c07997509eedb95410387edc2da Mon Sep 17 00:00:00 2001 From: Lofty Date: Tue, 2 Jan 2024 20:15:42 +0000 Subject: [PATCH] (broken) third round of review fixes --- common/kernel/pybindings.cc | 4 ++++ ice40/arch.cc | 6 ------ rust/rust.cc | 2 +- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/common/kernel/pybindings.cc b/common/kernel/pybindings.cc index db233c1c9c..8cf8e4248d 100644 --- a/common/kernel/pybindings.cc +++ b/common/kernel/pybindings.cc @@ -25,6 +25,7 @@ #include "json_frontend.h" #include "log.h" #include "nextpnr.h" +#include "rust.h" #include #include @@ -248,6 +249,9 @@ PYBIND11_EMBEDDED_MODULE(MODULE_NAME, m) m.def("parse_json", parse_json_shim); m.def("load_design", load_design_shim, py::return_value_policy::take_ownership); +#ifdef USE_RUST + m.def("example_printnets", example_printnets); +#endif auto region_cls = py::class_>(m, "Region"); readwrite_wrapper, diff --git a/ice40/arch.cc b/ice40/arch.cc index 1f8577fd67..a77dd611ac 100644 --- a/ice40/arch.cc +++ b/ice40/arch.cc @@ -643,12 +643,6 @@ std::vector Arch::getGroupGroups(GroupId group) const bool Arch::place() { -#ifdef USE_RUST - log_info("Calling Rust\n"); - example_printnets(getCtx()); - log_info("Returned from Rust\n"); -#endif - std::string placer = str_or_default(settings, id_placer, defaultPlacer); if (placer == "heap") { PlacerHeapCfg cfg(getCtx()); diff --git a/rust/rust.cc b/rust/rust.cc index 89c6055e5a..9f1c6bf10a 100644 --- a/rust/rust.cc +++ b/rust/rust.cc @@ -142,7 +142,7 @@ extern "C" { *nets = new NetInfo*[size]; auto idx = 0; for (auto& item : ctx->nets) { - *names[idx] = item.first.hash(); + *names[idx] = item.first.index; *nets[idx] = item.second.get(); idx++; }