x-heep
x-heep copied to clipboard
Fix #548: use `==` instead of `in` for string comparison in Python/.tpl
The use of in for string comparison results in "name" in "name2" giving a false positive; the right thing is to use ==.
In peripheral_subsystem.sv.tpl, this may result in the peripheral being added twice, or being added when it shouldn't. This was reported in #548, and has been fixed in this PR.
This misuse of in also occurs in mcu_gen.py and has been fixed as well.
In addition, this PR also changes the way in which dict keys are handled, from iterating through all the keys to just finding the relevant key, which is more readable (and efficient).