genrtlil: avoid converting SigSpec to set<SigBit> when going through removeSignalFrom...
authorRick Altherr <kc8apf@kc8apf.net>
Sun, 31 Jan 2016 03:26:46 +0000 (19:26 -0800)
committerRick Altherr <kc8apf@kc8apf.net>
Sun, 31 Jan 2016 17:20:16 +0000 (09:20 -0800)
frontends/ast/genrtlil.cc

index 87e8379e985dd089ffd6af1c62449a645cc2ce7b..876bfbe3d656eb54b87c75871852e822dde318c6 100644 (file)
@@ -379,7 +379,7 @@ struct AST_INTERNAL::ProcessGenerator
        // e.g. when the last statement in the code "a = 23; if (b) a = 42; a = 0;" is processed this
        // function is called to clean up the first two assignments as they are overwritten by
        // the third assignment.
-       void removeSignalFromCaseTree(const std::set<RTLIL::SigBit> &pattern, RTLIL::CaseRule *cs)
+       void removeSignalFromCaseTree(const RTLIL::SigSpec &pattern, RTLIL::CaseRule *cs)
        {
                for (auto it = cs->actions.begin(); it != cs->actions.end(); it++)
                        it->first.remove2(pattern, &it->second);
@@ -434,7 +434,7 @@ struct AST_INTERNAL::ProcessGenerator
                                                subst_rvalue_map.set(unmapped_lvalue[i], rvalue[i]);
                                }
 
-                               removeSignalFromCaseTree(lvalue.to_sigbit_set(), current_case);
+                               removeSignalFromCaseTree(lvalue, current_case);
                                remove_unwanted_lvalue_bits(lvalue, rvalue);
                                current_case->actions.push_back(RTLIL::SigSig(lvalue, rvalue));
                        }
@@ -511,7 +511,7 @@ struct AST_INTERNAL::ProcessGenerator
                                        subst_rvalue_map.set(this_case_eq_lvalue[i], this_case_eq_ltemp[i]);
 
                                this_case_eq_lvalue.replace(subst_lvalue_map.stdmap());
-                               removeSignalFromCaseTree(this_case_eq_lvalue.to_sigbit_set(), current_case);
+                               removeSignalFromCaseTree(this_case_eq_lvalue, current_case);
                                addChunkActions(current_case->actions, this_case_eq_lvalue, this_case_eq_ltemp);
                        }
                        break;