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

📄 ch14.1.htm

📁 Verilog DHL教程
💻 HTM
📖 第 1 页 / 共 3 页
字号:
<A NAME="pgfId=1311"> </A>Large capacitor</P></TD><TD ROWSPAN="1" COLSPAN="1"><P CLASS="CellBody"><A NAME="pgfId=1312"> </A>4</P></TD></TR><TR><TD ROWSPAN="1" COLSPAN="1"><P CLASS="Body"><A NAME="pgfId=1313"> </A><A NAME="marker=585"> </A><A NAME="marker=586"> </A>We</P></TD><TD ROWSPAN="1" COLSPAN="1"><P CLASS="CellBody"><A NAME="pgfId=1314"> </A>Weak drive</P></TD><TD ROWSPAN="1" COLSPAN="1"><P CLASS="CellBody"><A NAME="pgfId=1315"> </A>3</P></TD></TR><TR><TD ROWSPAN="1" COLSPAN="1"><P CLASS="Body"><A NAME="pgfId=1316"> </A><A NAME="marker=587"> </A><A NAME="marker=589"> </A>Me</P></TD><TD ROWSPAN="1" COLSPAN="1"><P CLASS="CellBody"><A NAME="pgfId=1317"> </A>Medium capacitor</P></TD><TD ROWSPAN="1" COLSPAN="1"><P CLASS="CellBody"><A NAME="pgfId=1318"> </A>2</P></TD></TR><TR><TD ROWSPAN="1" COLSPAN="1"><P CLASS="Body"><A NAME="pgfId=1319"> </A><A NAME="marker=590"> </A><A NAME="marker=591"> </A>Sm</P></TD><TD ROWSPAN="1" COLSPAN="1"><P CLASS="CellBody"><A NAME="pgfId=1320"> </A>Small capacitor</P></TD><TD ROWSPAN="1" COLSPAN="1"><P CLASS="CellBody"><A NAME="pgfId=1321"> </A>1</P></TD></TR><TR><TD ROWSPAN="1" COLSPAN="1"><P CLASS="Body"><A NAME="pgfId=1330"> </A><A NAME="marker=592"> </A><A NAME="marker=593"> </A>Hi</P></TD><TD ROWSPAN="1" COLSPAN="1"><P CLASS="CellBody"><A NAME="pgfId=1331"> </A>H<A NAME="marker=594"> </A>igh impedance</P></TD><TD ROWSPAN="1" COLSPAN="1"><P CLASS="CellBody"><A NAME="pgfId=1339"> </A>0</P></TD></TR></TABLE><P CLASS="Body"><A NAME="pgfId=921"> </A>Note that there are four <A NAME="marker=128"> </A>driving strengths, and three charge storage strengths. The driving strengths are associated with gate outputs and <A NAME="marker=129"> </A>continuous assignment outputs. The charge storage strengths are associated with the <B CLASS="Keyword">trireg</B><A NAME="marker=130"> </A> type net. (See <A HREF="/Humuhumu/Files/Prof_Smith/Academic/ASICs/Web/ASICs/HTML/Verilog/LRM/HTML/14/ch07.htm#36723" CLASS="XRef"></A> for strength modeling.)</P><P CLASS="Body"><A NAME="pgfId=922"> </A>For the logic values 0 and 1, a mnemonic is used when there is no range of strengths in the signal. Otherwise, the logic value is preceded by two decimal digits, which indicate the maximum and minimum strength levels.</P><P CLASS="Body"><A NAME="pgfId=923"> </A>For the unknown value, a mnemonic is used when both the 0 and 1 strength components are at the same strength level. Otherwise, the unknown value X is preceded by two decimal digits, which indicate the 0 and 1 strength levels respectively.</P><P CLASS="Body"><A NAME="pgfId=924"> </A>The high impedance strength can not have a known logic value; the only logic value allowed for this level is Z.</P><P CLASS="Body"><A NAME="pgfId=925"> </A>For the values L and H, a mnemonic is always used to indicate the strength level.</P></DIV><DIV><H2 CLASS="Example"><A NAME="pgfId=927"> </A></H2><PRE CLASS="CodeIndent"><A NAME="pgfId=911"> </A><B CLASS="Keyword">always</B> 	#15 <B CLASS="Keyword">$display</B>(<B CLASS="Keyword">$time</B>,,&quot;group=%b signals=%v %v %v&quot;,{s1,s2,s3}, s1, s2, s3);</PRE><PRE CLASS="CodeIndent"><A NAME="pgfId=926"> </A></PRE><P CLASS="Body"><A NAME="pgfId=928"> </A>The example below shows the output that might result from such a call, while <A HREF="ch14.1.htm#35222" CLASS="XRef">See : Explanation of strength formats</A> explains the various strength formats that appear in the output.</P><P CLASS="Body"><A NAME="pgfId=929"> </A></P><DIV><IMG SRC="ch14-7.gif"></DIV><P CLASS="Body"><A NAME="pgfId=930"> </A></P><TABLE><CAPTION><P CLASS="TableTitle"><A NAME="pgfId=786"> </A>Table&nbsp;14-6<A NAME="35222"> </A>:   Explanation of strength formats</P></CAPTION><TR><TD ROWSPAN="1" COLSPAN="1"><P CLASS="CellBody"><A NAME="pgfId=920"> </A>St1</P></TD><TD ROWSPAN="1" COLSPAN="1"><P CLASS="CellBody"><A NAME="pgfId=1355"> </A>means a strong driving 1 value</P></TD></TR><TR><TD ROWSPAN="1" COLSPAN="1"><P CLASS="CellBody"><A NAME="pgfId=1340"> </A>Pu0</P></TD><TD ROWSPAN="1" COLSPAN="1"><P CLASS="CellBody"><A NAME="pgfId=1322"> </A>means a pull driving 0 value</P></TD></TR><TR><TD ROWSPAN="1" COLSPAN="1"><P CLASS="CellBody"><A NAME="pgfId=1342"> </A>HiZ</P></TD><TD ROWSPAN="1" COLSPAN="1"><P CLASS="CellBody"><A NAME="pgfId=1341"> </A>means the high impedance state</P></TD></TR><TR><TD ROWSPAN="1" COLSPAN="1"><P CLASS="CellBody"><A NAME="pgfId=1344"> </A>Me0</P></TD><TD ROWSPAN="1" COLSPAN="1"><P CLASS="CellBody"><A NAME="pgfId=1343"> </A>means a 0 charge storage of medium capacitor strength</P></TD></TR><TR><TD ROWSPAN="1" COLSPAN="1"><P CLASS="CellBody"><A NAME="pgfId=1347"> </A>StX</P></TD><TD ROWSPAN="1" COLSPAN="1"><P CLASS="CellBody"><A NAME="pgfId=1345"> </A>means a strong driving unknown value</P></TD></TR><TR><TD ROWSPAN="1" COLSPAN="1"><P CLASS="CellBody"><A NAME="pgfId=1349"> </A>PuH</P></TD><TD ROWSPAN="1" COLSPAN="1"><P CLASS="CellBody"><A NAME="pgfId=1348"> </A>means a pull driving 1 or high impedance</P></TD></TR><TR><TD ROWSPAN="1" COLSPAN="1"><P CLASS="CellBody"><A NAME="pgfId=1351"> </A>65X</P></TD><TD ROWSPAN="1" COLSPAN="1"><P CLASS="CellBody"><A NAME="pgfId=1350"> </A>means an unknown value with a strong driving 0 component and a pull driving 1 component</P></TD></TR><TR><TD ROWSPAN="1" COLSPAN="1"><P CLASS="CellBody"><A NAME="pgfId=1353"> </A>520</P></TD><TD ROWSPAN="1" COLSPAN="1"><P CLASS="CellBody"><A NAME="pgfId=1352"> </A>means an 0 value with a range of possible strength from pull driving to medium capacitor<A NAME="marker=441"> </A><A NAME="marker=442"> </A></P></TD></TR></TABLE><P CLASS="SubSubSect"><A NAME="pgfId=933"> </A>Hierarchical name format </P><P CLASS="Body"><A NAME="pgfId=935"> </A>The <CODE CLASS="code">%m</CODE> format specifier does not accept an argument. Instead, it causes the display task to print the hierarchical name of the module, task, function, or named block that invokes the system task containing the format specifier. This is useful when there are many instances of the module that calls the system task. One obvious application is timing check messages in a flip-flop or latch module; the <CODE CLASS="code">%m</CODE> format specifier will pinpoint the module instance responsible for generating the timing check message.</P><P CLASS="SubSubSect"><A NAME="pgfId=936"> </A><A NAME="23449"> </A><A NAME="marker=153"> </A><A NAME="marker=154"> </A>String format</P><P CLASS="Body"><A NAME="pgfId=938"> </A>The<A NAME="marker=155"> </A> <CODE CLASS="code">%s</CODE> format specifier is used to print ASCII codes as characters. For each <CODE CLASS="code">%s</CODE> specification that appears in a string, a corresponding parameter must follow the string in the argument list. The associated argument is interpreted as a sequence of 8-bit hexadecimal ASCII codes, with each 8 bits representing a single character. If the argument is a variable, its value should be right-justified so that the right-most bit of the value is the least-significant bit of the last character in the string. No termination character or value is required at the end of a string, and leading zeros are never printed<A NAME="marker=156"> </A><A NAME="marker=157"> </A>.<A NAME="marker=158"> </A><A NAME="marker=159"> </A></P><P CLASS="SubSection"><A NAME="pgfId=939"> </A><A NAME="66824"> </A><A NAME="marker=160"> </A><A NAME="marker=162"> </A>Strobed monitoring </P></DIV><DIV><H2 CLASS="Syntax"><A NAME="pgfId=941"> </A></H2><PRE CLASS="BNFDef"><A NAME="pgfId=709"> </A></PRE><DIV><IMG SRC="ch14-8.gif"></DIV><P CLASS="BNFCapBody"><A NAME="pgfId=943"> </A>Syntax&nbsp;14-2: Syntax for $strobe system tasks</P><P CLASS="Body"><A NAME="pgfId=942"> </A>The system task <A NAME="marker=166"> </A><B CLASS="Keyword">$strobe</B> provides the ability to display simulation data at a selected time, but at the end of the current simulation time, when all the simulation events that have occurred for that simulation time, just before simulation time is advanced. The arguments for this task are specified in exactly the same manner as for the <B CLASS="Keyword">$display</B><A NAME="marker=167"> </A><A NAME="marker=168"> </A> system task--including the use of escape sequences for special characters and format specifications (see <A HREF="ch14.1.htm#18128" CLASS="XRef">See The display and write tasks</A>).</P></DIV><DIV><H2 CLASS="Example"><A NAME="pgfId=946"> </A></H2><PRE CLASS="CodeIndent"><A NAME="pgfId=727"> </A><B CLASS="Keyword">forever</B><A NAME="marker=172"> </A> @(<B CLASS="Keyword">negedge</B> clock) <B CLASS="Keyword">	$strobe</B> (&quot;At time %d, data is %h&quot;,<B CLASS="Keyword">$time</B>,data);</PRE><P CLASS="Body"><A NAME="pgfId=947"> </A>In this example, <B CLASS="Keyword">$strobe</B> will write the time and data information to the standard output and the log file at each negative edge of the clock. The action will occur just before simulation time is advanced, after all other events at that time have occurred, so that the data written is sure to be the correct data for that simulation time.</P><P CLASS="SubSection"><A NAME="pgfId=949"> </A><A NAME="36458"> </A><A NAME="marker=175"> </A><A NAME="marker=176"> </A>Continuous monitoring </P></DIV><DIV><H2 CLASS="Syntax"><A NAME="pgfId=951"> </A></H2><P CLASS="Body"><A NAME="pgfId=1303"> </A></P><DIV><IMG SRC="ch14-9.gif"></DIV><P CLASS="BNFCapBody"><A NAME="pgfId=944"> </A>Syntax&nbsp;14-3: Syntax for $monitor system tasks</P><P CLASS="Body"><A NAME="pgfId=1218"> </A>The <B CLASS="Keyword">$monitor</B> task provides the ability to monitor and display the values of any variables or expressions specified as arguments to the task. The arguments for this task are specified in exactly the same manner as for the <A NAME="marker=188"> </A><A NAME="marker=189"> </A><B CLASS="Keyword">$display</B> system task--including the use of escape sequences for special characters and format specifications (see <A HREF="ch14.1.htm#18128" CLASS="XRef">See The display and write tasks</A>).</P><P CLASS="Body"><A NAME="pgfId=954"> </A>When a <B CLASS="Keyword">$monitor</B> task is invoked with one or more arguments, the simulator sets up a mechanism whereby each time a variable or an expression in the argument list changes value-with the exception of the <B CLASS="Keyword">$time</B>, <B CLASS="Keyword">$stime</B> or <B CLASS="Keyword">$realtime</B> system functions-the entire argument list is displayed at the end of the time step as if reported by the <B CLASS="Keyword">$display</B> task. If two or more arguments change value at the same time, only one display is produced that shows the new values.</P><P CLASS="Body"><A NAME="pgfId=955"> </A>Only one <B CLASS="Keyword">$monitor</B> display list can be active at any one time; however, a new <B CLASS="Keyword">$monitor</B> task with a new display list may be issued any number of times during simulation</P><P CLASS="Body"><A NAME="pgfId=707"> </A><A NAME="marker=201"> </A>The <B CLASS="Keyword">$monitoron</B> and <B CLASS="Keyword">$monitoroff</B> tasks control a <A NAME="marker=202"> </A>monitor flag that enables and disables the monitoring. Use <B CLASS="Keyword">$monitoroff</B> to turn off the flag and disable monitoring. The <B CLASS="Keyword">$monitoron</B> system task can be used to turn on the flag so that monitoring is enabled and the most recent call to <B CLASS="Keyword">$monitor </B>can resume its display. A call to <B CLASS="Keyword">$monitoron</B> shall produce a display immediately after it is invoked, regardless of whether a value change has taken place; this is used to establish the initial values at the beginning of a monitoring session. By default, the monitor flag is turned on at the beginning of simulation.</P><P CLASS="Body"><A NAME="pgfId=956"> </A><A NAME="marker=195"> </A><A NAME="marker=196"> </A><A NAME="marker=197"> </A></P></DIV><HR><P><A HREF="ch14.htm">Chapter&nbsp;&nbsp;start</A>&nbsp;&nbsp;&nbsp;<A HREF="ch14.htm">Previous&nbsp;&nbsp;page</A>&nbsp;&nbsp;<A HREF="ch14.2.htm">Next&nbsp;&nbsp;page</A></P></BODY></HTML>

⌨️ 快捷键说明

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