Tuesday 21 February 2017

vhdl - Restricting set of logged signals in GHDL


I have a large VHDL design with hundreds of internal signals. I need to run a simulation of it for a long time in GHDL, and based on a short test run, the resulting VCD dump would be ~50GB for the full run. However, I am only interested in <10 signals.


The GHDL documentation says there is no way to restrict the set of signals recorded when a simulation is run. However, I can be fairly flexible in reorganizing my design, so for example I could wrap components with more layers, etc. Is there a way to use these tricks to restrict the set of recorded signals?



Answer



Not a good answer, but according to this Wiki page ghdl can create a zipped version of the VCD file. I expect it will compress quite nicely : your short test can give you some idea of the compression ratio.


This still leaves you with the entire dump, of course, but the wiki shows the file being unzipped and piped into the waveform viewer GTKWave.


Instead, if you piped it into a filter using grep you could extract a reduced version, and save that.


Looking at the VCD file format, this will be a 2-stage process :




  1. grep the signal names you're interested in. This gives the short character sequences VCD uses as each signal's ID.

  2. grep for all lines beginning with # (timestamps) and all lines ending with the IDs you are interested in.

  3. Packaging the result with the original file's header should be easy as every header line starts with $.


It may be that ghdl's --wave option which writes its own .ghw file format is easier to parse for this purpose, but I don't know offhand if ghdl can compress that, and the above doesn't look too bad to script.


A better but longer-term answer is to ask for ghdl to be capable of selecting signals to dump via the Tickets page. This has been discussed, of course, but as far as I know has not been taken any further. I suppose the question is the correct format for specifying signals of interest. Perhaps GHDL could be made to write a list of all hierarchical signals to file, then when running, read an edited version of the same file specifying the subset of signals to trace.


No comments:

Post a Comment

arduino - Can I use TI&#39;s cc2541 BLE as micro controller to perform operations/ processing instead of ATmega328P AU to save cost?

I am using arduino pro mini (which contains Atmega328p AU ) along with cc2541(HM-10) to process and transfer data over BLE to smartphone. I...