blob: b019e55f4084e2b067f44d82b1b1718810f27808 [file] [log] [blame]
<html><head><title>uvm_packer</title><link rel="stylesheet" type="text/css" href="../../styles/main.css"><script language=JavaScript src="../../javascript/main.js"></script></head><body class="FramedContentPage" onLoad="NDOnLoad()"><script language=JavaScript><!--
if (browserType) {document.write("<div class=" + browserType + ">");if (browserVer) {document.write("<div class=" + browserVer + ">"); }}// --></script>
<!-- Generated by Natural Docs, version Development Release 01-12-2008 (1.35 base) -->
<!-- http://www.naturaldocs.org -->
<!-- saved from url=(0026)http://www.naturaldocs.org -->
<!--TOP - START OF CONTENT-->
<div id=Content>
<!--CONTENT index=0 -->
<div class="CClass"><div class=CTopic id=MainTopic><h1 class=CTitle><a name="uvm_packer" href="../../../../src/base/uvm_packer.svh">uvm_packer</a></h1><div class=CBody><p>Implementation of uvm_packer, as defined in section 16.5.1 of 1800.2-2017</p>
<!--START_ND_SUMMARY index=0-->
<div class=Summary><div class=STitle>Summary</div><div class=SBorder><table border=0 cellspacing=0 cellpadding=0 class=STable>
<!-- index=0 -->
<tr class="SClass"><td colspan=2 class=SEntry><a href="#uvm_packer" >uvm_packer</a></td></tr>
<tr class=SMain><td colspan=2 class=SWideDescription>Implementation of uvm_packer, as defined in section 16.5.1 of 1800.2-2017</td></tr>
<!-- index=1 -->
<tr class="SGroup SIndent1"><td class=SEntry><a href="#uvm_packer.Methods" >Methods</a></td><td class=SDescription></td></tr>
<!-- index=2 -->
<tr class="SMethod SIndent2"><td class=SEntry><a href="#uvm_packer.set_packed_*" >set_packed_*</a></td><td class=SDescription>Implementation of P1800.2 16.5.3.1</td></tr>
<!-- index=3 -->
<tr class="SMethod SIndent2 SMarked"><td class=SEntry><a href="#uvm_packer.get_packed_*" >get_packed_*</a></td><td class=SDescription>Implementation of P1800.2 16.5.3.2</td></tr>
<!-- index=4 -->
<tr class="SMethod SIndent2"><td class=SEntry><a href="#uvm_packer.pack_object_with_meta" id=link1 onMouseOver="ShowTip(event, 'tt1', 'link1')" onMouseOut="HideTip('tt1')">pack_object_with_meta</a></td><td class=SDescription>Packs <i>obj</i> into the packer data stream, such that it can be unpacked via an associated <a href="#uvm_packer.unpack_object_with_meta" class=LMethod id=link2 onMouseOver="ShowTip(event, 'tt2', 'link2')" onMouseOut="HideTip('tt2')">unpack_object_with_meta</a> call.</td></tr>
<!-- index=5 -->
<tr class="SMethod SIndent2 SMarked"><td class=SEntry><a href="#uvm_packer.unpack_object_with_meta" id=link3 onMouseOver="ShowTip(event, 'tt2', 'link3')" onMouseOut="HideTip('tt2')">unpack_object_with_meta</a></td><td class=SDescription>Unpacks an object which was packed into the packer data stream using <a href="#uvm_packer.pack_object_with_meta" class=LMethod id=link4 onMouseOver="ShowTip(event, 'tt1', 'link4')" onMouseOut="HideTip('tt1')">pack_object_with_meta</a>.</td></tr></table></div></div><!--END_ND_SUMMARY-->
</div></div></div>
<!--CONTENT index=1 -->
<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="uvm_packer.Methods" href="../../../../src/base/uvm_packer.svh">Methods</a></h3></div></div>
<!--CONTENT index=2 -->
<div class="CMethod"><div class=CTopic><h3 class=CTitle><a name="uvm_packer.set_packed_*" href="../../../../src/base/uvm_packer.svh">set_packed_*</a></h3><div class=CBody><p>Implementation of P1800.2 16.5.3.1</p><p>The LRM specifies the set_packed_* methods as being signed, whereas the &lt;uvm_object::unpack&gt; methods are specified as unsigned.&nbsp; This is being tracked in Mantis 6423.</p><p>The reference implementation has implemented these methods as unsigned so as to remain consistent.</p><blockquote><pre>virtual function void set_packed_bits( ref bit unsigned stream[] );
virtual function void set_packed_bytes( ref byte unsigned stream[] );
virtual function void set_packed_ints( ref int unsigned stream[] );
virtual function void set_packed_longints( ref longint unsigned stream[] );</pre></blockquote><p>@uvm-contrib This API is being considered for potential contribution to 1800.2</p></div></div></div>
<!--CONTENT index=3 -->
<div class="CMethod"><div class=CTopic><h3 class=CTitle><a name="uvm_packer.get_packed_*" href="../../../../src/base/uvm_packer.svh">get_packed_*</a></h3><div class=CBody><p>Implementation of P1800.2 16.5.3.2</p><p>The LRM specifies the get_packed_* methods as being signed, whereas the &lt;uvm_object::pack&gt; methods are specified as unsigned.&nbsp; This is being tracked in Mantis 6423.</p><p>The reference implementation has implemented these methods as unsigned so as to remain consistent.</p><blockquote><pre>virtual function void get_packed_bits( ref bit unsigned stream[] );
virtual function void get_packed_bytes( ref byte unsigned stream[] );
virtual function void get_packed_ints( ref int unsigned stream[] );
virtual function void get_packed_longints( ref longint unsigned stream[] );</pre></blockquote><p>@uvm-contrib This API is being considered for potential contribution to 1800.2</p></div></div></div>
<!--CONTENT index=4 -->
<div class="CMethod"><div class=CTopic><h3 class=CTitle><a name="uvm_packer.pack_object_with_meta" href="../../../../src/base/uvm_packer.svh">pack_object_with_meta</a></h3>
<blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype>
<tr><td><table border=0 cellspacing=0 cellpadding=0><tr>
<td class=PBeforeParameters colspan=3>function void uvm_packer::pack_object_with_meta(</td> </tr><tr><td>&nbsp;&nbsp;&nbsp;</td> <td class=PType nowrap>uvm_object&nbsp;</td>
<td class=PParameter nowrap width=100%>value</td>
</tr>
<tr>
<td class=PAfterParameters colspan=3>)</td></tr>
</table></td></tr>
</table></blockquote>
<div class=CBody><p>Packs <i>obj</i> into the packer data stream, such that it can be unpacked via an associated <a href="#uvm_packer.unpack_object_with_meta" class=LMethod id=link5 onMouseOver="ShowTip(event, 'tt2', 'link5')" onMouseOut="HideTip('tt2')">unpack_object_with_meta</a> call.</p><p>Unlike &lt;pack_object&gt;, the pack_object_with_meta method keeps track of what objects have already been packed in this call chain.&nbsp; The first time an object is passed to pack_object_with_meta after a call to &lt;flush&gt;, the object is assigned a unique id.&nbsp; Subsequent calls to pack_object_with_meta will only add the unique id to the stream.&nbsp; This allows structural information to be maintained through pack/unpack operations.</p><p>Note: pack_object_with_meta is not compatible with &lt;unpack_object&gt; and &lt;is_null&gt;.&nbsp; The object can only be unpacked via <a href="#uvm_packer.unpack_object_with_meta" class=LMethod id=link6 onMouseOver="ShowTip(event, 'tt2', 'link6')" onMouseOut="HideTip('tt2')">unpack_object_with_meta</a>.</p><p>@uvm-contrib This API is being considered for potential contribution to 1800.2</p></div></div></div>
<!--CONTENT index=5 -->
<div class="CMethod"><div class=CTopic><h3 class=CTitle><a name="uvm_packer.unpack_object_with_meta" href="../../../../src/base/uvm_packer.svh">unpack_object_with_meta</a></h3>
<blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype>
<tr><td><table border=0 cellspacing=0 cellpadding=0><tr>
<td class=PBeforeParameters colspan=4>function void uvm_packer::unpack_object_with_meta(</td> </tr><tr><td>&nbsp;&nbsp;&nbsp;</td> <td class=PTypePrefix nowrap>inout&nbsp;</td>
<td class=PType nowrap>uvm_object&nbsp;</td>
<td class=PParameter nowrap width=100%>value</td>
</tr>
<tr>
<td class=PAfterParameters colspan=4>)</td></tr>
</table></td></tr>
</table></blockquote>
<div class=CBody><p>Unpacks an object which was packed into the packer data stream using <a href="#uvm_packer.pack_object_with_meta" class=LMethod id=link7 onMouseOver="ShowTip(event, 'tt1', 'link7')" onMouseOut="HideTip('tt1')">pack_object_with_meta</a>.</p><p>Unlike &lt;unpack_object&gt;, the unpack_object_with_meta method keeps track of what objects have already been unpacked in this call chain.&nbsp; If the packed object was null, then <i>value</i> is set to null.&nbsp; Otherwise, if this is the first time the object&rsquo;s unique id has been encountered since a call to &lt;flush&gt;, then unpack_object_with_meta checks <i>value</i> to determine if it is the correct type.&nbsp; If it is not the correct type, or if <i>value</i> is null, then the packer shall create a new object instance for the unpack operation, using the data provided by <a href="#uvm_packer.pack_object_with_meta" class=LMethod id=link8 onMouseOver="ShowTip(event, 'tt1', 'link8')" onMouseOut="HideTip('tt1')">pack_object_with_meta</a>.&nbsp; If <i>value</i> is of the correct type, then it is used as the object instance for the unpack operation.&nbsp; Subsequent calls to unpack_object_with_meta for this unique id shall simply set <i>value</i> to this object instance.</p><p>Note: unpack_object_with_meta is not compatible with &lt;pack_object&gt; or &lt;is_null&gt;.&nbsp; The object must have been packed via <a href="#uvm_packer.pack_object_with_meta" class=LMethod id=link9 onMouseOver="ShowTip(event, 'tt1', 'link9')" onMouseOut="HideTip('tt1')">pack_object_with_meta</a>.</p><p>@uvm-contrib This API is being considered for potential contribution to 1800.2</p></div></div></div>
</div><!--Content-->
<!--START_ND_TOOLTIPS-->
<div class=CToolTip id="tt1"><div class=CMethod>
<blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype>
<tr><td><table border=0 cellspacing=0 cellpadding=0><tr>
<td class=PBeforeParameters colspan=3>function void uvm_packer::pack_object_with_meta(</td> </tr><tr><td>&nbsp;&nbsp;&nbsp;</td> <td class=PType nowrap>uvm_object&nbsp;</td>
<td class=PParameter nowrap width=100%>value</td>
</tr>
<tr>
<td class=PAfterParameters colspan=3>)</td></tr>
</table></td></tr>
</table></blockquote>
Packs <i>obj</i> into the packer data stream, such that it can be unpacked via an associated unpack_object_with_meta call.</div></div><div class=CToolTip id="tt2"><div class=CMethod>
<blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype>
<tr><td><table border=0 cellspacing=0 cellpadding=0><tr>
<td class=PBeforeParameters colspan=4>function void uvm_packer::unpack_object_with_meta(</td> </tr><tr><td>&nbsp;&nbsp;&nbsp;</td> <td class=PTypePrefix nowrap>inout&nbsp;</td>
<td class=PType nowrap>uvm_object&nbsp;</td>
<td class=PParameter nowrap width=100%>value</td>
</tr>
<tr>
<td class=PAfterParameters colspan=4>)</td></tr>
</table></td></tr>
</table></blockquote>
Unpacks an object which was packed into the packer data stream using pack_object_with_meta.</div></div><!--END_ND_TOOLTIPS-->
<script language=JavaScript><!--
if (browserType) {if (browserVer) {document.write("</div>"); }document.write("</div>");}// --></script></body></html>