📄 00116.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN">
<html>
<head>
<title>14.3 分层的事件调度器</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', '00116.html');" onmousedown="onBodyMouseDown();">
<!-- Begin Popups -->
<div class="Element801" id="popup00296">
<div class="Element800">
<div class="Element14">
链接</div>
<div class="Element11">
<div class="Element10">
<a href="00870.html" target="topic">第十四章 调度语义</a>, <a href="00940.html" target="topic">主题</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, 'popup00296');"><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="00115.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="00870.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="00117.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">
14.3 分层的事件调度器</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">
一个符合规定的SystemVerilog仿真器必须维护某种形式的数据结构,随着仿真时间的继续,这个数据结构允许事件被动态地调度、执行和删除。这个数据结构通常被实现成一组时间排序的链表,它们一个定义明确的方式被划分和细分。 </p>
<p class="Element10">
</p>
<p class="Element10">
第一个分割根据时间进行。每一个事件都具有唯一的一个执行时间,在仿真期间的人以给定时间点上它可以是当前时间或某个未来的时间。在一个特定时间上的所有被调度的事件定义了一个时隙。通过在移动到下一个非空时隙之前执行和删除当前仿真时隙中的所有事件,仿真能够按时间顺序执行。这个过程保证了仿真器在时间上永远不会回退。 </p>
<p class="Element10">
</p>
<p class="Element10">
一个时隙被划分成一组有序的区域:</p>
<ol class="Element630">
<li value="1" class="Element600"><span class="Element146">Preponed</span></li>
<li value="2" class="Element600"><span class="Element146">Pre-active</span></li>
<li value="3" class="Element600"><span class="Element146">Active</span></li>
<li value="4" class="Element600"><span class="Element146">Inactive</span></li>
<li value="5" class="Element600"><span class="Element146">Pre-NBA</span></li>
<li value="6" class="Element600"><span class="Element146">NBA</span></li>
<li value="7" class="Element600"><span class="Element146">Post-NBA</span></li>
<li value="8" class="Element600"><span class="Element146">Observed</span></li>
<li value="9" class="Element600"><span class="Element146">Post-observed</span></li>
<li value="10" class="Element600"> <span class="Element146"> Reactive</span></li>
<li value="11" class="Element600"> <span class="Element146"> Postponed</span></li>
</ol><p class="Element10">
将一个时隙划分成这些有序区域的目的是提供设计和测试平台代码间的可预测的交互作用。 </p>
<p class="Element10">
</p>
<p class="Element10">
除了<span class="Element146">Observed</span>和<span class="Element146">Reactive</span>区域以及<span class="Element146">Post-observed</span> PLI区域外,这些区域本质上包含了Verilog 1364-2001标准仿真参考模型,并具有完全相同的确定层次。这就意味着合法的Verilog代码能够在新的机制下无需修改就可以正确地运行。<span class="Element146">Postponed</span>区域是监视信号和其它类似事件的区域。一旦到达<span class="Element146">Postponded</span>区域后,在这个时隙中不允许有新的值变化。 </p>
<p class="Element10">
</p>
<p class="Element10">
在SystemVerilog 3.1标准中,<span class="Element146">Observed</span>和<span class="Element146">Reactive</span>区域是新的区域,并且只有来自新的语言结构的事件才能被调度进这些新的区域。 </p>
<p class="Element10">
</p>
<p class="Element10">
当特性表达式被触发的时候,<span class="Element146">Observed</span>区域用来计算这些特性表达式。这个确定性的一个标准就是特性计算在任意时钟触发时隙中只能发生一次。在特性计算期间,通过/失败代码应该在当前时隙的<span class="Element146">Reactive</span>区域被调度。 </p>
<p class="Element10">
</p>
<p class="Element10">
特性表达式被采样数据的采样时间在时钟控制块中控制。新的#1step采样延时提供了在进入当前时隙之前立即采样数据的能力,并且相对于其它等价结构来说它是一个首选的结构,因为它使得1step的时间延时能够被参数化。这个#1step结构是一个卓有成效的机制,它提供了一个方法来定义采样发生的时间,并且不要求一个事件在前一个时隙中被产生。从概念上讲,这个#1step采样与在当前时隙的<span class="Element146">Preponed</span>区域发生的数据采样相同。 </p>
<p class="Element10">
</p>
<p class="Element10">
在程序块、以及来自特性表达式通过/失败代码中说明的代码在<span class="Element146">Reactive</span>区域被调度。 </p>
<p class="Element10">
</p>
<p class="Element10">
<span class="Element146">Pre-active</span>、<span class="Element146">Pre-NBA</span>和<span class="Element146">Post-NBA</span>在SystemVerilog 3.1中是新的区域,但它们支持现存的PLI回调。<span class="Element146">Post-observed</span>区域在SystemVerilog 3.1中是新的区域并且已经为支持PLI而加入。 </p>
<p class="Element10">
</p>
<p class="Element10">
<span class="Element146">Pre-active</span>区域专用于一个PLI回调控制点,它使得用户代码能够在Active区域中的事件被计算(参见<a href="00118.html" target="topic">14.4节</a>)之前读取和写入值以及产生事件。 </p>
<p class="Element10">
</p>
<p class="Element10">
<span class="Element146">Pre-NBA</span>区域专用于一个PLI回调控制点,它使得用户代码能够在NBA区域中的事件被计算(参见<a href="00118.html" target="topic">14.4节</a>)之前读取和写入值以及产生事件。 </p>
<p class="Element10">
</p>
<p class="Element10">
<span class="Element146">Post-NBA</span>区域专用于一个PLI回调控制点,它使得用户代码能够在NBA区域中的事件被计算(参见<a href="00118.html" target="topic">14.4节</a>)后读取和写入值以及产生事件。 </p>
<p class="Element10">
</p>
<p class="Element10">
<span class="Element146">Post-observed</span>区域专用于一个PLI回调控制点,它使得用户代码能够在特性被计算(在<span class="Element146">Observed</span>或较早的区域)后读取值。 </p>
<p class="Element10">
</p>
<p class="Element10">
事件区域的执行流程在图14-1中描述。 </p><p class="Element10" style="text-align: center">
<img src="Figure_14_1.png" border="0" alt="" title=""> </p>
<p class="Element10" style="text-align: center">
<strong>图14-1 — 时隙和事件区域的SystemVerilog流程</strong> </p><p class="Element10">
</p>
<p class="Element10">
<span class="Element146">Active</span>、<span class="Element146">Inactive</span>、<span class="Element146">Pre-NBA</span>、<span class="Element146">NBA</span>、<span class="Element146">Post-NBA</span>、<span class="Element146">Observed</span>、<span class="Element146">Postobserved</span>和<span class="Element146">Reactive</span>区域被称为迭代区域。 </p>
<p class="Element10">
</p>
<p class="Element10">
<span class="Element146">Preponed</span>区域专用于一个PLI回调控制点上,它使得用户代码在任何线网或变量改变状态之前访问当前时隙上的数据。 </p>
<p class="Element10">
</p>
<p class="Element10">
Active区域保留当前被计算的事件并且可以以任意顺序处理。 </p>
<p class="Element10">
</p>
<p class="Element10">
<span class="Element146">Inactive</span>区域保留将要在所有激活事件被处理后被计算的事件。 </p>
<p class="Element10">
</p>
<p class="Element10">
一个显式的<span class="Element146"><span style="color: #800080">#</span><span style="color: #FF0000">0</span></span>延时要求进程被挂起并且将一个事件调度到当前时隙的<span class="Element146">Inactive</span>区域,这样这个进程能够在下一个<span class="Element146">inactive</span>到<span class="Element146">active</span>的迭代中继续。 </p>
<p class="Element10">
</p>
<p class="Element10">
一个无阻塞赋值在<span class="Element146">NBA</span>区域中产生一个事件,这个事件在当前或一个较迟的仿真时间中被调度。 </p>
<p class="Element10">
</p>
<p class="Element10">
<span class="Element146">Postponed</span>区域专用于一个PLI回调控制点,它使得用户代码被挂起直到所有的<span class="Element146">Active</span>、<span class="Element146">Inactive</span>和<span class="Element146">NBA</span>区域完成。在这个区域中,向任何线网或变量写入值,或者在当前时隙中任何以前的区域中调度一个事件都是非法的。 </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="00870.html" target="topic">第十四章 调度语义</a></p></div>
</div>
</div>
<a name="主题"></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">
<div class="Element212">
<div class="TableDiv">
<table cellspacing="0" class="Table0">
<tr>
<td class="Element200" valign="top" width="50%">
<div class="Element201">
主题 </div></td><td class="Element204" valign="top" width="50%">
<div class="Element205">
描述 </div></td></tr><tr>
<td class="Element202" valign="top" width="50%">
<div class="Element203">
<a href="00117.html" target="topic">14.3.1 SystemVerilog仿真参考算法</a> </div></td><td class="Element206" valign="top" width="50%">
<div class="Element207">
</div></td></tr></table></div></div>
</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="00870.html" target="topic">第十四章 调度语义</a>, <a href="00940.html" target="topic">主题</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="我要啦免费统计" 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 + -