openpowerbot | [slack] <joel> @Matt Johnston https://github.com/litex-hub/linux-on-litex-vexriscv/issues/174 | 03:59 |
---|---|---|
openpowerbot | [slack] <Matt Johnston> progress! `[ 2.017112] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)` | 08:19 |
openpowerbot | [slack] <Matt Johnston> just had to revert https://github.com/enjoy-digital/litedram/commit/af9abd6ec9bef7182ec00fa9d21c32c9faba9f87 (and patch it into gen.py) | 08:20 |
openpowerbot | [slack] <Matt Johnston> thanks @Anton Blanchard and @joel for the pointer to DM. makes sense that masking would cause problems... | 08:20 |
openpowerbot | [slack] <Anton Blanchard> @Matt Johnston nice work! | 09:19 |
lkcl | def __init__(.... dm_remapping = {}) | 13:15 |
lkcl | that's an extremely common and also extremely obscure fatal error in the use of python, there | 13:15 |
lkcl | it's a "singleton" pattern. | 13:16 |
lkcl | the default argument there for dm_remapping is a mutable object. | 13:16 |
lkcl | it is also the *only* instance of that argument (unlike the class itself, or any instantiations *of* that class) | 13:16 |
lkcl | and is therefore, in computer science terminology, a "singleton". | 13:17 |
lkcl | if it had been a tuple (which is immutable) - dm_remapping=() then there would not be a problem | 13:17 |
lkcl | what will happen here is that any modifications to dm_remapping (the singleton) inside the constructor will result in all and any subsequent calls returning that *exact same now-modified default argument* | 13:18 |
lkcl | a subsequent instance, if dm_remapping is given as None, will no longer return an empty dictionary but the one modified by *previous instantiation* | 13:19 |
lkcl | this is unfortunately not very well-known and not very well understood, and is a surprisingly common mistake, i encounter in other peoples' code about once every six months | 13:21 |
lkcl | the correct action is: | 13:21 |
lkcl | def __init__(.... dm_remapping=None, ...) | 13:22 |
lkcl | if dm_remapping is None: dm_remapping = {} | 13:22 |
lkcl | and then it's fine because the constructor uses a *local* instance of an (empty) dictionary, not a singleton one. | 13:23 |
lkcl | i would report this on the litex channels but have been prevented and prohibited from doing so: the censorship enacted by florent is still enforced. | 13:23 |
lkcl | therefore, someone else will have to provide a report to the litex team | 13:24 |
openpowerbot | [slack] <Paul Mackerras> haha, that sounds like old Fortran where arguments were passed by reference, so a subroutine could modify the value of the constant 2.0 🙂 | 20:41 |
lkcl | :) | 20:43 |
*** lkcl <lkcl!lkcl@we.will.rock.you.bnc4you.xyz> has quit IRC | 23:00 |
Generated by irclog2html.py 2.17.1 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!