cirosantilli / vcdvcd

Python Verilog value change dump (VCD) parser library + the nifty vcdcat VCD command line pretty printer.
Other
56 stars 22 forks source link

Feature Request: Could you return the data from print_dumps instead of printing it? #6

Open morrowsend opened 4 years ago

morrowsend commented 4 years ago

If I could get the table from print_dumps built it would be perfect for my project which relied on your version of vcdvcd. For instance, returning a list of the signals in order, and a 2D array of the values as they are typically printed with each line (or timestamp) being a new inner array i.e. [[sig1_val0, sig2_val0, sig3_val0, ...], [sig1_val1, sig2_val1, sig3_val1, ....],...] would be simply awesome.

Is this possible to do? I tried to install the editable version but pip wouldn't let me as it said it couldn't find setup.py. I looked at the code for vcdvcd but couldn't quite figure out what I'd do to return these values myself. I admit python is not my native language...

cirosantilli commented 4 years ago

Hi there,

I will merge a pull request for this feature.

About the installation, I managed to install on master as described at: https://stackoverflow.com/questions/35064426/when-would-the-e-editable-option-be-useful-with-pip-install/63353319#63353319

Basic question: did you cd vcdvcd :-) If all fails just use PYTHONPATH, or for development just do everything from the git repo toplevel and it should work.

cirosantilli commented 4 years ago

Best implementation is likely to remove the print_dumps option, and instead add a get_dumps and print_dumps functions instead. get_dumps will hopefully extract the same info from self._data.