From: Clifford Wolf Date: Thu, 14 Mar 2019 16:51:21 +0000 (+0100) Subject: Improve handling of "full_case" attributes X-Git-Tag: yosys-0.9~242^2 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=17caaa3fa898e39d1dbcfd8b92750a9d713a24af;p=yosys.git Improve handling of "full_case" attributes Signed-off-by: Clifford Wolf --- diff --git a/frontends/ast/genrtlil.cc b/frontends/ast/genrtlil.cc index d7da6fb40..b3a2a84be 100644 --- a/frontends/ast/genrtlil.cc +++ b/frontends/ast/genrtlil.cc @@ -525,7 +525,16 @@ struct AST_INTERNAL::ProcessGenerator } if (last_generated_case != NULL && ast->get_bool_attribute("\\full_case") && default_case == NULL) { + #if 0 + // this is a valid transformation, but as optimization it is premature. + // better: add a default case that assigns 'x' to everything, and let later + // optimizations take care of the rest last_generated_case->compare.clear(); + #else + default_case = new RTLIL::CaseRule; + addChunkActions(default_case->actions, this_case_eq_ltemp, SigSpec(State::Sx, GetSize(this_case_eq_rvalue))); + sw->cases.push_back(default_case); + #endif } else { if (default_case == NULL) { default_case = new RTLIL::CaseRule;