From 2a613b1b662956e681cab4259ff495c33b39a393 Mon Sep 17 00:00:00 2001 From: Clifford Wolf Date: Sat, 25 Jul 2015 12:01:25 +0200 Subject: [PATCH] Some cleanups in opt_rmdff --- passes/opt/opt_rmdff.cc | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/passes/opt/opt_rmdff.cc b/passes/opt/opt_rmdff.cc index 24c2d3fa3..2ecbb31a8 100644 --- a/passes/opt/opt_rmdff.cc +++ b/passes/opt/opt_rmdff.cc @@ -130,38 +130,31 @@ bool handle_dff(RTLIL::Module *mod, RTLIL::Cell *dff) if (sig_c.is_fully_const() && (!sig_r.size() || !has_init || val_init == val_rv)) { if (val_rv.bits.size() == 0) val_rv = val_init; - RTLIL::SigSig conn(sig_q, val_rv); - mod->connect(conn); + mod->connect(sig_q, val_rv); goto delete_dff; } if (sig_d.is_fully_undef() && sig_r.size() && (!has_init || val_init == val_rv)) { - RTLIL::SigSig conn(sig_q, val_rv); - mod->connect(conn); + mod->connect(sig_q, val_rv); goto delete_dff; } if (sig_d.is_fully_undef() && !sig_r.size() && has_init) { - RTLIL::SigSig conn(sig_q, val_init); - mod->connect(conn); + mod->connect(sig_q, val_init); goto delete_dff; } if (sig_d.is_fully_const() && (!sig_r.size() || val_rv == sig_d.as_const()) && (!has_init || val_init == sig_d.as_const())) { - RTLIL::SigSig conn(sig_q, sig_d); - mod->connect(conn); + log_dump(sig_q, sig_d); + mod->connect(sig_q, sig_d); goto delete_dff; } if (sig_d == sig_q && (!sig_r.size() || !has_init || val_init == val_rv)) { - if (sig_r.size()) { - RTLIL::SigSig conn(sig_q, val_rv); - mod->connect(conn); - } - if (has_init) { - RTLIL::SigSig conn(sig_q, val_init); - mod->connect(conn); - } + if (sig_r.size()) + mod->connect(sig_q, val_rv); + if (has_init) + mod->connect(sig_q, val_init); goto delete_dff; } -- 2.30.2