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

📄 00147.html

📁 这是一本关于verilog编程语言的教程,对学习verilog语言有帮助
💻 HTML
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN">
<html>
<head>
<title>17.11.2 特性的例子</title>
    <meta http-equiv="Content-Type" content="text/html; charset=GB2312" />
    <meta name="generator" content="Doc-O-Matic" />
    <meta http-equiv="Content-Style-Type" content="text/css" />
    <link rel="STYLESHEET" href="default.css" type="text/css" />

<script type="text/javascript" src="scripts.js"></script>
</head>
<body class="Element700" onload="onBodyLoadEx('systemverilog31a.html', 'topic', '00147.html');" onmousedown="onBodyMouseDown();">

<!-- Begin Popups -->
<div class="Element801" id="popup00351">
<div class="Element800">
<div class="Element14">
链接</div>
<div class="Element11">
<div class="Element10">
<a href="00145.html" target="topic">17.11 声明特性</a></div>
</div>
</div>
</div>

<!-- End Popups -->

<!-- Begin Page Header -->
<div class="Element710" id="areafixed">
<div class="Element92">
<table width="100%" cellspacing="0" cellpadding="0">
<tr><td width="33%">
<div class="Element1">
<a href="#" onmousedown="showPopup(this, 'popup00351');"><img src="seealsolink.png" border="0" alt="" title=""></a> SystemVerilog 3.1a语言参考手册</div>
</td><td width="34%">
<div class="Element2">
</div>
</td><td width="33%">
<div class="Element90">
<a href="00146.html" target="topic"><img src="btn_prev_lightblue.gif" border="0" alt="Previous" title="Previous" onmouseover="switchImage(this, 'btn_prev_lightblue_hover.gif');" onmouseout="switchImage(this, 'btn_prev_lightblue.gif');"></a><a href="00145.html" target="topic"><img src="btn_up_lightblue.gif" border="0" alt="Up" title="Up" onmouseover="switchImage(this, 'btn_up_lightblue_hover.gif');" onmouseout="switchImage(this, 'btn_up_lightblue.gif');"></a><a href="00148.html" target="topic"><img src="btn_next_lightblue.gif" border="0" alt="Next" title="Next" onmouseover="switchImage(this, 'btn_next_lightblue_hover.gif');" onmouseout="switchImage(this, 'btn_next_lightblue.gif');"></a></div>
</td></tr></table><div class="Element5">
17.11.2 特性的例子</div>
</div>
</div>

<!-- End Page Header -->

<!-- Begin Client Area -->
<div class="Element720" id="areascroll">
<div class="Element721">

<!-- Begin Page Content -->
<div class="Element58">
<a name="描述"></a><div class="Element11">
<div class="Element10">
<p class="Element10">
下面的例子演示了特性的格式。 </p><div class="Element170">
<a href="#" onclick="CopyElementToClipboard('code00686');">Copy Code</a></div>
<div class="Element13"><div class="Element12" id="code00686"><pre class="Element12"><span style="color: #0000FF">property</span> rule1<span style="color: #800080">;</span>
    <span style="color: #800080">@(</span><span style="color: #0000FF">posedge</span> clk<span style="color: #800080">)</span>
        a <span style="color: #800080">|-&gt;</span> b <span style="color: #800080">##</span><span style="color: #FF0000">1</span> c <span style="color: #800080">##</span><span style="color: #FF0000">1</span> d<span style="color: #800080">;</span>
<span style="color: #0000FF">endproperty</span>

<span style="color: #0000FF">property</span> rule2<span style="color: #800080">;</span>
    <span style="color: #800080">@(</span>clkev<span style="color: #800080">)</span>
