| <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>The uvm_packer class provides a policy object for packing and unpacking uvm_objects. The policies determine how packing and unpacking should be done. Packing an object causes the object to be placed into a bit (byte or int) array. If the `uvm_field_* macro are used to implement pack and unpack, by default no metadata information is stored for the packing of dynamic objects (strings, arrays, class objects).</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>The uvm_packer class provides a policy object for packing and unpacking uvm_objects. </td></tr> |
| <!-- index=1 --> |
| |
| <tr class="SGroup SIndent1"><td class=SEntry><a href="#uvm_packer.Packing" >Packing</a></td><td class=SDescription></td></tr> |
| <!-- index=2 --> |
| |
| <tr class="SMethod SIndent2"><td class=SEntry><a href="#uvm_packer.pack_field" id=link1 onMouseOver="ShowTip(event, 'tt1', 'link1')" onMouseOut="HideTip('tt1')">pack_field</a></td><td class=SDescription>Packs an integral value (less than or equal to 4096 bits) into the packed array. </td></tr> |
| <!-- index=3 --> |
| |
| <tr class="SMethod SIndent2 SMarked"><td class=SEntry><a href="#uvm_packer.pack_field_int" id=link2 onMouseOver="ShowTip(event, 'tt2', 'link2')" onMouseOut="HideTip('tt2')">pack_field_int</a></td><td class=SDescription>Packs the integral value (less than or equal to 64 bits) into the pack array. </td></tr> |
| <!-- index=4 --> |
| |
| <tr class="SMethod SIndent2"><td class=SEntry><a href="#uvm_packer.pack_string" id=link3 onMouseOver="ShowTip(event, 'tt3', 'link3')" onMouseOut="HideTip('tt3')">pack_string</a></td><td class=SDescription>Packs a string value into the pack array.</td></tr> |
| <!-- index=5 --> |
| |
| <tr class="SMethod SIndent2 SMarked"><td class=SEntry><a href="#uvm_packer.pack_time" id=link4 onMouseOver="ShowTip(event, 'tt4', 'link4')" onMouseOut="HideTip('tt4')">pack_time</a></td><td class=SDescription>Packs a time <i>value</i> as 64 bits into the pack array.</td></tr> |
| <!-- index=6 --> |
| |
| <tr class="SMethod SIndent2"><td class=SEntry><a href="#uvm_packer.pack_real" id=link5 onMouseOver="ShowTip(event, 'tt5', 'link5')" onMouseOut="HideTip('tt5')">pack_real</a></td><td class=SDescription>Packs a real <i>value</i> as 64 bits into the pack array.</td></tr> |
| <!-- index=7 --> |
| |
| <tr class="SMethod SIndent2 SMarked"><td class=SEntry><a href="#uvm_packer.pack_object" id=link6 onMouseOver="ShowTip(event, 'tt6', 'link6')" onMouseOut="HideTip('tt6')">pack_object</a></td><td class=SDescription>Packs an object value into the pack array.</td></tr> |
| <!-- index=8 --> |
| |
| <tr class="SGroup SIndent1"><td class=SEntry><a href="#uvm_packer.Unpacking" >Unpacking</a></td><td class=SDescription></td></tr> |
| <!-- index=9 --> |
| |
| <tr class="SMethod SIndent2"><td class=SEntry><a href="#uvm_packer.is_null" id=link7 onMouseOver="ShowTip(event, 'tt7', 'link7')" onMouseOut="HideTip('tt7')">is_null</a></td><td class=SDescription>This method is used during unpack operations to peek at the next 4-bit chunk of the pack data and determine if it is 0.</td></tr> |
| <!-- index=10 --> |
| |
| <tr class="SMethod SIndent2 SMarked"><td class=SEntry><a href="#uvm_packer.unpack_field_int" id=link8 onMouseOver="ShowTip(event, 'tt8', 'link8')" onMouseOut="HideTip('tt8')">unpack_field_int</a></td><td class=SDescription>Unpacks bits from the pack array and returns the bit-stream that was unpacked.</td></tr> |
| <!-- index=11 --> |
| |
| <tr class="SMethod SIndent2"><td class=SEntry><a href="#uvm_packer.unpack_field" id=link9 onMouseOver="ShowTip(event, 'tt9', 'link9')" onMouseOut="HideTip('tt9')">unpack_field</a></td><td class=SDescription>Unpacks bits from the pack array and returns the bit-stream that was unpacked. </td></tr> |
| <!-- index=12 --> |
| |
| <tr class="SMethod SIndent2 SMarked"><td class=SEntry><a href="#uvm_packer.unpack_string" id=link10 onMouseOver="ShowTip(event, 'tt10', 'link10')" onMouseOut="HideTip('tt10')">unpack_string</a></td><td class=SDescription>Unpacks a string.</td></tr> |
| <!-- index=13 --> |
| |
| <tr class="SMethod SIndent2"><td class=SEntry><a href="#uvm_packer.unpack_time" id=link11 onMouseOver="ShowTip(event, 'tt11', 'link11')" onMouseOut="HideTip('tt11')">unpack_time</a></td><td class=SDescription>Unpacks the next 64 bits of the pack array and places them into a time variable.</td></tr> |
| <!-- index=14 --> |
| |
| <tr class="SMethod SIndent2 SMarked"><td class=SEntry><a href="#uvm_packer.unpack_real" id=link12 onMouseOver="ShowTip(event, 'tt12', 'link12')" onMouseOut="HideTip('tt12')">unpack_real</a></td><td class=SDescription>Unpacks the next 64 bits of the pack array and places them into a real variable.</td></tr> |
| <!-- index=15 --> |
| |
| <tr class="SMethod SIndent2"><td class=SEntry><a href="#uvm_packer.unpack_object" id=link13 onMouseOver="ShowTip(event, 'tt13', 'link13')" onMouseOut="HideTip('tt13')">unpack_object</a></td><td class=SDescription>Unpacks an object and stores the result into <i>value</i>.</td></tr> |
| <!-- index=16 --> |
| |
| <tr class="SMethod SIndent2 SMarked"><td class=SEntry><a href="#uvm_packer.get_packed_size" id=link14 onMouseOver="ShowTip(event, 'tt14', 'link14')" onMouseOut="HideTip('tt14')">get_packed_size</a></td><td class=SDescription>Returns the number of bits that were packed.</td></tr> |
| <!-- index=17 --> |
| |
| <tr class="SGroup SIndent1"><td class=SEntry><a href="#uvm_packer.Variables" >Variables</a></td><td class=SDescription></td></tr> |
| <!-- index=18 --> |
| |
| <tr class="SVariable SIndent2"><td class=SEntry><a href="#uvm_packer.physical" id=link15 onMouseOver="ShowTip(event, 'tt15', 'link15')" onMouseOut="HideTip('tt15')">physical</a></td><td class=SDescription>This bit provides a filtering mechanism for fields.</td></tr> |
| <!-- index=19 --> |
| |
| <tr class="SVariable SIndent2 SMarked"><td class=SEntry><a href="#uvm_packer.abstract" id=link16 onMouseOver="ShowTip(event, 'tt16', 'link16')" onMouseOut="HideTip('tt16')">abstract</a></td><td class=SDescription>This bit provides a filtering mechanism for fields.</td></tr> |
| <!-- index=20 --> |
| |
| <tr class="SVariable SIndent2"><td class=SEntry><a href="#uvm_packer.use_metadata" id=link17 onMouseOver="ShowTip(event, 'tt17', 'link17')" onMouseOut="HideTip('tt17')">use_metadata</a></td><td class=SDescription>This flag indicates whether to encode metadata when packing dynamic data, or to decode metadata when unpacking. </td></tr> |
| <!-- index=21 --> |
| |
| <tr class="SVariable SIndent2 SMarked"><td class=SEntry><a href="#uvm_packer.big_endian" id=link18 onMouseOver="ShowTip(event, 'tt18', 'link18')" onMouseOut="HideTip('tt18')">big_endian</a></td><td class=SDescription>This bit determines the order that integral data is packed (using <a href="#uvm_packer.pack_field" class=LMethod id=link19 onMouseOver="ShowTip(event, 'tt1', 'link19')" onMouseOut="HideTip('tt1')">pack_field</a>, <a href="#uvm_packer.pack_field_int" class=LMethod id=link20 onMouseOver="ShowTip(event, 'tt2', 'link20')" onMouseOut="HideTip('tt2')">pack_field_int</a>, <a href="#uvm_packer.pack_time" class=LMethod id=link21 onMouseOver="ShowTip(event, 'tt4', 'link21')" onMouseOut="HideTip('tt4')">pack_time</a>, or <a href="#uvm_packer.pack_real" class=LMethod id=link22 onMouseOver="ShowTip(event, 'tt5', 'link22')" onMouseOut="HideTip('tt5')">pack_real</a>) and how the data is unpacked from the pack array (using <a href="#uvm_packer.unpack_field" class=LMethod id=link23 onMouseOver="ShowTip(event, 'tt9', 'link23')" onMouseOut="HideTip('tt9')">unpack_field</a>, <a href="#uvm_packer.unpack_field_int" class=LMethod id=link24 onMouseOver="ShowTip(event, 'tt8', 'link24')" onMouseOut="HideTip('tt8')">unpack_field_int</a>, <a href="#uvm_packer.unpack_time" class=LMethod id=link25 onMouseOver="ShowTip(event, 'tt11', 'link25')" onMouseOut="HideTip('tt11')">unpack_time</a>, or <a href="#uvm_packer.unpack_real" class=LMethod id=link26 onMouseOver="ShowTip(event, 'tt12', 'link26')" onMouseOut="HideTip('tt12')">unpack_real</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.Packing" href="../../src/base/uvm_packer.svh">Packing</a></h3></div></div> |
| |
| |
| |
| |
| <!--CONTENT index=2 --> |
| <div class="CMethod"><div class=CTopic><h3 class=CTitle><a name="uvm_packer.pack_field" href="../../src/base/uvm_packer.svh">pack_field</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 nowrap>virtual function void pack_field (</td> <td class=PType nowrap>uvm_bitstream_t </td> |
| <td class=PParameter nowrap>value,</td> |
| </tr><tr><td></td> <td class=PType nowrap>int </td> |
| <td class=PParameter nowrap>size</td> |
| <td class=PAfterParameters nowrap>)</td></tr> |
| </table></td></tr> |
| </table></blockquote> |
| <div class=CBody><p>Packs an integral value (less than or equal to 4096 bits) into the packed array. <i>size</i> is the number of bits of <i>value</i> to pack.</p></div></div></div> |
| |
| |
| |
| |
| <!--CONTENT index=3 --> |
| <div class="CMethod"><div class=CTopic><h3 class=CTitle><a name="uvm_packer.pack_field_int" href="../../src/base/uvm_packer.svh">pack_field_int</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 nowrap>virtual function void pack_field_int (</td> <td class=PType nowrap>logic[63:0] </td> |
| <td class=PParameter nowrap>value,</td> |
| </tr><tr><td></td> <td class=PType nowrap>int </td> |
| <td class=PParameter nowrap>size</td> |
| <td class=PAfterParameters nowrap>)</td></tr> |
| </table></td></tr> |
| </table></blockquote> |
| <div class=CBody><p>Packs the integral value (less than or equal to 64 bits) into the pack array. The <i>size</i> is the number of bits to pack, usually obtained by <i>$bits</i>. This optimized version of <a href="#uvm_packer.pack_field" class=LMethod id=link27 onMouseOver="ShowTip(event, 'tt1', 'link27')" onMouseOut="HideTip('tt1')">pack_field</a> is useful for sizes up to 64 bits.</p></div></div></div> |
| |
| |
| |
| |
| <!--CONTENT index=4 --> |
| <div class="CMethod"><div class=CTopic><h3 class=CTitle><a name="uvm_packer.pack_string" href="../../src/base/uvm_packer.svh">pack_string</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 nowrap>virtual function void pack_string (</td> <td class=PType nowrap>string </td> |
| <td class=PParameter nowrap>value</td> |
| <td class=PAfterParameters nowrap>)</td></tr> |
| </table></td></tr> |
| </table></blockquote> |
| <div class=CBody><p>Packs a string value into the pack array.</p><p>When the metadata flag is set, the packed string is terminated by a null character to mark the end of the string.</p><p>This is useful for mixed language communication where unpacking may occur outside of SystemVerilog UVM.</p></div></div></div> |
| |
| |
| |
| |
| <!--CONTENT index=5 --> |
| <div class="CMethod"><div class=CTopic><h3 class=CTitle><a name="uvm_packer.pack_time" href="../../src/base/uvm_packer.svh">pack_time</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 nowrap>virtual function void pack_time (</td> <td class=PType nowrap>time </td> |
| <td class=PParameter nowrap>value</td> |
| <td class=PAfterParameters nowrap>)</td></tr> |
| </table></td></tr> |
| </table></blockquote> |
| <div class=CBody><p>Packs a time <i>value</i> as 64 bits into the pack array.</p></div></div></div> |
| |
| |
| |
| |
| <!--CONTENT index=6 --> |
| <div class="CMethod"><div class=CTopic><h3 class=CTitle><a name="uvm_packer.pack_real" href="../../src/base/uvm_packer.svh">pack_real</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 nowrap>virtual function void pack_real (</td> <td class=PType nowrap>real </td> |
| <td class=PParameter nowrap>value</td> |
| <td class=PAfterParameters nowrap>)</td></tr> |
| </table></td></tr> |
| </table></blockquote> |
| <div class=CBody><p>Packs a real <i>value</i> as 64 bits into the pack array.</p><p>The real <i>value</i> is converted to a 6-bit scalar value using the function $real2bits before it is packed into the array.</p></div></div></div> |
| |
| |
| |
| |
| <!--CONTENT index=7 --> |
| <div class="CMethod"><div class=CTopic><h3 class=CTitle><a name="uvm_packer.pack_object" href="../../src/base/uvm_packer.svh">pack_object</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 nowrap>virtual function void pack_object (</td> <td class=PType nowrap>uvm_object </td> |
| <td class=PParameter nowrap>value</td> |
| <td class=PAfterParameters nowrap>)</td></tr> |
| </table></td></tr> |
| </table></blockquote> |
| <div class=CBody><p>Packs an object value into the pack array.</p><p>A 4-bit header is inserted ahead of the string to indicate the number of bits that was packed. If a null object was packed, then this header will be 0.</p><p>This is useful for mixed-language communication where unpacking may occur outside of SystemVerilog UVM.</p></div></div></div> |
| |
| |
| |
| |
| <!--CONTENT index=8 --> |
| <div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="uvm_packer.Unpacking" href="../../src/base/uvm_packer.svh">Unpacking</a></h3></div></div> |
| |
| |
| |
| |
| <!--CONTENT index=9 --> |
| <div class="CMethod"><div class=CTopic><h3 class=CTitle><a name="uvm_packer.is_null" href="../../src/base/uvm_packer.svh">is_null</a></h3> |
| <blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>virtual function bit is_null () |
| </td></tr></table></blockquote><div class=CBody><p>This method is used during unpack operations to peek at the next 4-bit chunk of the pack data and determine if it is 0.</p><p>If the next four bits are all 0, then the return value is a 1; otherwise it is 0.</p><p>This is useful when unpacking objects, to decide whether a new object needs to be allocated or not.</p></div></div></div> |
| |
| |
| |
| |
| <!--CONTENT index=10 --> |
| <div class="CMethod"><div class=CTopic><h3 class=CTitle><a name="uvm_packer.unpack_field_int" href="../../src/base/uvm_packer.svh">unpack_field_int</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 nowrap>virtual function logic[63:0] unpack_field_int (</td> <td class=PType nowrap>int </td> |
| <td class=PParameter nowrap>size</td> |
| <td class=PAfterParameters nowrap>)</td></tr> |
| </table></td></tr> |
| </table></blockquote> |
| <div class=CBody><p>Unpacks bits from the pack array and returns the bit-stream that was unpacked.</p><p><i>size</i> is the number of bits to unpack; the maximum is 64 bits. This is a more efficient variant than unpack_field when unpacking into smaller vectors.</p></div></div></div> |
| |
| |
| |
| |
| <!--CONTENT index=11 --> |
| <div class="CMethod"><div class=CTopic><h3 class=CTitle><a name="uvm_packer.unpack_field" href="../../src/base/uvm_packer.svh">unpack_field</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 nowrap>virtual function uvm_bitstream_t unpack_field (</td> <td class=PType nowrap>int </td> |
| <td class=PParameter nowrap>size</td> |
| <td class=PAfterParameters nowrap>)</td></tr> |
| </table></td></tr> |
| </table></blockquote> |
| <div class=CBody><p>Unpacks bits from the pack array and returns the bit-stream that was unpacked. <i>size</i> is the number of bits to unpack; the maximum is 4096 bits.</p></div></div></div> |
| |
| |
| |
| |
| <!--CONTENT index=12 --> |
| <div class="CMethod"><div class=CTopic><h3 class=CTitle><a name="uvm_packer.unpack_string" href="../../src/base/uvm_packer.svh">unpack_string</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 nowrap>virtual function string unpack_string (</td> <td class=PType nowrap>int </td> |
| <td class=PParameter nowrap>num_chars</td> |
| <td class=PDefaultValuePrefix> = </td> |
| <td class=PDefaultValue width=100%>-1</td> |
| <td class=PAfterParameters nowrap>)</td></tr> |
| </table></td></tr> |
| </table></blockquote> |
| <div class=CBody><p>Unpacks a string.</p><p>num_chars bytes are unpacked into a string. If num_chars is -1 then unpacking stops on at the first null character that is encountered.</p></div></div></div> |
| |
| |
| |
| |
| <!--CONTENT index=13 --> |
| <div class="CMethod"><div class=CTopic><h3 class=CTitle><a name="uvm_packer.unpack_time" href="../../src/base/uvm_packer.svh">unpack_time</a></h3> |
| <blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>virtual function time unpack_time () |
| </td></tr></table></blockquote><div class=CBody><p>Unpacks the next 64 bits of the pack array and places them into a time variable.</p></div></div></div> |
| |
| |
| |
| |
| <!--CONTENT index=14 --> |
| <div class="CMethod"><div class=CTopic><h3 class=CTitle><a name="uvm_packer.unpack_real" href="../../src/base/uvm_packer.svh">unpack_real</a></h3> |
| <blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>virtual function real unpack_real () |
| </td></tr></table></blockquote><div class=CBody><p>Unpacks the next 64 bits of the pack array and places them into a real variable.</p><p>The 64 bits of packed data are converted to a real using the $bits2real system function.</p></div></div></div> |
| |
| |
| |
| |
| <!--CONTENT index=15 --> |
| <div class="CMethod"><div class=CTopic><h3 class=CTitle><a name="uvm_packer.unpack_object" href="../../src/base/uvm_packer.svh">unpack_object</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 nowrap>virtual function void unpack_object (</td> <td class=PType nowrap>uvm_object </td> |
| <td class=PParameter nowrap>value</td> |
| <td class=PAfterParameters nowrap>)</td></tr> |
| </table></td></tr> |
| </table></blockquote> |
| <div class=CBody><p>Unpacks an object and stores the result into <i>value</i>.</p><p><i>value</i> must be an allocated object that has enough space for the data being unpacked. The first four bits of packed data are used to determine if a null object was packed into the array.</p><p>The <a href="#uvm_packer.is_null" class=LMethod id=link28 onMouseOver="ShowTip(event, 'tt7', 'link28')" onMouseOut="HideTip('tt7')">is_null</a> function can be used to peek at the next four bits in the pack array before calling this method.</p></div></div></div> |
| |
| |
| |
| |
| <!--CONTENT index=16 --> |
| <div class="CMethod"><div class=CTopic><h3 class=CTitle><a name="uvm_packer.get_packed_size" href="../../src/base/uvm_packer.svh">get_packed_size</a></h3> |
| <blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>virtual function int get_packed_size() |
| </td></tr></table></blockquote><div class=CBody><p>Returns the number of bits that were packed.</p></div></div></div> |
| |
| |
| |
| |
| <!--CONTENT index=17 --> |
| <div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="uvm_packer.Variables" href="../../src/base/uvm_packer.svh">Variables</a></h3></div></div> |
| |
| |
| |
| |
| <!--CONTENT index=18 --> |
| <div class="CVariable"><div class=CTopic><h3 class=CTitle><a name="uvm_packer.physical" href="../../src/base/uvm_packer.svh">physical</a></h3> |
| <blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>bit physical = 1 |
| </td></tr></table></blockquote><div class=CBody><p>This bit provides a filtering mechanism for fields.</p><p>The <a href="#uvm_packer.abstract" class=LVariable id=link29 onMouseOver="ShowTip(event, 'tt16', 'link29')" onMouseOut="HideTip('tt16')">abstract</a> and physical settings allow an object to distinguish between two different classes of fields. It is up to you, in the <a href="uvm_object-svh.html#uvm_object.do_pack" class=LMethod id=link30 onMouseOver="ShowTip(event, 'tt19', 'link30')" onMouseOut="HideTip('tt19')">uvm_object::do_pack</a> and <a href="uvm_object-svh.html#uvm_object.do_unpack" class=LMethod id=link31 onMouseOver="ShowTip(event, 'tt20', 'link31')" onMouseOut="HideTip('tt20')">uvm_object::do_unpack</a> methods, to test the setting of this field if you want to use it as a filter.</p></div></div></div> |
| |
| |
| |
| |
| <!--CONTENT index=19 --> |
| <div class="CVariable"><div class=CTopic><h3 class=CTitle><a name="uvm_packer.abstract" href="../../src/base/uvm_packer.svh">abstract</a></h3> |
| <blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>bit abstract |
| </td></tr></table></blockquote><div class=CBody><p>This bit provides a filtering mechanism for fields.</p><p>The abstract and physical settings allow an object to distinguish between two different classes of fields. It is up to you, in the <a href="uvm_object-svh.html#uvm_object.do_pack" class=LMethod id=link32 onMouseOver="ShowTip(event, 'tt19', 'link32')" onMouseOut="HideTip('tt19')">uvm_object::do_pack</a> and <a href="uvm_object-svh.html#uvm_object.do_unpack" class=LMethod id=link33 onMouseOver="ShowTip(event, 'tt20', 'link33')" onMouseOut="HideTip('tt20')">uvm_object::do_unpack</a> routines, to test the setting of this field if you want to use it as a filter.</p></div></div></div> |
| |
| |
| |
| |
| <!--CONTENT index=20 --> |
| <div class="CVariable"><div class=CTopic><h3 class=CTitle><a name="uvm_packer.use_metadata" href="../../src/base/uvm_packer.svh">use_metadata</a></h3> |
| <blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>bit use_metadata |
| </td></tr></table></blockquote><div class=CBody><p>This flag indicates whether to encode metadata when packing dynamic data, or to decode metadata when unpacking. Implementations of <a href="uvm_object-svh.html#uvm_object.do_pack" class=LMethod id=link34 onMouseOver="ShowTip(event, 'tt19', 'link34')" onMouseOut="HideTip('tt19')">uvm_object::do_pack</a> and <a href="uvm_object-svh.html#uvm_object.do_unpack" class=LMethod id=link35 onMouseOver="ShowTip(event, 'tt20', 'link35')" onMouseOut="HideTip('tt20')">uvm_object::do_unpack</a> should regard this bit when performing their respective operation. When set, metadata should be encoded as follows:</p><ul><li>For strings, pack an additional null byte after the string is packed.</li><li>For objects, pack 4 bits prior to packing the object itself. Use 4’b0000 to indicate the object being packed is null, otherwise pack 4’b0001 (the remaining 3 bits are reserved).</li><li>For queues, dynamic arrays, and associative arrays, pack 32 bits indicating the size of the array prior to to packing individual elements.</li></ul></div></div></div> |
| |
| |
| |
| |
| <!--CONTENT index=21 --> |
| <div class="CVariable"><div class=CTopic><h3 class=CTitle><a name="uvm_packer.big_endian" href="../../src/base/uvm_packer.svh">big_endian</a></h3> |
| <blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>bit big_endian = 1 |
| </td></tr></table></blockquote><div class=CBody><p>This bit determines the order that integral data is packed (using <a href="#uvm_packer.pack_field" class=LMethod id=link36 onMouseOver="ShowTip(event, 'tt1', 'link36')" onMouseOut="HideTip('tt1')">pack_field</a>, <a href="#uvm_packer.pack_field_int" class=LMethod id=link37 onMouseOver="ShowTip(event, 'tt2', 'link37')" onMouseOut="HideTip('tt2')">pack_field_int</a>, <a href="#uvm_packer.pack_time" class=LMethod id=link38 onMouseOver="ShowTip(event, 'tt4', 'link38')" onMouseOut="HideTip('tt4')">pack_time</a>, or <a href="#uvm_packer.pack_real" class=LMethod id=link39 onMouseOver="ShowTip(event, 'tt5', 'link39')" onMouseOut="HideTip('tt5')">pack_real</a>) and how the data is unpacked from the pack array (using <a href="#uvm_packer.unpack_field" class=LMethod id=link40 onMouseOver="ShowTip(event, 'tt9', 'link40')" onMouseOut="HideTip('tt9')">unpack_field</a>, <a href="#uvm_packer.unpack_field_int" class=LMethod id=link41 onMouseOver="ShowTip(event, 'tt8', 'link41')" onMouseOut="HideTip('tt8')">unpack_field_int</a>, <a href="#uvm_packer.unpack_time" class=LMethod id=link42 onMouseOver="ShowTip(event, 'tt11', 'link42')" onMouseOut="HideTip('tt11')">unpack_time</a>, or <a href="#uvm_packer.unpack_real" class=LMethod id=link43 onMouseOver="ShowTip(event, 'tt12', 'link43')" onMouseOut="HideTip('tt12')">unpack_real</a>). When the bit is set, data is associated msb to lsb; otherwise, it is associated lsb to msb.</p><p>The following code illustrates how data can be associated msb to lsb and lsb to msb:</p><blockquote><pre>class mydata extends uvm_object; |
| |
| logic[15:0] value = 'h1234; |
| |
| function void do_pack (uvm_packer packer); |
| packer.pack_field_int(value, 16); |
| endfunction |
| |
| function void do_unpack (uvm_packer packer); |
| value = packer.unpack_field_int(16); |
| endfunction |
| endclass |
| |
| mydata d = new; |
| bit bits[]; |
| |
| initial begin |
| d.pack(bits); // 'b0001001000110100 |
| uvm_default_packer.big_endian = 0; |
| d.pack(bits); // 'b0010110001001000 |
| end</pre></blockquote></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 nowrap>virtual function void pack_field (</td> <td class=PType nowrap>uvm_bitstream_t </td> |
| <td class=PParameter nowrap>value,</td> |
| </tr><tr><td></td> <td class=PType nowrap>int </td> |
| <td class=PParameter nowrap>size</td> |
| <td class=PAfterParameters nowrap>)</td></tr> |
| </table></td></tr> |
| </table></blockquote> |
| Packs an integral value (less than or equal to 4096 bits) into the packed array. </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 nowrap>virtual function void pack_field_int (</td> <td class=PType nowrap>logic[63:0] </td> |
| <td class=PParameter nowrap>value,</td> |
| </tr><tr><td></td> <td class=PType nowrap>int </td> |
| <td class=PParameter nowrap>size</td> |
| <td class=PAfterParameters nowrap>)</td></tr> |
| </table></td></tr> |
| </table></blockquote> |
| Packs the integral value (less than or equal to 64 bits) into the pack array. </div></div><div class=CToolTip id="tt3"><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 nowrap>virtual function void pack_string (</td> <td class=PType nowrap>string </td> |
| <td class=PParameter nowrap>value</td> |
| <td class=PAfterParameters nowrap>)</td></tr> |
| </table></td></tr> |
| </table></blockquote> |
| Packs a string value into the pack array.</div></div><div class=CToolTip id="tt4"><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 nowrap>virtual function void pack_time (</td> <td class=PType nowrap>time </td> |
| <td class=PParameter nowrap>value</td> |
| <td class=PAfterParameters nowrap>)</td></tr> |
| </table></td></tr> |
| </table></blockquote> |
| Packs a time <i>value</i> as 64 bits into the pack array.</div></div><div class=CToolTip id="tt5"><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 nowrap>virtual function void pack_real (</td> <td class=PType nowrap>real </td> |
| <td class=PParameter nowrap>value</td> |
| <td class=PAfterParameters nowrap>)</td></tr> |
| </table></td></tr> |
| </table></blockquote> |
| Packs a real <i>value</i> as 64 bits into the pack array.</div></div><div class=CToolTip id="tt6"><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 nowrap>virtual function void pack_object (</td> <td class=PType nowrap>uvm_object </td> |
| <td class=PParameter nowrap>value</td> |
| <td class=PAfterParameters nowrap>)</td></tr> |
| </table></td></tr> |
| </table></blockquote> |
| Packs an object value into the pack array.</div></div><div class=CToolTip id="tt7"><div class=CMethod> |
| <blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>virtual function bit is_null () |
| </td></tr></table></blockquote>This method is used during unpack operations to peek at the next 4-bit chunk of the pack data and determine if it is 0.</div></div><div class=CToolTip id="tt8"><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 nowrap>virtual function logic[63:0] unpack_field_int (</td> <td class=PType nowrap>int </td> |
| <td class=PParameter nowrap>size</td> |
| <td class=PAfterParameters nowrap>)</td></tr> |
| </table></td></tr> |
| </table></blockquote> |
| Unpacks bits from the pack array and returns the bit-stream that was unpacked.</div></div><div class=CToolTip id="tt9"><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 nowrap>virtual function uvm_bitstream_t unpack_field (</td> <td class=PType nowrap>int </td> |
| <td class=PParameter nowrap>size</td> |
| <td class=PAfterParameters nowrap>)</td></tr> |
| </table></td></tr> |
| </table></blockquote> |
| Unpacks bits from the pack array and returns the bit-stream that was unpacked. </div></div><div class=CToolTip id="tt10"><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 nowrap>virtual function string unpack_string (</td> <td class=PType nowrap>int </td> |
| <td class=PParameter nowrap>num_chars</td> |
| <td class=PDefaultValuePrefix> = </td> |
| <td class=PDefaultValue width=100%>-1</td> |
| <td class=PAfterParameters nowrap>)</td></tr> |
| </table></td></tr> |
| </table></blockquote> |
| Unpacks a string.</div></div><div class=CToolTip id="tt11"><div class=CMethod> |
| <blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>virtual function time unpack_time () |
| </td></tr></table></blockquote>Unpacks the next 64 bits of the pack array and places them into a time variable.</div></div><div class=CToolTip id="tt12"><div class=CMethod> |
| <blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>virtual function real unpack_real () |
| </td></tr></table></blockquote>Unpacks the next 64 bits of the pack array and places them into a real variable.</div></div><div class=CToolTip id="tt13"><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 nowrap>virtual function void unpack_object (</td> <td class=PType nowrap>uvm_object </td> |
| <td class=PParameter nowrap>value</td> |
| <td class=PAfterParameters nowrap>)</td></tr> |
| </table></td></tr> |
| </table></blockquote> |
| Unpacks an object and stores the result into <i>value</i>.</div></div><div class=CToolTip id="tt14"><div class=CMethod> |
| <blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>virtual function int get_packed_size() |
| </td></tr></table></blockquote>Returns the number of bits that were packed.</div></div><div class=CToolTip id="tt15"><div class=CVariable> |
| <blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>bit physical = 1 |
| </td></tr></table></blockquote>This bit provides a filtering mechanism for fields.</div></div><div class=CToolTip id="tt16"><div class=CVariable> |
| <blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>bit abstract |
| </td></tr></table></blockquote>This bit provides a filtering mechanism for fields.</div></div><div class=CToolTip id="tt17"><div class=CVariable> |
| <blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>bit use_metadata |
| </td></tr></table></blockquote>This flag indicates whether to encode metadata when packing dynamic data, or to decode metadata when unpacking. </div></div><div class=CToolTip id="tt18"><div class=CVariable> |
| <blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>bit big_endian = 1 |
| </td></tr></table></blockquote>This bit determines the order that integral data is packed (using pack_field, pack_field_int, pack_time, or pack_real) and how the data is unpacked from the pack array (using unpack_field, unpack_field_int, unpack_time, or unpack_real). </div></div><div class=CToolTip id="tt19"><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 nowrap>virtual function void do_pack (</td> <td class=PType nowrap>uvm_packer </td> |
| <td class=PParameter nowrap>packer</td> |
| <td class=PAfterParameters nowrap>)</td></tr> |
| </table></td></tr> |
| </table></blockquote> |
| The do_pack method is the user-definable hook called by the pack methods. </div></div><div class=CToolTip id="tt20"><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 nowrap>virtual function void do_unpack (</td> <td class=PType nowrap>uvm_packer </td> |
| <td class=PParameter nowrap>packer</td> |
| <td class=PAfterParameters nowrap>)</td></tr> |
| </table></td></tr> |
| </table></blockquote> |
| The do_unpack method is the user-definable hook called by the unpack method. </div></div><!--END_ND_TOOLTIPS--> |
| |
| <script language=JavaScript><!-- |
| if (browserType) {if (browserVer) {document.write("</div>"); }document.write("</div>");}// --></script></body></html> |