Merge pull request #793 from whitequark/proc_clean_fix_fully_def

proc_clean: fix fully def check to consider compare/signal length
This commit is contained in:
Clifford Wolf 2019-01-19 09:31:17 +01:00 committed by GitHub
commit c4b61f2d69
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 1 deletions

View File

@ -82,9 +82,15 @@ void proc_clean_switch(RTLIL::SwitchRule *sw, RTLIL::CaseRule *parent, bool &did
{ {
if (max_depth != 0) if (max_depth != 0)
proc_clean_case(cs, did_something, count, max_depth-1); proc_clean_case(cs, did_something, count, max_depth-1);
int size = 0;
for (auto cmp : cs->compare) for (auto cmp : cs->compare)
if (!cmp.is_fully_def()) {
size += cmp.size();
if (cmp.is_fully_def())
all_fully_def = false; all_fully_def = false;
}
if (sw->signal.size() != size)
all_fully_def = false;
} }
if (all_fully_def) if (all_fully_def)
{ {