rtlil: Dump empty connections when whole module is selected.
authorMarcelina Kościelnicka <mwk@0x04.net>
Sat, 11 Dec 2021 15:53:54 +0000 (16:53 +0100)
committerMarcelina Kościelnicka <mwk@0x04.net>
Sun, 12 Dec 2021 00:22:06 +0000 (01:22 +0100)
Without this, empty connections will be always skipped by `dump`, since
they contain no selected wires.  This makes debugging rather confusing.

backends/rtlil/rtlil_backend.cc

index 68521d52d583cd29b1f1c9544b39d7e30f0c625a..1b11de5ec39454df7e759c8a9e111acc1b1984ef 100644 (file)
@@ -358,8 +358,8 @@ void RTLIL_BACKEND::dump_module(std::ostream &f, std::string indent, RTLIL::Modu
 
                bool first_conn_line = true;
                for (auto it = module->connections().begin(); it != module->connections().end(); ++it) {
-                       bool show_conn = !only_selected;
-                       if (only_selected) {
+                       bool show_conn = !only_selected || design->selected_whole_module(module->name);
+                       if (!show_conn) {
                                RTLIL::SigSpec sigs = it->first;
                                sigs.append(it->second);
                                for (auto &c : sigs.chunks()) {