<span style="color: #0000FF">        disable iff</span> <span style="color: #800080">(</span>foo<span style="color: #800080">)</span>
            a <span style="color: #800080">|-&gt;</span> <span style="color: #0000FF">not</span><span style="color: #800080">(</span>b <span style="color: #800080">##</span><span style="color: #FF0000">1</span> c <span style="color: #800080">##</span><span style="color: #FF0000">1</span> d<span style="color: #800080">);</span>
<span style="color: #0000FF">endproperty</span></pre></div></div>
<p class="Element10">
&nbsp;</p>
<p class="Element10">
特性<i><span class="Element146">rule2</span></i>对蕴含中后项的<span class="Element146"><span style="color: #800080">(</span>b <span style="color: #800080">##</span><span style="color: #FF0000">1</span> c <span style="color: #800080">##</span><span style="color: #FF0000">1</span> d<span style="color: #800080">)</span></span>序列取反。<i><span class="Element146">clkev</span></i>为特性指定了时钟。 </p><div class="Element170">
<a href="#" onclick="CopyElementToClipboard('code00687');">Copy Code</a></div>
<div class="Element13"><div class="Element12" id="code00687"><pre class="Element12"><span style="color: #0000FF">property</span> rule3<span style="color: #800080">;</span>
    <span style="color: #800080">@(</span><span style="color: #0000FF">posedge</span> clk<span style="color: #800080">)</span>
        a<span style="color: #800080">[*</span><span style="color: #FF0000">2</span><span style="color: #800080">] |-&gt; ((##[</span><span style="color: #FF0000">1</span><span style="color: #800080">:</span><span style="color: #FF0000">3</span><span style="color: #800080">]</span> c<span style="color: #800080">)</span> <span style="color: #0000FF">or</span> <span style="color: #800080">(</span>d <span style="color: #800080">|=&gt;</span> e<span style="color: #800080">));</span>
<span style="color: #0000FF">endproperty</span></pre></div></div>
<p class="Element10">
&nbsp;</p>
<p class="Element10">
Property rule3 says that if a holds and a also held last cycle, then either c must hold at some point 1 to three cycles after the current cycle, or, if d holds in the current cycle, then e must hold one cycle later. </p><div class="Element170">
<a href="#" onclick="CopyElementToClipboard('code00688');">Copy Code</a></div>
<div class="Element13"><div class="Element12" id="code00688"><pre class="Element12"><span style="color: #0000FF">property</span> rule4<span style="color: #800080">;</span>
    <span style="color: #800080">@(</span><span style="color: #0000FF">posedge</span> clk<span style="color: #800080">)</span>
        a<span style="color: #800080">[*</span><span style="color: #FF0000">2</span><span style="color: #800080">] |-&gt; ((##[</span><span style="color: #FF0000">1</span><span style="color: #800080">:</span><span style="color: #FF0000">3</span><span style="color: #800080">]</span> c<span style="color: #800080">)</span> <span style="color: #0000FF">and</span> <span style="color: #800080">(</span>d <span style="color: #800080">|=&gt;</span> e<span style="color: #800080">));</span>
<span style="color: #0000FF">endproperty</span></pre></div></div>
<p class="Element10">
&nbsp;</p>
<p class="Element10">
Property rule4 says that if a holds and a also held last cycle, then c must hold at some point 1 to three cycles after the current cycle, and if d holds in the current cycle, then e must hold one cycle later. </p><div class="Element170">
<a href="#" onclick="CopyElementToClipboard('code00689');">Copy Code</a></div>
<div class="Element13"><div class="Element12" id="code00689"><pre class="Element12"><span style="color: #0000FF">property</span> rule5<span style="color: #800080">;</span>
    <span style="color: #800080">@(</span><span style="color: #0000FF">posedge</span> clk<span style="color: #800080">)</span>
        a <span style="color: #800080">##</span><span style="color: #FF0000">1</span> <span style="color: #800080">(</span>b <span style="color: #800080">||</span> c<span style="color: #800080">)[-&gt;</span><span style="color: #FF0000">1</span><span style="color: #800080">] |-&gt;</span>
            <span style="color: #0000FF">if</span> <span style="color: #800080">(</span>b<span style="color: #800080">)</span>
                <span style="color: #800080">(##</span><span style="color: #FF0000">1</span><span style="color: #800080"> </span>d<span style="color: #800080"> |-&gt; </span>e<span style="color: #800080">)</span>
            <span style="color: #0000FF">else</span> <span style="color: #008000">// c</span>
                f;
<span style="color: #0000FF">endproperty</span></pre></div></div>
<p class="Element10">
&nbsp;</p>
<p class="Element10">
Property rule5 has a followed by the first match of either b or c as its antecedent. The consequent uses if...else to split cases on which of b or c is matched first. </p><div class="Element170">
<a href="#" onclick="CopyElementToClipboard('code00690');">Copy Code</a></div>
<div class="Element13"><div class="Element12" id="code00690"><pre class="Element12"><span style="color: #0000FF">property</span> rule6<span style="color: #800080">(</span>x<span style="color: #800080">,</span>y<span style="color: #800080">);</span>
    <span style="color: #800080">##</span><span style="color: #FF0000">1</span> x <span style="color: #800080">|-&gt;</span> y<span style="color: #800080">;</span>
<span style="color: #0000FF">endproperty</span>

<span style="color: #0000FF">property</span> rule5a<span style="color: #800080">;</span>
    <span style="color: #800080">@(</span><span style="color: #0000FF">posedge</span> clk<span style="color: #800080">)</span>
        a <span style="color: #800080">##</span><span style="color: #FF0000">1</span> <span style="color: #800080">(</span>b <span style="color: #800080">||</span> c<span style="color: #800080">)[-&gt;</span><span style="color: #FF0000">1</span><span style="color: #800080">] |-&gt;</span>
            <span style="color: #0000FF">if</span> <span style="color: #800080">(</span>b<span style="color: #800080">)</span>
                rule6<span style="color: #800080">(</span>d<span style="color: #800080">,</span>e<span style="color: #800080">)</span>
            <span style="color: #0000FF">else</span> <span style="color: #008000">// c</span>
                f;
<span style="color: #0000FF">endproperty</span></pre></div></div>
<p class="Element10">
&nbsp;</p>
<p class="Element10">
特性<i><span class="Element146">rule5a</span></i>等价于<i><span class="Element146">rule5</span></i>,但它使用<i><span class="Element146">rule6</span></i>的一个实例作为一个特性表达式。&nbsp;</p>
<p class="Element10">
&nbsp;</p>
<p class="Element10">
一个特性可以可选地为时钟指定一个事件控制。时钟派生和解析的规则将在<a href="00163.html" target="topic">17.14节</a>中描述。&nbsp;</p>
<p class="Element10">
&nbsp;</p>
<p class="Element10">
一个命名特性可以通过引用它的名字来实例化。与SystemVerilog命名约定一致,我们可以使用一个层次化的名字。像序列声明一样,对于在一个特性中使用并且不是特性的形式参数的变量,它们从特性被声明的作用域中进行层次化的解析。&nbsp;</p>
<p class="Element10">
&nbsp;</p>
<p class="Element10">
使用多个时钟的特性将在<a href="00151.html" target="topic">17.12节</a>中描述。</p></div>
</div>
<a name="Group"></a><div class="Element14">
<a onclick="toggleVisibilityStored('Group');" class="a_Element14"><img src="sectionminus.png" border="0" alt="" title="" id="imgGroup">Group</a></div>
<div id="divGroup">
<div class="Element11">
<div class="Element10">
<p class="Element10">
<a href="00145.html" target="topic">17.11 声明特性</a></p></div>
</div>
</div>
<a name="Links"></a><div class="Element14">
<a onclick="toggleVisibilityStored('链接');" class="a_Element14"><img src="sectionminus.png" border="0" alt="" title="" id="img链接">链接</a></div>
<div id="div链接">
<div class="Element11">
<div class="Element10">
<a href="00145.html" target="topic">17.11 声明特性</a></div>
</div>
</div>
</div>
<!-- End Page Content -->

<!-- Begin Page Footer -->
<hr width="98%" align="center" size="1" color="#CCCCCC" />
<table align="center" cellpadding="0" cellspacing="0" border="0">
	<tbody>
		<tr height="10">
			<td></td>
		</tr>
		<tr align="center">
			<td>
<script type="text/javascript"><!--
google_ad_client = "pub-5266859600380184";
google_ad_width = 468;
google_ad_height = 60;
google_ad_format = "468x60_as";
google_ad_type = "text_image";
google_ad_channel ="";
google_page_url = document.location;
//--></script>
<script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
			</td>
		</tr>
		<tr height="15">
			<td></td>
		</tr>
		<tr align="center">
			<td>
				<font size=2>除非特别声明,原文版权归作者所有,如有转摘请注明原作者以及译者(<a href="http://www.fpgatech.net/"  target="_blank">FPGA技术网</a>)信息。<br />
如果您对本主题有何建议或意见,请登陆<a href="http://www.fpgatech.net/forum/forumdisplay.php?fid=18" target="_blank">FPGA开发者家园</a>提交,您的参与是我们前进的动力。</font>
<script language="javascript" type="text/javascript" src="http://js.users.51.la/195685.js"></script>
<noscript><a href="http://www.51.la/?195685" target="_blank"><img alt="&#x6211;&#x8981;&#x5566;&#x514D;&#x8D39;&#x7EDF;&#x8BA1;" src="http://img.users.51.la/195685.asp" style="border:none" /></a></noscript>
			</td>
		</tr>
	</tbody>
</table>

<!-- End Page Footer -->
</div>
</div>

<!-- End Client Area -->
</body></html>

⌨️ 快捷键说明

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