From 2e370d5a2f364a469f11a2dc6f4217a9e9880a1c Mon Sep 17 00:00:00 2001 From: Clifford Wolf Date: Fri, 17 Jan 2014 16:42:40 +0100 Subject: [PATCH] Added support for $adff with undef data inputs to opt_rmdff --- passes/opt/opt_rmdff.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/passes/opt/opt_rmdff.cc b/passes/opt/opt_rmdff.cc index a84bf4376..9ce98004e 100644 --- a/passes/opt/opt_rmdff.cc +++ b/passes/opt/opt_rmdff.cc @@ -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); -- 2.30.2