Added support for $adff with undef data inputs to opt_rmdff
authorClifford Wolf <clifford@clifford.at>
Fri, 17 Jan 2014 15:42:40 +0000 (16:42 +0100)
committerClifford Wolf <clifford@clifford.at>
Fri, 17 Jan 2014 15:42:40 +0000 (16:42 +0100)
passes/opt/opt_rmdff.cc

index a84bf4376b2b92f501c39aa8b49528f335e4d1a8..9ce98004ebab09c7e2a80e2209aacea17ceb8409 100644 (file)
@@ -92,6 +92,12 @@ static bool handle_dff(RTLIL::Module *mod, RTLIL::Cell *dff)
                }
        }
 
+       if (sig_d.is_fully_undef() && sig_d.width == int(val_rv.bits.size())) {
+               RTLIL::SigSig conn(sig_q, val_rv);
+               mod->connections.push_back(conn);
+               goto delete_dff;
+       }
+
        if (sig_d.is_fully_const() && sig_r.width == 0) {
                RTLIL::SigSig conn(sig_q, sig_d);
                mod->connections.push_back(conn);