From 8d330f1dc762e07535d148f41fcf7e32d91b060d Mon Sep 17 00:00:00 2001 From: Olivier Galibert Date: Tue, 19 Oct 2021 22:19:18 +0200 Subject: [PATCH] mistral: Use the iterators --- .github/workflows/mistral_ci.yml | 2 +- mistral/arch.cc | 19 ++++++++----------- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/.github/workflows/mistral_ci.yml b/.github/workflows/mistral_ci.yml index e48b2d44..eb097246 100644 --- a/.github/workflows/mistral_ci.yml +++ b/.github/workflows/mistral_ci.yml @@ -21,7 +21,7 @@ jobs: - name: Execute build nextpnr env: MISTRAL_PATH: ${{ github.workspace }}/deps/mistral - MISTRAL_REVISION: 8f78291541df10d70fde6c9c58765c437807c68d + MISTRAL_REVISION: 98ec7f69bfd5ab77e608ccd47ede988b45a7d99b run: | source ./.github/ci/build_mistral.sh get_dependencies diff --git a/mistral/arch.cc b/mistral/arch.cc index 60456846..52a6a72b 100644 --- a/mistral/arch.cc +++ b/mistral/arch.cc @@ -87,17 +87,14 @@ Arch::Arch(ArchArgs args) // This import takes about 5s, perhaps long term we can speed it up, e.g. defer to Mistral more... log_info("Initialising routing graph...\n"); int pip_count = 0; - for (const auto &mux : cyclonev->dest_node_to_rmux) { - const auto &rmux = cyclonev->rmux_info[mux.second]; - WireId dst_wire(mux.first); - for (const auto &src : rmux.sources) { - if (CycloneV::rn2t(src) == CycloneV::NONE) - continue; - WireId src_wire(src); - wires[dst_wire].wires_uphill.push_back(src_wire); - wires[src_wire].wires_downhill.push_back(dst_wire); - ++pip_count; - } + for (const auto &rnode : cyclonev->rnodes()) { + WireId dst_wire(rnode.id()); + for (const auto &src : rnode.sources()) { + WireId src_wire(src); + wires[dst_wire].wires_uphill.push_back(src_wire); + wires[src_wire].wires_downhill.push_back(dst_wire); + ++pip_count; + } } log_info(" imported %d wires and %d pips\n", int(wires.size()), pip_count);