📄 00434.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN">
<html>
<head>
<title>30.8 Reading data</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', '00434.html');" onmousedown="onBodyMouseDown();">
<!-- Begin Popups -->
<div class="Element801" id="popup00572">
<div class="Element800">
<div class="Element14">
链接</div>
<div class="Element11">
<div class="Element10">
<a href="00862.html" target="topic">第三十章 SystemVerilog数据读API</a>, <a href="01002.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, 'popup00572');"><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="00433.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="00862.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="00435.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">
30.8 Reading data</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">
Reading data is performed in 3 steps:
<ol class="Element630">
<li value="1" class="Element600">A design object must be selected for traverse access from a database (or from memory).</li>
<li value="2" class="Element600">Indicate the intent to access data. This is typically done by a vpi_load_init() call as a hint from the user to the tool on which areas of the design are going to be accessed. The tool shall then load the data in an invisible fashion to the user (for example, either right after the call, or at traverse handle creation, or usage). Alternatively, if the user wishes he can (also) choose to add a specific vpi_load() call (this can be done at any point in time) to load, or force the load of, a specific object or collection of objects. This can be done either instead of, or in addition to, the objects in the scope or collection specified in vpi_load_init()). vpi_unload() can be used by the user to force the tool to unload specific objects. It should be noted that traverse handle creation shall fail for unloaded objects or collections.</li>
<li value="3" class="Element600">Once an object is selected, and marked for load, a traverse object handle can be created and used to traverse the design objects’ stored data.</li>
<li value="4" class="Element600">At this point the object is available for reading. The traverse object permits the data value traversal and access.</li>
</ol></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="00862.html" target="topic">第三十章 SystemVerilog数据读API</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="00435.html" target="topic">30.8.1 VPI read initialization and load access initialization</a> </div></td><td class="Element206" valign="top" width="50%">
<div class="Element207">
Selecting an object is done in 3 steps:<br>1) The first step is to initialize the read access with a call to vpi_load_extension() to load the reader extension and set:<br>a) Name of the reader library to be used specified as a character string. This is either a full pathname to this library or the single filename (without path information) of this library, assuming a vendor specific way of defining the location of such a library. The latter method is more portable and therefore recommended. Neither the full pathname, nor the single filename shall include an extension, the name of... <a href="00435.html" target="topic">more</a> </div></td></tr><tr>
<td class="Element202" valign="top" width="50%">
<div class="Element203">
<a href="00436.html" target="topic">30.8.2 Object selection for traverse access</a> </div></td><td class="Element206" valign="top" width="50%">
<div class="Element207">
In order to select an object for access, the user must first obtain the object handle. This can be done using the VPI routines (that are supported in the tool being used) for traversing the HDL hierarchy and obtaining an object handle based on the type of object relationship to another (top) handle.<br><br>Any tool that implements this read API (e.g. waveform tool) shall implement at least a basic subset of the design navigation VPI routines that shall include vpi_handle_by_name() to permit the user to get a vpiHandle from an object name. It is left up to tool implementation to... <a href="00436.html" target="topic">more</a> </div></td></tr><tr>
<td class="Element202" valign="top" width="50%">
<div class="Element203">
<a href="00437.html" target="topic">30.8.3 Optionally loading objects</a> </div></td><td class="Element206" valign="top" width="50%">
<div class="Element207">
As mentioned earlier, vpi_load_init() allows the tool implementing the reader to load objects in a fashion that is invisible to the user. Optionally, if the user chooses to do their own loading at some point in time, then once the object handle is obtained they can use the VPI data load routine vpi_load() with the object’s vpiHandle to load the data for the specific object onto memory. Alternatively, for efficiency considerations, vpi_load() can be called with a design object collection handle of type vpiObjCollection. The collection must have already been created with vpi_create() and the (additional) selected object handles added... <a href="00437.html" target="topic">more</a> </div></td></tr><tr>
<td class="Element202" valign="top" width="50%">
<div class="Element203">
<a href="00440.html" target="topic">30.8.4 Reading an object</a> </div></td><td class="Element206" valign="top" width="50%">
<div class="Element207">
The sections above have outlined:<br>— How to select an object for access, in other words, marking this object as a target for access. This is<br>where the design navigation VPI is used.<br>— How to call vpi_load_init() as a hint on the areas to be accessed, and/or optionally load an object<br>into memory after obtaining a handle and then either loading objects individually or as a group using<br>the object collection.<br>— How to optionally iterate the design scope and the object collection to find the loaded objects if needed.<br>In this section reading data is discussed. Reading an... <a href="00440.html" target="topic">more</a> </div></td></tr><tr>
<td class="Element202" valign="top" width="50%">
<div class="Element203">
<a href="00444.html" target="topic">30.8.5 Sample code using object (and traverse) collections</a> </div></td><td class="Element206" valign="top" width="50%">
<div class="Element207">
</div></td></tr><tr>
<td class="Element202" valign="top" width="50%">
<div class="Element203">
<a href="00445.html" target="topic">30.8.6 Object-based traversal</a> </div></td><td class="Element206" valign="top" width="50%">
<div class="Element207">
Object based traversal can be performed by creating a traverse handle for the object and then moving it back and forth to the next or previous Value Change (VC) or by performing jumps in time. A traverse object handle for any object in the design can be obtained by calling vpi_handle() with a vpiTrvsObj type, and an object vpiHandle. This is the method described in Section 30.8.4, and used in all the code examples thus far.<br><br>Using this method, the traversal would be object-based because the individual object traverse handles are created, and then the application can query the (value,... <a href="00445.html" target="topic">more</a> </div></td></tr><tr>
<td class="Element202" valign="top" width="50%">
<div class="Element203">
<a href="00446.html" target="topic">30.8.7 Time-ordered traversal</a> </div></td><td class="Element206" valign="top" width="50%">
<div class="Element207">
Alternatively, a user might wish to do a time-ordered traversal i.e. a time-based examination of values of several objects. This can be done by using a collection. The first step is to create a traverse collection of type vpiTrvsCollection of the objects to be traversed from the design object collection of type vpiObjCollection using vpi_handle() with a vpiTrvsCollection type and collection handle argument.<br><br>vpi_goto() can then be called on the traverse collection to move to next or previous or do jump in time for the collection as a whole. A move to next (previous) VC means move to the next... <a href="00446.html" target="topic">more</a> </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="00862.html" target="topic">第三十章 SystemVerilog数据读API</a>, <a href="01002.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 + -