If a timing simulation is run for a long time, VCD files can grow large; file sizes in excess of 1GB are not uncommon. Although Xilinx is investigating solutions that will reduce the size of simulation files, the use of VCD files is currently the easiest and most universal way of providing simulation data to XPower.
The following hints and tips are presented to help you reduce these file sizes.
The key to reducing the file size is to understand what is being written to the VCD file. For each logic change on a signal that is added to the "monitor list" (using the command "VCD add"), information will be written to a VCD file. Accordingly, VCD file size can be reduced in two ways: reducing the number of signals, and reducing the overall number of logic changes.
Reducing the number of signals:
Do not use the "-r" switch in ModelSim. (The 5.1i documentation erroneously states that this switch should be used.) In fact, the "-r" switch merely increases the size of the VCD file without giving any extra information to XPower. Not using this switch is the simplest way to reduce the size and increase the speed of your simulation.
Reducing the simulation time:
You can only use the "VCD add" command at the beginning of the VCD file. Therefore, you cannot simulate most signals in your design for 99% of the simulation and add your clock for the last cycle. However, it is possible to work around this: XPower will allow you to add multiple VCD files that will not overwrite (non-conflicting) previous VCD data. You can therefore make one VCD file for your clock, another for a counter, and another for the rest of your design, as follows:
For example, suppose you are working with a simulation that:
Therefore:
In the ModelSim window, compile the design and load it normally. Then add the following:
vcd files clock.vcd counter_signals.vcd other_signals.vcd //Creates three VCD files
vcd add -file other_signals.vcd uut/signala //
vcd add -file other_signals.vcd uut/signalb //Adds any other signals in your testbench that will not be added into the other VCD files
run 30 ns
vcd add -file counter_signals.vcd uut/count* //Adds all the counter signals (they begin with the name count)
run 15 ns
vcd add -file clock_signals.vcd uut/clk //Adds the clock signals
run 5 ns
quit -f
Notice the order in which the signals are added: the clock is added only for the last period. If the clock is added in the first period, you must prevent transitions from being added to the VCD file in order to gain the benefits of reduced VCD file size. This is done using the "VCD off" command. (For more information, please refer to the ModelSim command reference.)
The benefits of this process are:
The drawbacks are: