diff --git a/frontends/ast/genrtlil.cc b/frontends/ast/genrtlil.cc index 21effdf59..2eaa4e0bd 100644 --- a/frontends/ast/genrtlil.cc +++ b/frontends/ast/genrtlil.cc @@ -627,6 +627,7 @@ struct AST_INTERNAL::ProcessGenerator RTLIL::SwitchRule *sw = new RTLIL::SwitchRule; set_src_attr(sw, ast); sw->signal = ast->children[0]->genWidthRTLIL(width_hint, sign_hint, &subst_rvalue_map.stdmap()); + sw->signal_src = ast->children[0]->loc_string(); current_case->switches.push_back(sw); for (auto &attr : ast->attributes) { diff --git a/kernel/rtlil.h b/kernel/rtlil.h index b62e66572..4917d11db 100644 --- a/kernel/rtlil.h +++ b/kernel/rtlil.h @@ -2553,7 +2553,7 @@ struct RTLIL::CaseRule : public RTLIL::AttrObject std::vector compare; std::vector actions; std::vector switches; - Const compare_src; + RTLIL::Const compare_src; ~CaseRule(); @@ -2567,6 +2567,7 @@ struct RTLIL::CaseRule : public RTLIL::AttrObject struct RTLIL::SwitchRule : public RTLIL::AttrObject { RTLIL::SigSpec signal; + RTLIL::Const signal_src; std::vector cases; ~SwitchRule();