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

📄 00258.html

📁 这是一本关于verilog编程语言的教程,对学习verilog语言有帮助
💻 HTML
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN">
<html>
<head>
<title>20.6.1 Covergroup Type Options</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', '00258.html');" onmousedown="onBodyMouseDown();">

<!-- Begin Popups -->
<div class="Element801" id="popup00436">
<div class="Element800">
<div class="Element14">
链接</div>
<div class="Element11">
<div class="Element10">
<a href="00257.html" target="topic">20.6 Specifying coverage options</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, 'popup00436');"><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="00257.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="00257.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="00259.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">
20.6.1 Covergroup Type Options</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">
The following table lists options that describe a particular feature (or property) of the covergroup type as a whole. They are analogous to static data members of classes. </p><p class="Element10" style="text-align: center">
<strong>Table 20-3: Coverage group type (static) options</strong></p><div class="Element63">
<div class="TableDiv">
<table cellspacing="0" class="Table1">
<tr>
<td class="Element65" valign="top" width="12%">
<div class="Element66">
Option name&nbsp;</div></td><td class="Element65" valign="top" width="2%">
<div class="Element66">
Default&nbsp;</div></td><td class="Element65" valign="top" width="86%">
<div class="Element66">
Description&nbsp;</div></td></tr><tr>
<td class="Element67" valign="top" width="12%">
<div class="Element68">
weight=constant_number&nbsp;</div></td><td class="Element67" valign="top" width="2%">
<div class="Element68">
1&nbsp;</div></td><td class="Element67" valign="top" width="86%">
<div class="Element68">
If set at the covergroup syntactic level, it specifies the weight of this covergroup for computing the overall cumulative (or type) coverage of the saved database. If set at the coverpoint (or cross) syntactic level, it specifies the weight of a coverpoint (or cross) for computing the cumulative (or type) coverage of the enclosing covergroup.&nbsp;</div></td></tr><tr>
<td class="Element67" valign="top" width="12%">
<div class="Element68">
goal=constant_number&nbsp;</div></td><td class="Element67" valign="top" width="2%">
<div class="Element68">
90&nbsp;</div></td><td class="Element67" valign="top" width="86%">
<div class="Element68">
Specifies the target goal for a covergroup type, or a coverpoint or cross of a covergroup type.&nbsp;</div></td></tr><tr>
<td class="Element67" valign="top" width="12%">
<div class="Element68">
comment=string_literal&nbsp;</div></td><td class="Element67" valign="top" width="2%">
<div class="Element68">
&quot;&quot;&nbsp;</div></td><td class="Element67" valign="top" width="86%">
<div class="Element68">
A comment that appears with the covergroup type, or a coverpoint or cross of the covergroup type. The comment is saved in the coverage database and included in the coverage report.&nbsp;</div></td></tr><tr>
<td class="Element67" valign="top" width="12%">
<div class="Element68">
strobe=constant_number&nbsp;</div></td><td class="Element67" valign="top" width="2%">
<div class="Element68">
0&nbsp;</div></td><td class="Element67" valign="top" width="86%">
<div class="Element68">
If set to 1, all samples happen at the end of the time slot, like the $strobe system task.&nbsp;</div></td></tr></table></div></div>
<p class="Element10">
&nbsp;</p>
<p class="Element10">
The covergroup type options mentioned above can be set in the covergroup definition. The syntax for setting these options in the covergroup definition is: </p><div class="Element170">
<a href="#" onclick="CopyElementToClipboard('code00912');">Copy Code</a></div>
<div class="Element13"><div class="Element12" id="code00912"><pre class="Element12">type_option.option_name = expression ;</pre></div></div>
<p class="Element10">
The identifier type_option is a built-in member of any coverage group (see Section 20.9 for a description).&nbsp;</p>
<p class="Element10">
&nbsp;</p>
<p class="Element10">
Different instances of a covergroup cannot assign different values to type options. This is syntactically disallowed, since these options can only be initialized via constant expressions. Here is an example: </p><div class="Element170">
<a href="#" onclick="CopyElementToClipboard('code00913');">Copy Code</a></div>
<div class="Element13"><div class="Element12" id="code00913"><pre class="Element12">covergroup g1 (int w, string instComment) @(posedge clk) ;
    // track coverage information for each instance of g1 in addition
    // to the cumulative coverage information for covergroup type g1
    option.per_instance = 1;
    type_option.comment = &quot;Coverage model for features foo and bar&quot;;
    type_option.strobe = 1; // sample at the end of the time slot

    // comment for each instance of this covergroup
    option.comment = instComment;

    a : coverpoint a_var
   {
        // Use weight 2 to compute the coverage of each instance
        option.weight = 2;

        // Use weight 3 to compute the cumulative (type) coverage for g1
        type_option.weight = 3;
        // NOTE: type_option.weight = w would cause syntax error.
    }

    b : coverpoint b_var
    {
        // Use weight w to compute the coverage of each instance
        option.weight = w;

        // Use weight 5 to compute the cumulative (type) coverage of g1
        type_option.weight = 5;
    }
