VCD file for a specific period of simulation in Modelsim
I am working on an embedded system in which I run an algorithm on a processor.
I want to measure power consumption for the system during the period that my algorithm is running on processor . I mean I don't like to consider the power for the period that Rom initializing algorithm is running at the beginning.
I know the exact timing when execution of the algorithm starts and finishes on processor, and I like to extract switching activity for just that period.
The vcd commands in ModelSim can be used to create and dump the vcd data based on the time that it was created. For example you can run your simulation until you want to start collecting the vcd data by using the run command with the time that you don't care about. At this point the simulation will be stopped, and you can create the vcd using the command line operations in the command window. Use the following commands to gather this data.
start your simulation and run to the desired time to start collecting data.
vcd file <file.vcd>
vcd add <signal names>
This will write out the the information for the signals that you added using the add command as the simulation runs. You will need to specify all of the signals that you want added, or use /uut/my_module/* to add signals at that level. To add recursively a module and below use vcd add -r /uut/my_module/*