Documentation

To VCD File

Generate value change dump (VCD) file

Library

HDL Verifier

Description

The To VCD File block generates a VCD file that contains information about changes to signals connected to the block's input ports and names the file with the specified file name. You can use VCD files during design verification in the following ways:

  • For comparing results of multiple simulation runs, using the same or different simulator environments

  • As input to post-simulation analysis tools

  • For porting areas of an existing design to a new design

Using the Block Parameters dialog box, you can specify the following parameters:

  • The file name to be used for the generated file

  • The number of block input ports that are to receive signal data

  • The timescale to relate Simulink® sample times with HDL simulator ticks

VCD files can grow very large for larger designs or smaller designs with longer simulation runs. However, the only limitation on the size of a VCD file generated by the To VCD File block is the maximum number of signals (and symbols) supported, which is 943 (830,584).

You can use the To VCD File block in models running in Normal, Accelerator, or Rapid Accelerator simulation modes. The To VCD File parameters are not tunable in any of the simulation modes. For more information about these modes, see How Acceleration Modes Work in the Simulink User's Guide.

For a description of the VCD file format, see VCD File Format.

    Note:   The To VCD File block does not support framed signals.

    Note:   The To VCD File block is integrated into the Simulink Signal & Scope Manager. See the Simulink User's Guide for more information on using the Signal & Scope Manager.

    However, when you add a VCD block via the Signal & Scope manager, the signal name that appears in the VCD file may not be the one you specified. After simulation, open the VCD file and check the signal name. You may not see the signal name you specified but instead you may find that In_1 or similar has been used.

    If you use the VCD block directly from the HDL Verifier™ library, the signal names match correctly.

Graphically Displaying VCD File Data

You can graphically display VCD file data or analyze the data with postprocessing tools. For example, the ModelSim® vcd2wlf tool converts a VCD file to a WLF file that you can view in a ModelSim wave window. Other examples of postprocessing include the extraction of data pertaining to a particular section of a design hierarchy or data generated during a specific time interval.

Dialog Box

VCD file name

The file name to be used for the generated VCD file. If you specify a file name only, Simulink places the file in your current MATLAB® folder. Specify a complete path name to place the generated file in a different location. If you specify the same name for multiple To VCD File blocks, Simulink automatically adds a numeric postfix to identify each instance uniquely.

    Note:   If you want the generated file to have a .vcd file type extension, you must specify it explicitly.

    Do not give the same file name to different VCD blocks. Doing so results in invalid VCD files.

Number of input ports

The number of block input ports on which signal data is to be collected. The block can handle up to 943 (830,584) signals, each of which maps to a unique symbol in the VCD file.

In some cases, a single input port maps to multiple signals (and symbols). This multiple mapping occurs when the input port receives a multidimensional signal.

Because the VCD specification does not include multidimensional signals, Simulink flattens them to a 1-D vector in the file.

Timescale

Choose an optimal timing relationship between Simulink and the HDL simulator.

The timescale options specify a correspondence between one second of Simulink time and some quantity of HDL simulator time. You can express this quantity of HDL simulator time in one of the following ways:

  • In relative terms (i.e., as some number of HDL simulator ticks). In this case, the cosimulation operates in relative timing mode, which is the timing mode default.

    To use relative mode, select Tick from the pop-up list at the label in the HDL simulator, and enter the desired number of ticks in the edit box at 1 second in Simulink corresponds to. The default value is 1 Tick.

  • In absolute units (such as milliseconds or nanoseconds). In this case, the cosimulation operates in absolute timing mode.

    To use absolute mode, select the desired resolution unit from the pop-up list at the label in the HDL simulator (available units are fs, ps, ns, us, ms, s ), and enter the desired number of resolution units in the edit box at 1 second in Simulink corresponds to. Then, set the value of the HDL simulator tick by selecting 1, 10, or 100 from the pop-up list at 1 HDL Tick is defined as and the resolution unit from the pop-up list at defined as.

VCD File Format

The format of generated VCD files adheres to IEEE® Std 1364-2001. The following table describes the format.

Generated VCD File Format

File ContentDescription
$date
23-Sep-2003 14:38:11
$end
Data and time the file was generated.
$version HDL Verifier version 1.0 $ end
Version of the VCD block that generated the file.
$timescale 1 ns $ end
The time scale that was used during the simulation.
$scope module manchestermodel $end
The scope of the module being dumped.
$var wire 1 ! Original Data [0] $end
$var wire 1 " Recovered Clock [0] $end
$var wire 1 # Recovered Data [0] $end
$var wire 1 $ Data Validity [0] $end

Variable definitions. Each definition associates a signal with character identification code (symbol).

The symbols are derived from printable characters in the ASCII character set from ! to ~.

Variable definitions also include the variable type (wire) and size in bits.

$upscope $end
Marks a change to the next higher level in the HDL design hierarchy.
$enddefinitions $end
Marks the end of the header and definitions section.
#0
Simulation start time.
$dumpvars
 0!
 0"
 0#
 0$
$end
Lists the values of all defined variables at time equals 0.
#630
 1!

The starting point of logged value changes from checks of variable values made at each simulation time increment.

This entry indicates that at 63 nanoseconds, the value of signal Original Data changed from 0 to 1.

.
.
.
#1160
 1#
 1$
At 116 nanoseconds the values of signals Recovered Data and Data Validity changed from 0 to 1.
$dumpoff
 x!
 x"
 x#
 x$
$end
Marks the end of the file by dumping the values of all variables as the value x.

Was this topic helpful?