-
Notifications
You must be signed in to change notification settings - Fork 29
Description
From https://forums.accellera.org/topic/8170-use-the-uvm_compat_packer-trigger-compilation-issues/:
I want to use the uvm_compat_pkg to compatible the original uvm_packer.
begin uvm_compat_pkg::uvm_compat_packer compat_packer = new(); uvm_packer::set_default(compat_packer); endit triggered the compilation issue:
Could not find member 'set_default' in class 'uvm_packer', at "*/VCS2024.09-SP2/85540268/uvm-1.2/base/uvm_packer.svh",----------------------readme.md from official version ------------------------
The
uvm_packerwas re-worked after UVM1.2. If data is packed and the resulting bit- or byte-stream is subsequently unpacked, the unpack output will match the original data in both old and new versions, however the stream itself can be different between versions. If the value of the stream is important, the way to get user code compatible with multiple versions is to move to theuvm_compat_packer. As mentioned above, based on version defines, theuvm_compat_packeris either a typedef for the library version ofuvm_packeror a new class that inherits from the library version and modifies functions as required.How the user code is modified to use
uvm_compat_packerdepends on how the user code currently refers touvm_packer. If, for example, the user code uses the default packer, then adding these lines to execute before the first usage of the packer will work:begin uvm_compat_pkg::uvm_compat_packer compat_packer = new(); uvm_packer::set_default(compat_packer); end
Since 1.2 only had uvm_default_packer and 1800.2 uses uvm_packer::set_default(...), the compat packer should provide a uvm_compat_packer::set_default(...) that works in both.
We