?? ch15.2.htm
字號:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML EXPERIMENTAL 970324//EN"><HTML><HEAD><META NAME="GENERATOR" CONTENT="Adobe FrameMaker 5.5/HTML Export Filter"><LINK REL="STYLESHEET" HREF="ch15.css"><TITLE> 15.2 Format of the value change dump file</TITLE></HEAD><BODY BGCOLOR="#ffffff"><DIV><HR><P><A HREF="ch15.htm">Chapter start</A> <A HREF="ch15.1.htm">Previous page</A></P></DIV><H1 CLASS="Section"><A NAME="pgfId=250"> </A>15.2 <A NAME="marker=72"> </A>Format of the value change dump file</H1><P CLASS="Body"><A NAME="pgfId=219"> </A>The dump file is structured in a free format. White space is used to separate commands and to make the file easily readable by a text editor.</P><P CLASS="SubSection"><A NAME="pgfId=348"> </A>Syntax of the value change dump file</P><P CLASS="Body"><A NAME="pgfId=224"> </A>The syntax of the VCD file is as follows:</P><P CLASS="Body"><A NAME="pgfId=308"> </A></P><DIV><IMG SRC="ch15-6.gif"></DIV><P CLASS="BNFCapBody"><A NAME="pgfId=408"> </A>Syntax 15-2: Syntax of the output VCD file</P><P CLASS="Body"><A NAME="pgfId=210"> </A>The VCD file starts with header information giving the date, the simulator's version number used for the simulation, and the timescale used. Next, the file contains definitions of the scope and type of variables being dumped, followed by the actual value changes at each simulation time increment. Only the variables that change value during a time increment are listed.</P><P CLASS="Body"><A NAME="pgfId=382"> </A>The simulation time recorded in VCD file is the absolute value of the simulation time for the changes in variable values that follow.</P><P CLASS="Body"><A NAME="pgfId=239"> </A>Value changes for real variables are specified by real numbers.Value changes for all other variables are specified in binary format by <CODE CLASS="code">0</CODE>, <CODE CLASS="code">1</CODE>, <CODE CLASS="code">x</CODE>, or <CODE CLASS="code">z</CODE> values. Strength information and memories are not dumped.</P><P CLASS="Body"><A NAME="pgfId=434"> </A>A real number is dumped using a <CODE CLASS="code">%.16g printf()</CODE> format. This preserves the precision of that number by outputting all 53 bits in the mantissa of a 64-bit IEEE STD-754 double precision number. Application programs can read a real number using a <CODE CLASS="code">%g</CODE> format to <CODE CLASS="code">scanf()</CODE>.</P><P CLASS="Body"><A NAME="pgfId=249"> </A>The value change dumper generates character identifier codes to represent variables. The identifier code is a code composed of the printable characters that are in the ASCII character set from ! to ~ (decimal 33 to 126).</P><P CLASS="Note"><A NAME="pgfId=255"> </A>NOTES</P><OL><P CLASS="NumberedNote1"><A NAME="pgfId=192"> </A>1) --The VCD format does not support a mechanism to dump part of a vector. For example, only bits 8 to 15 (8:15) of a 16-bit vector cannot be dumped in VCD file, instead, the entire vector (0:15) must be dumped. In addition, expressions, such as a + b, cannot be dumped in the VCD file.</P><P CLASS="NumberedNote2"><A NAME="pgfId=256"> </A>2) -- Data in the VCD file is case sensitive.</P></OL><P CLASS="SubSection"><A NAME="pgfId=252"> </A><A NAME="marker=82"> </A>Formats of variable values</P><P CLASS="Body"><A NAME="pgfId=265"> </A>Variables may be either scalars or vectors. Each type is dumped in its own format. Dumps of value changes to scalar variables shall not have any white space between the value and the identifier code.</P><P CLASS="Body"><A NAME="pgfId=267"> </A>Dumps of value changes to vectors shall not have any white space between the base letter and the value digits, but must have one white space between the value digits and the identifier code.</P><P CLASS="Body"><A NAME="pgfId=269"> </A>The output format for each value is right-justified. Vector values appear in the shortest form possible: redundant bit values that result from left-extending values to fill a particular vector size are eliminated. </P><P CLASS="Body"><A NAME="pgfId=270"> </A>The rules for left-extending vector values are as follows:</P><TABLE BORDER="1"><CAPTION><P CLASS="TableTitle"><A NAME="pgfId=257"> </A>Table 15-1: Rules for left-extending vector values</P></CAPTION><TR><TH ROWSPAN="1" COLSPAN="1"><P CLASS="CellHeading"><A NAME="pgfId=437"> </A>When the value is: </P></TH><TH ROWSPAN="1" COLSPAN="1"><P CLASS="CellHeading"><A NAME="pgfId=438"> </A>VCD left-extends with:</P></TH></TR><TR><TD ROWSPAN="1" COLSPAN="1"><P CLASS="Body"><A NAME="pgfId=439"> </A>1</P></TD><TD ROWSPAN="1" COLSPAN="1"><P CLASS="Body"><A NAME="pgfId=440"> </A>0</P></TD></TR><TR><TD ROWSPAN="1" COLSPAN="1"><P CLASS="Body"><A NAME="pgfId=441"> </A>0</P></TD><TD ROWSPAN="1" COLSPAN="1"><P CLASS="Body"><A NAME="pgfId=442"> </A>0</P></TD></TR><TR><TD ROWSPAN="1" COLSPAN="1"><P CLASS="Body"><A NAME="pgfId=443"> </A>Z</P></TD><TD ROWSPAN="1" COLSPAN="1"><P CLASS="Body"><A NAME="pgfId=444"> </A>Z</P></TD></TR><TR><TD ROWSPAN="1" COLSPAN="1"><P CLASS="Body"><A NAME="pgfId=445"> </A>X</P></TD><TD ROWSPAN="1" COLSPAN="1"><P CLASS="Body"><A NAME="pgfId=446"> </A>X</P></TD></TR></TABLE><P CLASS="Body"><A NAME="pgfId=283"> </A>The following table shows how the VCD may shorten values:</P><TABLE BORDER="1"><CAPTION><P CLASS="TableTitle"><A NAME="pgfId=271"> </A>Table 15-2: How the VCD may shorten values</P></CAPTION><TR><TH ROWSPAN="1" COLSPAN="1"><P CLASS="CellHeading"><A NAME="pgfId=273"> </A>The binary value: </P></TH><TH ROWSPAN="1" COLSPAN="1"><P CLASS="CellHeading"><A NAME="pgfId=274"> </A>extends to fill a <BR>4-bit register as:</P></TH><TH ROWSPAN="1" COLSPAN="1"><P CLASS="CellHeading"><A NAME="pgfId=285"> </A>and appears in the <BR>VCD file as:</P></TH></TR><TR><TD ROWSPAN="1" COLSPAN="1"><P CLASS="Body"><A NAME="pgfId=275"> </A>10</P></TD><TD ROWSPAN="1" COLSPAN="1"><P CLASS="Body"><A NAME="pgfId=276"> </A>0010</P></TD><TD ROWSPAN="1" COLSPAN="1"><P CLASS="Body"><A NAME="pgfId=286"> </A>b10</P></TD></TR><TR><TD ROWSPAN="1" COLSPAN="1"><P CLASS="Body"><A NAME="pgfId=277"> </A>X10</P></TD><TD ROWSPAN="1" COLSPAN="1"><P CLASS="Body"><A NAME="pgfId=278"> </A>XX10</P></TD><TD ROWSPAN="1" COLSPAN="1"><P CLASS="Body"><A NAME="pgfId=303"> </A>bX1</P></TD></TR><TR><TD ROWSPAN="1" COLSPAN="1"><P CLASS="Body"><A NAME="pgfId=279"> </A>ZX0</P></TD><TD ROWSPAN="1" COLSPAN="1"><P CLASS="Body"><A NAME="pgfId=280"> </A>ZZX0</P></TD><TD ROWSPAN="1" COLSPAN="1"><P CLASS="Body"><A NAME="pgfId=500"> </A>bZX0</P></TD></TR><TR><TD ROWSPAN="1" COLSPAN="1"><P CLASS="Body"><A NAME="pgfId=281"> </A>0X10</P></TD><TD ROWSPAN="1" COLSPAN="1"><P CLASS="Body"><A NAME="pgfId=501"> </A>0X10</P></TD><TD ROWSPAN="1" COLSPAN="1"><P CLASS="Body"><A NAME="pgfId=282"> </A>b0X10</P></TD></TR></TABLE><P CLASS="Body"><A NAME="pgfId=304"> </A>Events are dumped in the same format as scalars: for example, 1*%. For events, however, the value (1 in this example) is irrelevant. Only the identifier code (*% in this example) is significant. It appears in the VCD file as a marker to indicate that the event was triggered during the time step.</P><P CLASS="Body"><A NAME="pgfId=266"> </A>Examples:</P><PRE CLASS="CodeIndent"><A NAME="pgfId=367"> </A>1*@ No space between the value 1 and the identifier code *@</PRE><PRE CLASS="CodeIndent"><A NAME="pgfId=369"> </A></PRE><PRE CLASS="CodeIndent"><A NAME="pgfId=404"> </A>b1100x01z (k No space between the b and 1100x01z, but a space between b1100x01z and (k <A NAME="marker=85"> </A></PRE><P CLASS="SubSection"><A NAME="pgfId=287"> </A><A NAME="64710"> </A>Description of keyword commands</P><P CLASS="Body"><A NAME="pgfId=306"> </A>The general information in the VCD file is presented as a series of sections surrounded by keywords. Keyword commands provide a means of inserting information in the VCD file. Keyword commands can be inserted either by the dumper or manually.</P><P CLASS="Body"><A NAME="pgfId=172"> </A>This section deals with the following keyword commands:</P><TABLE BORDER="1"><CAPTION><P CLASS="TableTitle"><A NAME="pgfId=351"> </A>Table 15-3: Keyword Commands</P></CAPTION><TR><TD ROWSPAN="1" COLSPAN="2"><P CLASS="CellHeading"><A NAME="pgfId=317"> </A>Declaration Keywords</P></TD><TD ROWSPAN="1" COLSPAN="1"><P CLASS="CellHeading"><A NAME="pgfId=321"> </A>Simulation Keywords</P></TD></TR><TR><TD ROWSPAN="1" COLSPAN="1"><P CLASS="CellBody"><A NAME="pgfId=310"> </A><B CLASS="Keyword">$comment</B></P></TD><TD ROWSPAN="1" COLSPAN="1"><P CLASS="CellBody"><A NAME="pgfId=311"> </A><B CLASS="Keyword">$timescale</B></P></TD><TD ROWSPAN="1" COLSPAN="1"><P CLASS="CellBody"><A NAME="pgfId=312"> </A><B CLASS="Keyword">$dumpall</B></P></TD></TR><TR><TD ROWSPAN="1" COLSPAN="1"><P CLASS="CellBody"><A NAME="pgfId=313"> </A><B CLASS="Keyword">$date</B></P></TD><TD ROWSPAN="1" COLSPAN="1"><P CLASS="CellBody"><A NAME="pgfId=314"> </A><B CLASS="Keyword">$upscope</B></P></TD><TD ROWSPAN="1" COLSPAN="1"><P CLASS="CellBody"><A NAME="pgfId=315"> </A><B CLASS="Keyword">$dumpoff</B></P></TD></TR><TR><TD ROWSPAN="1" COLSPAN="1"><P CLASS="CellBody"><A NAME="pgfId=296"> </A><B CLASS="Keyword">$enddefinitions</B></P></TD><TD ROWSPAN="1" COLSPAN="1"><P CLASS="CellBody"><A NAME="pgfId=309"> </A><B CLASS="Keyword">$var</B></P></TD><TD ROWSPAN="1" COLSPAN="1"><P CLASS="CellBody"><A NAME="pgfId=318"> </A><B CLASS="Keyword">$dumpon</B></P></TD></TR><TR><TD ROWSPAN="1" COLSPAN="1"><P CLASS="CellBody"><A NAME="pgfId=319"> </A><B CLASS="Keyword">$scope</B></P></TD><TD ROWSPAN="1" COLSPAN="1"><P CLASS="CellBody"><A NAME="pgfId=307"> </A><B CLASS="Keyword">$version</B></P></TD><TD ROWSPAN="1" COLSPAN="1"><P CLASS="CellBody"><A NAME="pgfId=316">
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -