Optimizing no-op cell->setPort()
authorClifford Wolf <clifford@clifford.at>
Sat, 17 Jan 2015 11:04:40 +0000 (12:04 +0100)
committerClifford Wolf <clifford@clifford.at>
Sat, 17 Jan 2015 11:04:40 +0000 (12:04 +0100)
kernel/rtlil.cc

index d396d6c24555604d991f5eb5aa0229845a2b1d58..b35cbc3d1c0a76b5ea488f3b664ec6ca53a12dda 100644 (file)
@@ -1839,7 +1839,9 @@ void RTLIL::Cell::setPort(RTLIL::IdString portname, RTLIL::SigSpec signal)
                connections_[portname] = RTLIL::SigSpec();
                conn_it = connections_.find(portname);
                log_assert(conn_it != connections_.end());
-       }
+       } else
+       if (conn_it->second == signal)
+               return;
 
        for (auto mon : module->monitors)
                mon->notify_connect(this, conn_it->first, conn_it->second, signal);