?? ch14.5.htm
字號:
</TR><TR><TD ROWSPAN="1" COLSPAN="1"><P CLASS="CellBody"><A NAME="pgfId=745"> </A>notifier (optional)</P></TD><TD ROWSPAN="1" COLSPAN="1"><P CLASS="CellBody"><A NAME="pgfId=1093"> </A>register</P></TD></TR></TABLE><P CLASS="Body"><A NAME="pgfId=1142"> </A>The reference event must be specified as an edge triggered event using either <B CLASS="Keyword">posedge</B> or <B CLASS="Keyword">negedge</B> keyword. Not specifying an edge results in illegal specification of the reference event.</P><P CLASS="Body"><A NAME="pgfId=1582"> </A>The <B CLASS="Keyword">$recovery</B> timing check system task reports a timing violation in the following case: </P><P CLASS="Body"><A NAME="pgfId=1143"> </A> (time of data event) - (time of reference event) < limit</P><P CLASS="Body"><A NAME="pgfId=1135"> </A>The $recovery system task records the new reference event time before performing the timing check, so if a data event and a reference event occur at the same simulation time, a violation occurs.</P><P CLASS="SubSection"><A NAME="pgfId=1144"> </A>$nocheck</P></DIV><DIV><H2 CLASS="Syntax"><A NAME="pgfId=1110"> </A></H2><PRE CLASS="BNFDef"><A NAME="pgfId=1139"> </A> <B CLASS="Keyword">$nochange</B> <B CLASS="Keyword">(</B> reference_event <B CLASS="Keyword">,</B> data_event <B CLASS="Keyword">,</B> start_edge_offset <B CLASS="Keyword">,</B> end_edge_offset [ <B CLASS="Keyword">,</B> notifier ] <B CLASS="Keyword">) ;</B></PRE><P CLASS="Body"><A NAME="pgfId=1208"> </A><A HREF="ch14.5.htm#79167" CLASS="XRef">See : $nochange arguments</A> defines the <B CLASS="Keyword">$nochange</B><B CLASS="boldemphasis"> </B>system task arguments.</P><TABLE BORDER="1"><CAPTION><P CLASS="TableTitle"><A NAME="pgfId=1145"> </A>Table 14-18<A NAME="79167"> </A>: $nochange arguments</P></CAPTION><TR><TD ROWSPAN="1" COLSPAN="1"><P CLASS="CellBody"><A NAME="pgfId=1153"> </A><CODE CLASS="code">reference_event</CODE></P></TD><TD ROWSPAN="1" COLSPAN="1"><P CLASS="CellBody"><A NAME="pgfId=1162"> </A>edge triggered event</P></TD></TR><TR><TD ROWSPAN="1" COLSPAN="1"><P CLASS="CellBody"><A NAME="pgfId=1171"> </A><CODE CLASS="code">data_event</CODE></P></TD><TD ROWSPAN="1" COLSPAN="1"><P CLASS="CellBody"><A NAME="pgfId=1172"> </A>upper bound event</P></TD></TR><TR><TD ROWSPAN="1" COLSPAN="1"><P CLASS="CellBody"><A NAME="pgfId=1173"> </A><CODE CLASS="code">start_edge_offset</CODE></P></TD><TD ROWSPAN="1" COLSPAN="1"><P CLASS="CellBody"><A NAME="pgfId=1177"> </A>any constant expression or specparam</P></TD></TR><TR><TD ROWSPAN="1" COLSPAN="1"><P CLASS="CellBody"><A NAME="pgfId=1212"> </A><CODE CLASS="code">end_edge_offset</CODE></P></TD><TD ROWSPAN="1" COLSPAN="1"><P CLASS="CellBody"><A NAME="pgfId=1213"> </A>any constant expression or specparam</P></TD></TR><TR><TD ROWSPAN="1" COLSPAN="1"><P CLASS="CellBody"><A NAME="pgfId=1179"> </A>notifier (optional)</P></TD><TD ROWSPAN="1" COLSPAN="1"><P CLASS="CellBody"><A NAME="pgfId=1193"> </A>register</P></TD></TR></TABLE><P CLASS="Body"><A NAME="pgfId=1141"> </A>The $nochange timing check system task reports a timing violation if the data event occurs during the specified level of the control signal, the reference event. The reference event may be specified with the <B CLASS="Keyword">posedge</B> or the <B CLASS="Keyword">negedge</B> keyword, but the edge control specifiers (see <A HREF="ch14.5.htm#edge control specifiers" CLASS="XRef">See Edge-control specifiers</A>) can not be used.</P><P CLASS="Body"><A NAME="pgfId=1214"> </A>The start edge and end edge offsets can expand or shrink the timing violation region, which is defined by the duration of the reference event signal edge. A positive offset for start edge extends the region by starting the timing violation region earlier, a negative offset for start edge shrinks the region by starting the region later. Similarly, a positive offset for end edge extends the timing violation region by ending it later, while a negative offset for end edge shrinks the region by ending it earlier. If both the offsets are zero, the size of the region will not change.</P></DIV><DIV><H2 CLASS="Example"><A NAME="pgfId=1215"> </A></H2><PRE CLASS="CodeIndent"><A NAME="pgfId=1216"> </A><B CLASS="Keyword">$nochange</B>( <B CLASS="Keyword">posedge</B> clk, data, 0, 0) ;</PRE><P CLASS="Body"><A NAME="pgfId=1217"> </A>In this example, <B CLASS="Keyword">$nochange</B> system task will report a violation if the <CODE CLASS="code">data</CODE> signal changes while <CODE CLASS="code">clk</CODE> is high.</P><P CLASS="SubSection"><A NAME="pgfId=1159"> </A>Edge-control specifiers<A NAME="marker=284"> </A><A NAME="edge control specifiers"> </A> </P><P CLASS="Body"><A NAME="pgfId=1161"> </A>The edge-control specifiers may be used to control events in timing checks based on specific edge transitions between <CODE CLASS="code">0</CODE>, <CODE CLASS="code">1</CODE>, and <CODE CLASS="code">x</CODE>.</P></DIV><DIV><H2 CLASS="Syntax"><A NAME="pgfId=748"> </A></H2><P CLASS="Body"><A NAME="pgfId=1583"> </A></P><DIV><IMG SRC="ch14-18.gif"></DIV><P CLASS="BNFCapBody"><A NAME="pgfId=1407"> </A>Syntax 14-7: Syntax for edge control specifier</P><P CLASS="Body"><A NAME="pgfId=1163"> </A>Edge-control specifiers contain the keyword <B CLASS="Keyword">edge</B><A NAME="marker=369"> </A> followed by a square bracketed list of from one to six pairs of edge transitions between <CODE CLASS="code">0</CODE>, <CODE CLASS="code">1</CODE> and <CODE CLASS="code">x</CODE>, as follows:</P><P CLASS="Body"><A NAME="pgfId=1164"> </A> 01 transition from 0 to 1<BR> 0x transition from 0 to x<BR> 10 transition from 1 to 0<BR> 1x transition from 1 to x<BR> x0 transition from x to 0<BR> x1 transition from x to 1</P><P CLASS="Body"><A NAME="pgfId=729"> </A>Edge transitions involving <CODE CLASS="code">z</CODE> are treated the same way as edge transitions involving<B CLASS="boldemphasis"> </B><CODE CLASS="code">x</CODE>.</P><P CLASS="Body"><A NAME="pgfId=1174"> </A>The <B CLASS="Keyword">posedge</B><A NAME="marker=376"> </A> and <B CLASS="Keyword">negedge</B><A NAME="marker=377"> </A> keywords may be used as a shorthand for certain edge control specifiers. For example, the construct:</P><PRE CLASS="CodeIndent"><A NAME="pgfId=1175"> </A><B CLASS="Keyword">posedge</B> clr</PRE><P CLASS="Body"><A NAME="pgfId=1176"> </A>is equivalent to the following:</P><PRE CLASS="CodeIndent"><A NAME="pgfId=805"> </A><B CLASS="Keyword">edge</B>[01, 0x, x1] clr</PRE><P CLASS="Body"><A NAME="pgfId=1178"> </A>Similarly, the construct:</P><PRE CLASS="CodeIndent"><A NAME="pgfId=806"> </A><B CLASS="Keyword">negedge</B> clr</PRE><P CLASS="Body"><A NAME="pgfId=1180"> </A>is the same as the following:</P><PRE CLASS="CodeIndent"><A NAME="pgfId=1181"> </A><B CLASS="Keyword">edge</B>[10, x0, 1x] clr</PRE><P CLASS="Body"><A NAME="pgfId=1182"> </A>However, edge-control specifiers offer the flexibility to declare edge transitions other than <B CLASS="Keyword">posedge</B> and <B CLASS="Keyword">negedge</B>. <A NAME="marker=381"> </A></P><P CLASS="SubSection"><A NAME="pgfId=1183"> </A>Notifiers: user-defined responses to timing violations<A NAME="Notifiers sub-section"> </A><A NAME="marker=382"> </A> </P><P CLASS="Body"><A NAME="pgfId=1185"> </A>Timing check notifiers detect timing check violations behaviorally, and, therefore, take an action as soon as a violation occurs. Such notifiers may be used to print an informative error message describing the violation, or propagate an <CODE CLASS="code">x</CODE> value at the output of the device that reported the violation.</P><P CLASS="Body"><A NAME="pgfId=1186"> </A>The notifier is a <A NAME="marker=384"> </A>register--declared in the module where timing check tasks are invoked--that is passed as the last argument to a system timing check. Whenever a timing violation occurs, the system task updates the value of the notifier. </P><P CLASS="Body"><A NAME="pgfId=1187"> </A>The notifier is an optional argument to all system timing checks and can be omitted from the system task call without adversely affecting its operation. </P><P CLASS="Body"><A NAME="pgfId=1100"> </A><A HREF="ch14.5.htm#24870" CLASS="XRef">See : Notifier value changes</A> shows how the notifier values are toggled when timing violations occur.</P><TABLE BORDER="1"><CAPTION><P CLASS="TableTitle"><A NAME="pgfId=755"> </A>Table 14-19: <A NAME="24870"> </A><A NAME="marker=386"> </A>Notifier value changes</P></CAPTION><TR><TH ROWSPAN="1" COLSPAN="1"><P CLASS="CellHeading"><A NAME="pgfId=757"> </A>BEFORE violation </P></TH><TH ROWSPAN="1" COLSPAN="1"><P CLASS="CellHeading"><A NAME="pgfId=758"> </A> AFTER violation</P></TH></TR><TR><TD ROWSPAN="1" COLSPAN="1"><P CLASS="CellBody"><A NAME="pgfId=759"> </A>x</P></TD><TD ROWSPAN="1" COLSPAN="1"><P CLASS="CellBody"><A NAME="pgfId=760"> </A>0</P></TD></TR><TR><TD ROWSPAN="1" COLSPAN="1"><P CLASS="CellBody"><A NAME="pgfId=761"> </A>0</P></TD><TD ROWSPAN="1" COLSPAN="1"><P CLASS="CellBody"><A NAME="pgfId=762"> </A>1</P></TD></TR><TR><TD ROWSPAN="1" COLSPAN="1"><P CLASS="CellBody"><A NAME="pgfId=763"> </A>1</P></TD><TD ROWSPAN="1" COLSPAN="1"><P CLASS="CellBody"><A NAME="pgfId=764"> </A>0</P></TD></TR><TR><TD ROWSPAN="1" COLSPAN="1"><P CLASS="CellBody"><A NAME="pgfId=765"> </A>z</P></TD><TD ROWSPAN="1" COLSPAN="1"><P CLASS="CellBody"><A NAME="pgfId=798"> </A>z</P></TD></TR></TABLE></DIV><DIV><H2 CLASS="Example"><A NAME="pgfId=1112"> </A></H2><P CLASS="Body"><A NAME="pgfId=1192"> </A>1. </P><DIV><IMG SRC="ch14-19.gif"></DIV><P CLASS="Body"><A NAME="pgfId=1194"> </A>2. Consider a more complex <A NAME="marker=391"> </A>example of how to use notifiers in a behavioral model. The example that follows uses a notifier to set the D flip-flop output to <CODE CLASS="code">x</CODE> when a timing violation occurs in an edge-sensitive user-defined primitive (UDP).</P><P CLASS="Body"><A NAME="pgfId=1195"> </A></P><DIV><IMG SRC="ch14-20.gif"></DIV><P CLASS="Body"><A NAME="pgfId=821"> </A></P><DIV><IMG SRC="ch14-21.gif"></DIV><P CLASS="Note"><A NAME="pgfId=1201"> </A>NOTE--This model applies to edge-sensitive UDPs only; for level-sensitive models, an additional UDP for <CODE CLASS="code">x</CODE> propagation must be generated. <A NAME="marker=394"> </A></P><P CLASS="SubSection"><A NAME="pgfId=1072"> </A>Enabling timing checks with c<A NAME="marker=383"> </A>onditioned events</P><P CLASS="Body"><A NAME="pgfId=1075"> </A>A construct called a conditioned event ties the occurrence of timing checks to the value of a conditioning signal.</P></DIV><DIV><H2 CLASS="Syntax"><A NAME="pgfId=1160"> </A></H2><P CLASS="Body"><A NAME="pgfId=772"> </A></P><DIV><IMG SRC="ch14-22.gif"></DIV><P CLASS="BNFCapBody"><A NAME="pgfId=1414"> </A>Syntax 14-8: Syntax for controlled timing check event</P><P CLASS="Body"><A NAME="pgfId=810"> </A>The comparisons used in the <A NAME="marker=312"> </A><A NAME="marker=325"> </A>condition may be deterministic--as in <B CLASS="Keyword">===</B>, <B CLASS="Keyword">!==</B>, <B CLASS="Keyword">~</B>, or no operation, or non-deterministic--as in <B CLASS="Keyword">==</B> or <B CLASS="Keyword">!=</B>. When comparisons are deterministic, an <CODE CLASS="code">x</CODE> value on the conditioning signal will not enable the timing check. For non-deterministic comparisons, an <CODE CLASS="code">x</CODE> on the conditioning signal will enable the timing check.</P><P CLASS="Body"><A NAME="pgfId=1124"> </A>The conditioning signal must be a scalar net; if a vector net or an expression resulting in a multi-bit value is used then the least significant bit of the vector net or the expression value is used.</P><P CLASS="Body"><A NAME="pgfId=1129"> </A>If more than one conditioning signal is required for conditioning timing checks, appropriate logic must be combined in a separate signal outside the specify block, which may be used as the conditioning signal.</P></DIV><DIV><H2 CLASS="Example"><A NAME="pgfId=809"> </A></H2><P CLASS="Body"><A NAME="pgfId=807"> </A>1. To illustrate the <A NAME="marker=397"> </A>difference between conditioned and unconditioned timing check events, consider the following example with unconditioned timing check: </P><PRE CLASS="CodeIndent"><A NAME="pgfId=1209"> </A><B CLASS="Keyword">$setup</B>( data, <B CLASS="Keyword">posedge</B> clk, 10 );</PRE><P CLASS="Body"><A NAME="pgfId=1210"> </A>Here, a setup timing check will occur every time there is a positive edge on signal <CODE CLASS="code">clk</CODE>.</P><P CLASS="Body"><A NAME="pgfId=1211"> </A>To trigger the setup check on the positive edge on signal <CODE CLASS="code">clk</CODE> only when signal<CODE CLASS="code"> clr</CODE> is high, rewrite the command as:</P><PRE CLASS="CodeIndent"><A NAME="pgfId=808"> </A><B CLASS="Keyword">$setup</B>( data, <B CLASS="Keyword">posedge</B> clk <B CLASS="Keyword">&&&</B> clr, 10 ) ;</PRE><P CLASS="Body"><A NAME="pgfId=769"> </A>2. This example shows two ways to trigger the same timing check as above (on the positive <CODE CLASS="code">clk</CODE> edge) only when <CODE CLASS="code">clr</CODE> is low. The second method uses <B CLASS="Keyword">===</B> operator, which makes the comparison deterministic.</P><PRE CLASS="CodeIndent"><A NAME="pgfId=812"> </A><B CLASS="Keyword">$setup</B>( data, <B CLASS="Keyword">posedge</B> clk <B CLASS="Keyword">&&&</B> (<B CLASS="Keyword">~</B>clr), 10 ) ;<B CLASS="Keyword">$setup</B>( data, <B CLASS="Keyword">posedge</B> clk <B CLASS="Keyword">&&&</B> (clr<B CLASS="Keyword">===</B>0), 10 );</PRE><P CLASS="Body"><A NAME="pgfId=811"> </A></P><P CLASS="Body"><A NAME="pgfId=1222"> </A>3. To perform the previous sample setup check on the positive <CODE CLASS="code">clk</CODE> edge only when <CODE CLASS="code">clr</CODE> and <CODE CLASS="code">set</CODE> are high, add the following statement outside the specify block:</P><PRE CLASS="CodeIndent"><A NAME="pgfId=1223"> </A><B CLASS="Keyword">and</B> new_gate( clr_and_set, clr, set );</PRE><P CLASS="Body"><A NAME="pgfId=1224"> </A>Then, add the condition to the timing check using the signal <CODE CLASS="code">clr_and_set</CODE> as follows:</P><PRE CLASS="CodeIndent"><A NAME="pgfId=788"> </A><B CLASS="Keyword">$setup</B>( data, <B CLASS="Keyword">posedge</B> clk <B CLASS="Keyword">&&&</B> clr_and_set, 10 );<A NAME="marker=209"> </A><A NAME="marker=210"> </A></PRE></DIV><HR><P><A HREF="ch14.htm">Chapter start</A> <A HREF="ch14.4.htm">Previous page</A> <A HREF="ch14.6.htm">Next page</A></P></BODY></HTML>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -