From f95de7d3403482194fe641126aa5046078853612 Mon Sep 17 00:00:00 2001 From: "Emil J. Tywoniak" Date: Mon, 14 Apr 2025 14:48:34 +0200 Subject: [PATCH] fixup! fixup! dump: sort lhs and rhs in a connection --- backends/rtlil/rtlil_backend.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/backends/rtlil/rtlil_backend.cc b/backends/rtlil/rtlil_backend.cc index a65b54159..a23e5ec21 100644 --- a/backends/rtlil/rtlil_backend.cc +++ b/backends/rtlil/rtlil_backend.cc @@ -318,7 +318,12 @@ void RTLIL_BACKEND::dump_module(std::ostream &f, std::string indent, RTLIL::Modu std::swap(lhs, rhs); } } - std::sort(module->connections_.begin(), module->connections_.end()); + std::sort(module->connections_.begin(), module->connections_.end(), [](const auto &a, const auto &b) { + if (std::string(log_signal(a.first)) != std::string(log_signal(b.first))) { + return std::string(log_signal(a.first)) < std::string(log_signal(b.first)); + } + return std::string(log_signal(a.second)) < std::string(log_signal(b.second)); + }); } if (print_header)