Skip to the selected question
ASIC.FYI

ASIC Question Bank

1,000+ hardware interview questions
DescriptionQ679
Page ↗
Q679DVASIC interview problem

Pack and unpack ordering

TechniquesUVMCopy, compare, and pack
DifficultyMedium
TopicUVM Components
LanguageSystemVerilog
Format4 choices
01

Problem

A packet packs addr first and len second, but unpacks len first and addr second. The total bit count matches. What is the correct diagnosis?

Function headerSystemVerilog
function void do_pack(uvm_packer p);
  super.do_pack(p);
  p.pack_field_int(addr, 16);
  p.pack_field_int(len,   8);
endfunction
function void do_unpack(uvm_packer p);
  super.do_unpack(p);
  len  = p.unpack_field_int(8);
  addr = p.unpack_field_int(16);
endfunction
02

Answer choices (4)