-
Notifications
You must be signed in to change notification settings - Fork 50
Allow dumping Python wrapper even when the shared lib is cached. #288
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: pymtl4.0-dev
Are you sure you want to change the base?
Conversation
Hmmm ... this doesn't seem to fix the bug with the example shown below. Did this example work for you? I did some debugging and if you look below I can can see that the PyMTL wrapper is updated. It now has "large" embedded in it ... but if I add some trace debugging to the
|
I tested on my laptop with Python 3.8.5 on this specific case, but I am able to get the extra verilator .VCD file:
I suspect the sys.modules are not reloaded correctly when the new Python wrapper gets dumped, but not sure if this is because of Python version or something else. |
Hmmm ... we are using Python 3.11.9 ... do you think that might be the issue? |
Ah ha! It does work if I just use |
I could not get this to reliably work. Most of the time it would not dump both VCD files but every once and a while it would. I did a bunch of debugging and I really think this has something to do with the shared library stuff. I came up with a different approach:
|
Fixes a bug where Verilator VCD dumps overwrite each other even when the test names are different. The bug was caused by skipping Python wrapper dumping when the shared library is cached, which is incorrect because certain parts of the py wrapper may change (such as the Verilator VCD filename) even when the library is cached.
The solution is to dump the Python wrapper (guarded by a lock among processes for pytest-xdist) when such situations occur.