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

📄 00367.html

📁 这是一本关于verilog编程语言的教程,对学习verilog语言有帮助
💻 HTML
📖 第 1 页 / 共 2 页
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN">
<html>
<head>
<title>29.4.3 Obtaining coverage information</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', '00367.html');" onmousedown="onBodyMouseDown();">

<!-- Begin Popups -->
<div class="Element801" id="popup00553">
<div class="Element800">
<div class="Element14">
链接</div>
<div class="Element11">
<div class="Element10">
<a href="00364.html" target="topic">29.4 VPI coverage extensions</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, 'popup00553');"><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="00366.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="00364.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="00368.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">
29.4.3 Obtaining coverage information</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">
To obtain coverage information, the vpi_get() function is extended with additional VPI properties that can be obtained from existing handles: </p><div class="Element170">
<a href="#" onclick="CopyElementToClipboard('code01019');">Copy Code</a></div>
<div class="Element13"><div class="Element12" id="code01019"><pre class="Element12">vpi_get(&lt;coverageType&gt;, instance_handle)</pre></div></div>
<p class="Element10">
Returns the number of covered items of the given coverage type in the given instance. Coverage type is one of the coverage type properties described in Section 29.4.2. For example, given coverage type vpiStatement- Coverage, this call would return the number of covered statements in the instance pointed by instance_handle. </p><div class="Element170">
<a href="#" onclick="CopyElementToClipboard('code01020');">Copy Code</a></div>
<div class="Element13"><div class="Element12" id="code01020"><pre class="Element12">vpi_get(vpiCovered, assertion_handle)
vpi_get(vpiCovered, statement_handle)
vpi_get(vpiCovered, signal_handle)
vpi_get(vpiCovered, fsm_handle)
vpi_get(vpiCovered, fsm_state_handle)</pre></div></div>
<p class="Element10">
Returns whether the item referenced by the handle has been covered. For handles that can contain multiple coverable entities, such as statement, fsm and signal handles, the return value indicates how many of the entities have been covered.&nbsp;</p>
<p class="Element10">
— For assertion handle, the coverable entities are assertions&nbsp;</p>
<p class="Element10">
— For statement handle, the entities are statements&nbsp;</p>
<p class="Element10">
— For signal handle, the entities are individual signal bits&nbsp;</p>
<p class="Element10">
— For fsm handle, the entities are fsm states&nbsp;</p>
<p class="Element10">
For assertions, vpiCovered implies that the assertion has been attempted, has succeeded at least once and has never failed. More detailed coverage information can be obtained for assertions by the following queries: </p><div class="Element170">
<a href="#" onclick="CopyElementToClipboard('code01021');">Copy Code</a></div>
<div class="Element13"><div class="Element12" id="code01021"><pre class="Element12">vpi_get(vpiAssertAttemptCovered, assertion_handle)</pre></div></div>
<p class="Element10">
Returns the number of times the assertion has been attempted. </p><div class="Element170">
<a href="#" onclick="CopyElementToClipboard('code01022');">Copy Code</a></div>
<div class="Element13"><div class="Element12" id="code01022"><pre class="Element12">vpi_get(vpiAssertSuccessCovered, assertion_handle)</pre></div></div>
<p class="Element10">
Returns the number of times the assertion has succeeded non-vacuously or, if assertion handle corresponds to a cover sequence, the number of times the sequence has been matched. Refer to Section 17.11.1 and 17.13 for the definition of vacuity. </p><div class="Element170">
<a href="#" onclick="CopyElementToClipboard('code01023');">Copy Code</a></div>
<div class="Element13"><div class="Element12" id="code01023"><pre class="Element12">vpi_get(vpiAssertVacuousSuccessCovered, assertion_handle)</pre></div></div>
<p class="Element10">
Returns the number of times the assertion has succeeded vacuously. Refer to Section 17.11.1 and 17.13 for the definition of vacuity. </p><div class="Element170">
<a href="#" onclick="CopyElementToClipboard('code01024');">Copy Code</a></div>
<div class="Element13"><div class="Element12" id="code01024"><pre class="Element12">vpi_get(vpiAssertFailureCovered, assertion_handle)</pre></div></div>
<p class="Element10">
Returns the number of times the assertion has failed. For any assertion, the number of attempts that have not yet reached any conclusion (success or failure) can be derived from the formula: </p><div class="Element170">
<a href="#" onclick="CopyElementToClipboard('code01025');">Copy Code</a></div>
<div class="Element13"><div class="Element12" id="code01025"><pre class="Element12">in progress = attempts - (successes + vacuous success + failures)</pre></div></div>
<p class="Element10">
The example below illustrates some of these queries: </p><div class="Element170">
<a href="#" onclick="CopyElementToClipboard('code01026');">Copy Code</a></div>
<div class="Element13"><div class="Element12" id="code01026"><pre class="Element12">module covtest;
    bit on = 1, off = 0;
    logic clk;

    initial begin
        clk = 0;
        forever begin
            #10;
            clk = ~clk;
        end
    end

    always @(false) begin
        anvr: assert(on ##1 on); // assertion will not be attempted
    end

    always @(posedge clk) begin
        aundf: assert (on ##[1:$] off); // assertion will not pass or fail
        afail: assert (on ##1 off); // assertion will always fail on 2nd tick
        apass: assert (on ##1 on); // assertion will succeed on each attempt
    end
endmodule</pre></div></div>
<p class="Element10">
For this example, the assertions will have the following coverage results: </p><p class="Element10" style="text-align: center">
<strong>Table 29-3: Assertion coverage results</strong></p><div class="Element63">
<div class="TableDiv">
<table cellspacing="0" class="Table1">
<tr>
<td class="Element65" valign="top" width="11%">
<div class="Element66">
&nbsp;</div></td><td class="Element65" valign="top" width="15%">
<div class="Element66">
vpiCovered&nbsp;</div></td><td class="Element65" valign="top" width="24%">
<div class="Element66">
vpiAssertAttempt-<br>Covered&nbsp;</div></td><td class="Element65" valign="top" width="25%">
<div class="Element66">
vpiAssertSuccess-<br>Covered&nbsp;</div></td><td class="Element65" valign="top" width="25%">
<div class="Element66">
vpiAssertFailure-<br>Covered&nbsp;</div></td></tr><tr>
<td class="Element67" valign="top" width="11%">
<div class="Element68">
anvr&nbsp;</div></td><td class="Element67" valign="top" width="15%">

⌨️ 快捷键说明

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