uvm pack/unpack

693 阅读1分钟
  • packing: 将一组数据打包到一个比特数组中。
  • unpacking:将一个比特数组拆解成一组数据。

在item中定义do_pack函数
在driver中调用

下面的这些方法属于 uvm_object class 包含的function。

  • pack
    function int pack (ref bit bitstream[], input uvm_packer packer = null)
  • pack_bytes
    function int pack_bytes (ref byte unsigned bytestream[], input uvm_packer packer = null)
  • pack_ints
    function int pack_ints (ref int unsigned intstream[], input uvm_packer packer = null)
  • do_pack (回调函数)
    virtual function void do_pack( ucm_packer packer)

使用field automation的pack; 1个bit的不会给对齐;
在这里插入图片描述

  • m_reg_pack是一个存放pack_bytes的动态数组;
  • item.pack_bytes(pack数组)
  • <