Articulo de referencia

Value change dump

Value change dump (VCD) (also known less commonly as "variable change dump") is an ASCII -based format for dumpfiles generated by EDA logic simulation tools. The standard, four-...

Value change dump (VCD) (also known less commonly as "variable change dump") is an ASCII-based format for dumpfiles generated by EDAlogic simulation tools. The standard, four-value VCD format was defined along with the Veriloghardware description language by the IEEE Standard 1364-1995 in 1996. An extended VCD format defined six years later in the IEEE standard 1364-2001 supports the logging of signal strength and directionality. The simple and yet compact structure of the VCD format has allowed its use to become ubiquitous and to spread into non-Verilog tools such as the VHDL simulator GHDL and various kernel tracers. A limitation of the format is that it is unable to record the values that are stored in memories.

Structure/syntax

The VCD file comprises a header section with date, simulator, and timescale information; a variable definition section; and a value change section, in that order. The sections are not explicitly delineated within the file, but are identified by the inclusion of keywords belonging to each respective section.

VCD keywords are marked by a leading $; in general every keyword starts a command which is terminated by an explicit $end. Variable identifiers may also start with a $, but these may be distinguished by context.

All VCD tokens are delineated by whitespace. Data in the VCD file is case sensitive.

Header section

The header section of the VCD file includes a timestamp, a simulator version number, and a timescale, which maps the time increments listed in the value change section to simulation time units.

Variable definition section

The variable definition section of the VCD file contains scope information as well as lists of signals instantiated in a given scope.

Each variable is assigned an arbitrary identifier for use in the value change section. The identifier is composed of one or more printable ASCII characters from ! to ~ (decimal 33 to 126), these are conventionally kept short (i.e. one or two characters). Several variables can share an identifier if the simulator determines that they will always have the same value, i.e. are the same wire in the scope of the overall netlist.

The scope type definitions closely follow Verilog concepts, and include the types module, task, function, and fork.

$dumpvars section

The section beginning with $dumpvars keyword contains initial values of all variables dumped.

Value change section

La sección de cambio de valor contiene una serie de cambios de valor ordenados en el tiempo para las señales en un modelo de simulación dado. El tiempo actual se indica con '#' seguido de la marca de tiempo. Para señales escalares (de un solo bit), el formato es el valor de la señal denotado por 0 o 1 seguido inmediatamente del identificador de la señal sin espacio entre el valor y el identificador de la señal. Para señales vectoriales (de varios bits), el formato es el valor de la señal denotado por la letra 'b' o 'B' seguido del valor en formato binario seguido de un espacio y luego el identificador de la señal. El valor para variables reales se denota por la letra 'r' o 'R' seguido de los datos usando  el formato %.16g printf() seguido de un espacio y luego el identificador de la variable.

Archivo VCD de ejemplo

$fecha Texto de la fecha. Por ejemplo: 11 de noviembre de 2009. $fin $versión Texto con información sobre la versión de la herramienta generadora de VCD. $fin $comentario Cualquier texto de comentario. $fin $timescale 1ps $end Lógica del módulo $scope $end $var cable 8 # datos $end $var cable 1 $ datos_válidos $fin $var cable 1 % en $end $var cable 1 y rx_en $end $var cable 1 ' tx_en $end $var cable 1 ( vacío $end $var cable 1 ) subcorrer $end $upscope $end $findefiniciones $fin $dumpvars bxxxxxxxx # x$ 0% incógnita& incógnita' 1( 0) $fin #0 b10000001 # 0$ 1% 0& 1' 0( 0) #2211 0' #2296 b0 # 1$ #2302 0$ #2303

El código anterior define 7 señales usando $var:

$var tipo ancho de bits id nombre

El ID se utiliza posteriormente en el volcado de cambios de valor. El volcado de cambios de valor comienza después de $enddefinitions $end y se basa en marcas de tiempo. La marca de tiempo se indica como '#' seguido de un número. En cada marca de tiempo se muestra la lista de señales que cambian su valor. Esto se realiza mediante el par valor/ID:

nuevo_valor id

Este ejemplo se mostrará como

Captura de pantalla de un archivo VCD de ejemplo mostrado por GTKWave.
Un ejemplo de archivo VCD mostrado por GTKWave .

Véase también

  • IEEE Std 1364-2001 El estándar oficial para Verilog 2001 (no es gratuito, incluye un capítulo que define VCD).
  • Cómo crear tu propio archivo VCD : una guía informal pero completa.
  • Volcado de cambios de valor : explicación del formato VCD, con un ejemplo.
  • Compare VCD : una herramienta de línea de comandos para comparar archivos VCD (con licencia GPL).
  • Verilog::VCD Software Perl CPAN para analizar archivos Verilog VCD (con licencia GPL).
  • Verilog_VCD Traducido a Python desde el software Perl CPAN
  • ProcessVCD : paquete Java para analizar archivos VCD (bajo licencia MIT).
  • PyVCD : paquete de Python que escribe archivos Value Change Dump (VCD) según lo especificado en IEEE 1364-2005 (Licencia MIT).
  • vcdMaker Herramienta (Linux, Windows) para convertir archivos de registro de texto en archivos VCD (Licencia MIT).
  • yne/vcd (Linux, Mac, Windows) Interfaz de línea de comandos para mostrar archivos VCD en la terminal (Licencia MIT).