From: Clifford Wolf Date: Sat, 24 Oct 2015 17:23:30 +0000 (+0200) Subject: Fixed driver conflict handling (various cmds) X-Git-Tag: yosys-0.6~91 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a1c3df7fe405a9e560d9aad9d10324af3ce6a4e5;p=yosys.git Fixed driver conflict handling (various cmds) --- diff --git a/kernel/rtlil.cc b/kernel/rtlil.cc index 8332219ae..6f150c1e2 100644 --- a/kernel/rtlil.cc +++ b/kernel/rtlil.cc @@ -1448,9 +1448,18 @@ void RTLIL::Module::connect(const RTLIL::SigSig &conn) for (auto mon : design->monitors) mon->notify_connect(this, conn); -#ifndef NDEBUG - log_assert(!conn.first.has_const()); -#endif + // ignore all attempts to assign constants to other constants + if (conn.first.has_const()) { + RTLIL::SigSig new_conn; + for (int i = 0; i < GetSize(conn.first); i++) + if (conn.first[i].wire) { + new_conn.first.append(conn.first[i]); + new_conn.second.append(conn.second[i]); + } + if (GetSize(new_conn.first)) + connect(new_conn); + return; + } if (yosys_xtrace) { log("#X# Connect (SigSig) in %s: %s = %s (%d bits)\n", log_id(this), log_signal(conn.first), log_signal(conn.second), GetSize(conn.first));