Remove duplicates from conns array in JSON front-end, fixes #2736
authorClaire Xenia Wolf <claire@clairexen.net>
Mon, 26 Apr 2021 14:31:44 +0000 (16:31 +0200)
committerClaire Xenia Wolf <claire@clairexen.net>
Mon, 26 Apr 2021 14:32:12 +0000 (16:32 +0200)
frontends/json/jsonparse.cc

index d897ac20b22b2ddbeca0db5f621b457041a24bd5..cbfa038a184e2a361edd9bf5f0f7898527168caa 100644 (file)
@@ -585,6 +585,10 @@ void json_import(Design *design, string &modname, JsonNode *node)
                        module->memories[mem->name] = mem;
                }
        }
+
+       // remove duplicates from connections array
+       pool<RTLIL::SigSig> unique_connections(module->connections_.begin(), module->connections_.end());
+       module->connections_ = std::vector<RTLIL::SigSig>(unique_connections.begin(), unique_connections.end());
 }
 
 struct JsonFrontend : public Frontend {