⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ch14.1.htm

📁 Verilog DHL教程
💻 HTM
📖 第 1 页 / 共 3 页
字号:
display `real' in an exponential format</P></TD></TR><TR><TD ROWSPAN="1" COLSPAN="1"><P CLASS="CellBody"><A NAME="pgfId=877"> </A>%f or %F</P></TD><TD ROWSPAN="1" COLSPAN="1"><P CLASS="CellBody"><A NAME="pgfId=880"> </A>display `real' in a decimal format</P></TD></TR><TR><TD ROWSPAN="1" COLSPAN="1"><P CLASS="CellBody"><A NAME="pgfId=1249"> </A>%g or %G</P></TD><TD ROWSPAN="1" COLSPAN="1"><P CLASS="CellBody"><A NAME="pgfId=1250"> </A>display `real' in exponential or decimal format, whichever format results in the shorter printed output</P></TD></TR></TABLE><P CLASS="Body"><A NAME="pgfId=1251"> </A>The net signal strength, hierarchical name, and string format specifications are described in sections <A HREF="ch14.1.htm#91588" CLASS="XRef">See Strength format</A> through <A HREF="ch14.1.htm#23449" CLASS="XRef">See String format</A>.</P><P CLASS="Body"><A NAME="pgfId=1252"> </A>The <A NAME="marker=82"> </A><A NAME="marker=83"> </A><A NAME="marker=84"> </A><CODE CLASS="code">%t</CODE> format specification works with the <B CLASS="Keyword">$timeformat</B> system task to specify a uniform time unit, time precision, and format for reporting timing information from various modules that use different time units and precisions. The <B CLASS="Keyword">$timeformat</B> task is described in <A HREF="ch14.3.htm#73834" CLASS="XRef">See $timeformat</A>.</P></DIV><DIV><H2 CLASS="Example"><A NAME="pgfId=1307"> </A></H2><P CLASS="Body"><A NAME="pgfId=874"> </A></P><DIV><IMG SRC="ch14-4.gif"></DIV><P CLASS="SubSubSect"><A NAME="pgfId=881"> </A>S<A NAME="marker=91"> </A><A NAME="marker=92"> </A><A NAME="marker=93"> </A>ize of displayed data</P><P CLASS="Body"><A NAME="pgfId=883"> </A>For expression arguments, the values written to the output file (or terminal) are sized automatically. </P><P CLASS="Body"><A NAME="pgfId=836"> </A>For example, the result of a 12-bit expression would be allocated three characters when displayed in hexadecimal format and four characters when displayed in decimal format, since the expression's largest possible value is FFF (hexadecimal) and 4095 (decimal).</P><P CLASS="Body"><A NAME="pgfId=885"> </A>When displaying decimal values, leading zeros are suppressed and replaced by spaces. In other radices, leading zeros are always displayed.</P><P CLASS="Body"><A NAME="pgfId=886"> </A>The automatic sizing of displayed data may be overridden by inserting a <A NAME="marker=94"> </A>zero between the <A NAME="marker=95"> </A><CODE CLASS="code">%</CODE> character and the letter that indicates the radix, as shown below:</P><PRE CLASS="CodeIndent"><A NAME="pgfId=887"> </A> <B CLASS="Keyword">$display</B>(&quot;d=%0h a=%0h&quot;, data, addr); </PRE></DIV><DIV><H2 CLASS="Example"><A NAME="pgfId=889"> </A></H2><P CLASS="Body"><A NAME="pgfId=890"> </A></P><DIV><IMG SRC="ch14-5.gif"></DIV><P CLASS="Body"><A NAME="pgfId=892"> </A>In this example, the result of a 12-bit expression is displayed. The first call to <B CLASS="Keyword">$display</B> uses the standard format specifier syntax and produces results requiring four and three columns for the decimal and hexadecimal radices, respectively. The second <B CLASS="Keyword">$display</B> call uses the <CODE CLASS="code">%0</CODE> form of the format specifier syntax and produces results requiring two columns and one column, respectively.<A NAME="marker=97"> </A><A NAME="marker=98"> </A><A NAME="marker=99"> </A></P><P CLASS="SubSubSect"><A NAME="pgfId=893"> </A>U<A NAME="marker=101"> </A>nknown and <A NAME="marker=102"> </A>high impedance values</P><P CLASS="Body"><A NAME="pgfId=895"> </A>When the result of an expression contains an unknown or high impedance value, the following rules apply to displaying that value.</P><P CLASS="Body"><A NAME="pgfId=896"> </A>In <A NAME="marker=103"> </A><A NAME="marker=104"> </A>decimal (<CODE CLASS="code">%d</CODE>) format:</P><UL><LI CLASS="DashedList"><A NAME="pgfId=897"> </A>If all bits are at the unknown value, a single lowercase `<A NAME="marker=105"> </A>x' character is displayed. </LI><LI CLASS="DashedList"><A NAME="pgfId=898"> </A>If all bits are at the high impedance value, a single lowercase `<A NAME="marker=106"> </A>z' character is displayed. </LI><LI CLASS="DashedList"><A NAME="pgfId=899"> </A>If some, but not all, bits are at the unknown value, the uppercase `<A NAME="marker=107"> </A>X' character is displayed. </LI><LI CLASS="DashedList"><A NAME="pgfId=900"> </A>If some, but not all, bits are at the high impedance value, the uppercase `<A NAME="marker=108"> </A>Z' character is displayed.</LI><LI CLASS="DashedList"><A NAME="pgfId=901"> </A><A NAME="marker=109"> </A>Decimal numerals always appear right-justified in a fixed-width field. </LI></UL><P CLASS="Body"><A NAME="pgfId=837"> </A>In <A NAME="marker=111"> </A><A NAME="marker=112"> </A>hexadecimal (<CODE CLASS="code">%h</CODE>) and octal (<CODE CLASS="code">%o</CODE>) formats:</P><UL><LI CLASS="DashedList"><A NAME="pgfId=903"> </A>Each group of 4 bits is represented as a single hexadecimal digit; each group of 3 bits is represented as a single octal digit. </LI><LI CLASS="DashedList"><A NAME="pgfId=904"> </A>If all bits in a group are at the unknown value, a lowercase `x' is displayed for that digit.</LI><LI CLASS="DashedList"><A NAME="pgfId=905"> </A>If all bits in a group are at a high impedance state, a lowercase `z' is printed for that digit. </LI><LI CLASS="DashedList"><A NAME="pgfId=906"> </A>If some, but not all, bits in a group are unknown, an uppercase `X' is displayed for that digit.</LI><LI CLASS="DashedList"><A NAME="pgfId=907"> </A>If some, but not all, bits in a group are at a high impedance state, then an uppercase `Z' is displayed for that digit.</LI></UL><P CLASS="Body"><A NAME="pgfId=908"> </A>In <A NAME="marker=113"> </A><A NAME="marker=114"> </A>binary (<CODE CLASS="code">%b</CODE>) format, each bit is printed separately using the characters 0, 1, x, and z.</P></DIV><DIV><H2 CLASS="Example"><A NAME="pgfId=910"> </A></H2><P CLASS="Body"><A NAME="pgfId=909"> </A></P><DIV><IMG SRC="ch14-6.gif"></DIV><P CLASS="SubSubSect"><A NAME="pgfId=912"> </A><A NAME="91588"> </A><A NAME="marker=120"> </A>S<A NAME="marker=121"> </A>trength format</P><P CLASS="Body"><A NAME="pgfId=914"> </A>The <CODE CLASS="code">%v</CODE> format specification is used to display the strength of scalar nets. For each <CODE CLASS="code">%v</CODE> specification that appears in a string, a corresponding scalar reference must follow the string in the argument list.</P><P CLASS="Body"><A NAME="pgfId=915"> </A>The strength of a scalar net is reported in a three-character format. The first two characters indicate the strength. The third character indicates the scalar's current logic value and may be any one of the following:</P><TABLE><CAPTION><P CLASS="TableTitle"><A NAME="pgfId=878"> </A>Table&nbsp;14-4: Logic value component of strength format</P></CAPTION><TR><TD ROWSPAN="1" COLSPAN="1"><P CLASS="CellBody"><A NAME="pgfId=882"> </A><A NAME="marker=432"> </A><A NAME="marker=433"> </A>0</P></TD><TD ROWSPAN="1" COLSPAN="1"><P CLASS="CellBody"><A NAME="pgfId=785"> </A>for a logic 0 value</P></TD></TR><TR><TD ROWSPAN="1" COLSPAN="1"><P CLASS="CellBody"><A NAME="pgfId=913"> </A><A NAME="marker=434"> </A>1</P></TD><TD ROWSPAN="1" COLSPAN="1"><P CLASS="CellBody"><A NAME="pgfId=894"> </A>for a logic 1 value</P></TD></TR><TR><TD ROWSPAN="1" COLSPAN="1"><P CLASS="CellBody"><A NAME="pgfId=1256"> </A><A NAME="marker=435"> </A>X</P></TD><TD ROWSPAN="1" COLSPAN="1"><P CLASS="CellBody"><A NAME="pgfId=1255"> </A>for an unknown value</P></TD></TR><TR><TD ROWSPAN="1" COLSPAN="1"><P CLASS="CellBody"><A NAME="pgfId=1258"> </A><A NAME="marker=436"> </A>Z</P></TD><TD ROWSPAN="1" COLSPAN="1"><P CLASS="CellBody"><A NAME="pgfId=1257"> </A>for a high impedance value</P></TD></TR><TR><TD ROWSPAN="1" COLSPAN="1"><P CLASS="CellBody"><A NAME="pgfId=1275"> </A><A NAME="marker=419"> </A>L</P></TD><TD ROWSPAN="1" COLSPAN="1"><P CLASS="CellBody"><A NAME="pgfId=1259"> </A>for a logic 0 or high impedance value</P></TD></TR><TR><TD ROWSPAN="1" COLSPAN="1"><P CLASS="CellBody"><A NAME="pgfId=1281"> </A><A NAME="marker=78"> </A>H</P></TD><TD ROWSPAN="1" COLSPAN="1"><P CLASS="CellBody"><A NAME="pgfId=1277"> </A>for a logic 1 or high impedance value</P></TD></TR></TABLE><P CLASS="Body"><A NAME="pgfId=918"> </A>The first two characters--the strength characters--are either a two-letter mnemonic or a pair of decimal digits. Usually, a mnemonic is used to indicate strength information; however, in less typical cases, a pair of decimal digits may be used to indicate a range of strength levels. <A HREF="ch14.1.htm#57185" CLASS="XRef">See : Mnemonics for strength levels</A> shows the mnemonics used to represent the various strength levels.</P><TABLE><CAPTION><P CLASS="TableTitle"><A NAME="pgfId=784"> </A>Table&nbsp;14-5<A NAME="57185"> </A>:   Mnemonics for strength levels</P></CAPTION><TR><TH ROWSPAN="1" COLSPAN="1"><P CLASS="CellHeading"><A NAME="pgfId=1279"> </A>Mnemonic</P></TH><TH ROWSPAN="1" COLSPAN="1"><P CLASS="CellHeading"><A NAME="pgfId=1283"> </A>Strength Name</P></TH><TH ROWSPAN="1" COLSPAN="1"><P CLASS="CellHeading"><A NAME="pgfId=1284"> </A>Strength Level</P></TH></TR><TR><TD ROWSPAN="1" COLSPAN="1"><P CLASS="Body"><A NAME="pgfId=1285"> </A><A NAME="marker=438"> </A><A NAME="marker=577"> </A>Su</P></TD><TD ROWSPAN="1" COLSPAN="1"><P CLASS="CellBody"><A NAME="pgfId=1286"> </A>Supply drive</P></TD><TD ROWSPAN="1" COLSPAN="1"><P CLASS="CellBody"><A NAME="pgfId=1287"> </A>7</P></TD></TR><TR><TD ROWSPAN="1" COLSPAN="1"><P CLASS="Body"><A NAME="pgfId=1288"> </A><A NAME="marker=578"> </A><A NAME="marker=579"> </A>St</P></TD><TD ROWSPAN="1" COLSPAN="1"><P CLASS="CellBody"><A NAME="pgfId=1289"> </A>Strong drive	</P></TD><TD ROWSPAN="1" COLSPAN="1"><P CLASS="CellBody"><A NAME="pgfId=1290"> </A>6</P></TD></TR><TR><TD ROWSPAN="1" COLSPAN="1"><P CLASS="Body"><A NAME="pgfId=1306"> </A><A NAME="marker=580"> </A><A NAME="marker=582"> </A>Pu</P></TD><TD ROWSPAN="1" COLSPAN="1"><P CLASS="CellBody"><A NAME="pgfId=1308"> </A>Pull drive</P></TD><TD ROWSPAN="1" COLSPAN="1"><P CLASS="CellBody"><A NAME="pgfId=1309"> </A>5</P></TD></TR><TR><TD ROWSPAN="1" COLSPAN="1"><P CLASS="Body"><A NAME="pgfId=1310"> </A><A NAME="marker=583"> </A><A NAME="marker=584"> </A>La</P></TD><TD ROWSPAN="1" COLSPAN="1"><P CLASS="CellBody">

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -