Do not use log_signal() for empty SigSpec to prevent "{ }"
authorEddie Hung <eddie@fpgeh.com>
Sat, 23 Nov 2019 07:29:10 +0000 (23:29 -0800)
committerEddie Hung <eddie@fpgeh.com>
Sat, 23 Nov 2019 07:29:10 +0000 (23:29 -0800)
passes/hierarchy/clkpart.cc

index a9ef2aa6c02d72e27a0ee2f16ef72c4a6b549c41..7cd1f4b4386e2c9e22f060d83433e052d9d76ae1 100644 (file)
@@ -246,9 +246,11 @@ struct ClkPartPass : public Pass {
                                if (it.first == largest_domain)
                                        continue;
 
+                               auto clk = std::get<1>(it.first);
+                               auto en = std::get<3>(it.first);
                                std::string submod = stringf("\\%s%s.%s%s",
-                                               std::get<0>(it.first) ? "" : "!", log_signal(std::get<1>(it.first)),
-                                               std::get<2>(it.first) ? "" : "!", log_signal(std::get<3>(it.first)));
+                                               std::get<0>(it.first) ? "" : "!", clk.empty() ? "" : log_signal(clk),
+                                               std::get<2>(it.first) ? "" : "!", en.empty() ? "" : log_signal(en));
                                for (auto c : it.second)
                                        c->attributes[ID(submod)] = submod;
                                new_submods.push_back(stringf("%s_%s", mod->name.c_str(), submod.c_str()));