From: whitequark Date: Fri, 18 Jan 2019 23:22:02 +0000 (+0000) Subject: proc_clean: fix fully def check to consider compare/signal length. X-Git-Tag: yosys-0.9~323^2 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=95b6c3588222564b86cfa73f0601be44e3af5786;p=yosys.git proc_clean: fix fully def check to consider compare/signal length. Fixes #790. --- diff --git a/passes/proc/proc_clean.cc b/passes/proc/proc_clean.cc index 3919e4b9c..0e2f95226 100644 --- a/passes/proc/proc_clean.cc +++ b/passes/proc/proc_clean.cc @@ -82,9 +82,15 @@ void proc_clean_switch(RTLIL::SwitchRule *sw, RTLIL::CaseRule *parent, bool &did { if (max_depth != 0) proc_clean_case(cs, did_something, count, max_depth-1); + int size = 0; for (auto cmp : cs->compare) - if (!cmp.is_fully_def()) + { + size += cmp.size(); + if (cmp.is_fully_def()) all_fully_def = false; + } + if (sw->signal.size() != size) + all_fully_def = false; } if (all_fully_def) {