endgroup</pre></div></div>
<p class="Element10">
In the above example the coverage for each instance of g1 is computed as: </p><div class="Element170">
<a href="#" onclick="CopyElementToClipboard('code00914');">Copy Code</a></div>
<div class="Element13"><div class="Element12" id="code00914"><pre class="Element12">(((instance coverage of “a”) * 2) + ((instance coverage of “b”) * w)) / ( 2 + w)</pre></div></div>
<p class="Element10">
On the other hand the coverage for covergroup type “g1” is computed as: </p><div class="Element170">
<a href="#" onclick="CopyElementToClipboard('code00915');">Copy Code</a></div>
<div class="Element13"><div class="Element12" id="code00915"><pre class="Element12">( ((overall type coverage of “a”) * 3) + ((overall type coverage of “b”) * 5) ) / (3 + 5).</pre></div></div>
<p class="Element10">
Type options can be set procedurally at any time during simulation. The syntax is: </p><div class="Element170">
<a href="#" onclick="CopyElementToClipboard('code00916');">Copy Code</a></div>
<div class="Element13"><div class="Element12" id="code00916"><pre class="Element12">coverage_type_option_assignment ::=   // not in Annex A
    covergroup_name<strong><span style="color: #FF0000">::type_option.</span></strong>option_name<strong><span style="color: #FF0000">=</span></strong>expression<strong><span style="color: #FF0000">;</span></strong>
  | covergroup_name<strong><span style="color: #FF0000">::</span></strong>covergroup_item_identifier<strong><span style="color: #FF0000">::type_option.</span></strong>option_name<strong><span style="color: #FF0000">=</span></strong>expression<strong><span style="color: #FF0000">;</span></strong></pre></div></div>
<p class="Element10" style="text-align: center">
<strong>Syntax 20-6—Coverage type option assignment syntax (not in Annex A)</strong></p><p class="Element10">
&nbsp;</p>
<p class="Element10">
Here is an example: </p><div class="Element170">
<a href="#" onclick="CopyElementToClipboard('code00917');">Copy Code</a></div>
<div class="Element13"><div class="Element12" id="code00917"><pre class="Element12">covergroup gc @(posedge clk) ;
    a : coverpoint a_var;
    b : coverpoint b_var;
endgroup
...
gc::type_option.comment = &quot;Here is a comment for covergroup g1&quot;;
// Set the weight for coverpoint &quot;a&quot; of covergroup g1
gc::a::type_option.weight = 3;
gc g1 = new;</pre></div></div>
<p class="Element10">
The following table summarizes the syntactical level (covergroup, coverpoint, or cross) in which type options can be specified. When set at the covergroup level, the type options do not act as defaults for lower syntactic levels.&nbsp;</p>
<p class="Element10">
&nbsp;</p><p class="Element10" style="text-align: center">
<strong>Table 20-4: Coverage type-options</strong>&nbsp;</p><div class="Element63">
<div class="TableDiv">
<table cellspacing="0" class="Table1">
<tr>
<td class="Element65" valign="top" width="29%">
<div class="Element66">
Option name&nbsp;</div></td><td class="Element65" valign="top" width="38%">
<div class="Element66">
Allowed Syntactic Level&nbsp;</div></td><td class="Element65" valign="top" width="18%">
<div class="Element66">
&nbsp;</div></td><td class="Element65" valign="top" width="14%">
<div class="Element66">
&nbsp;</div></td></tr><tr>
<td class="Element67" valign="top" width="29%">
<div class="Element68">
&nbsp;</div></td><td class="Element67" valign="top" width="38%">
<div class="Element68">
covergroup&nbsp;</div></td><td class="Element67" valign="top" width="18%">
<div class="Element68">
coverpoint&nbsp;</div></td><td class="Element67" valign="top" width="14%">
<div class="Element68">
cross&nbsp;</div></td></tr><tr>
<td class="Element67" valign="top" width="29%">
<div class="Element68">
weight&nbsp;</div></td><td class="Element67" valign="top" width="38%">
<div class="Element68">
Yes&nbsp;</div></td><td class="Element67" valign="top" width="18%">
<div class="Element68">
Yes&nbsp;</div></td><td class="Element67" valign="top" width="14%">
<div class="Element68">
Yes&nbsp;</div></td></tr><tr>
<td class="Element67" valign="top" width="29%">
<div class="Element68">
goal&nbsp;</div></td><td class="Element67" valign="top" width="38%">
<div class="Element68">
Yes&nbsp;</div></td><td class="Element67" valign="top" width="18%">
<div class="Element68">
Yes&nbsp;</div></td><td class="Element67" valign="top" width="14%">
<div class="Element68">
Yes&nbsp;</div></td></tr><tr>
<td class="Element67" valign="top" width="29%">
<div class="Element68">
comment&nbsp;</div></td><td class="Element67" valign="top" width="38%">
<div class="Element68">
Yes&nbsp;</div></td><td class="Element67" valign="top" width="18%">
<div class="Element68">
Yes&nbsp;</div></td><td class="Element67" valign="top" width="14%">
<div class="Element68">
Yes&nbsp;</div></td></tr><tr>
<td class="Element67" valign="top" width="29%">
<div class="Element68">
strobe&nbsp;</div></td><td class="Element67" valign="top" width="38%">
<div class="Element68">
Yes&nbsp;</div></td><td class="Element67" valign="top" width="18%">
<div class="Element68">
No&nbsp;</div></td><td class="Element67" valign="top" width="14%">
<div class="Element68">
No&nbsp;</div></td></tr></table></div></div>
</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="00257.html" target="topic">20.6 Specifying coverage options</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="00257.html" target="topic">20.6 Specifying coverage options</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 + -