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
pysim2 doesn't write input signals to VCD #280
Comments
Comment by whitequark
This is basically correct, but what it should do instead is also add any inputs. This wouldn't solve signals used for communicating between simulation processes only, but your suggestion wouldn't solve it as well because you can't add new signals in the middle of a vcd file.
Oops, good catch. |
Comment by phlipped Would it be possible to just re-write the vcd file after simulation has finished such that the variable definitions section at the start contains any additional signals that were seen along the way? |
Comment by whitequark
Maybe, but I'm not really interested in any solution that requires me to manually manipulate VCD files. |
Comment by JarrettBillingsley Seems like the VCDWriter is a bit inflexible in this regard. I can imagine a version which buffers the variable changes and registered variables in memory until it's closed, at which point it then writes everything out. Not sure if that could be done with subclassing... [edit] or, if not in memory, writing the variable changes to a temp file, and at close, outputs the registered variables and appends the contents of that temp file to the output. Dunno! |
Comment by adamgreig I'm not really fussed about outputting signals that testbenches might create (at least, it doesn't affect me), but not having any input signals at all in the VCD makes my usual debugging/testing with pysim2 basically impossible at the moment. |
@adamgreig I fixed both issues you've reported. I'm sorry that such a critical issue ended up being open for so long. |
Thank you! |
Issue by adamgreig
Wednesday Dec 04, 2019 at 12:23 GMT
Originally opened as m-labs/nmigen#280
Since updating to pysim2, any signals not driven from inside the fragment being simulated are not written to the VCD. This means signals which are inputs to the fragment and are driven by a sync process added to the simulator do not show up.
I think this is because FragmentCompiler is the only thing that adds signals to
signal_names
, but it is only called for the fragment the simulator is created with, not for any processes that are then added to the simulator. I might be misunderstanding the code though.Additionally, as far as I can tell the
traces
argument towrite_vcd
is totally unused: it gets passed to_VCDWaveformWriter.__init__
, which does nothing with it.The text was updated successfully, but these errors were encountered: