Skip to the selected question
ASIC.FYI

ASIC Question Bank

1,000+ hardware interview questions
DescriptionQ214
Q214DVASIC interview problem

Random dynamic arrays

TechniquesSystemVerilogAdvanced randomization
DifficultyHard
TopicConstraints
LanguageSystemVerilog
Format4 choices
01

Problem

Which statement about a successful randomization is correct?

Class declarationSystemVerilog
class Packet;
  rand int unsigned len;
  rand byte unsigned data[];
  constraint c {
    len inside {[1:4]};
    data.size() == len;
    foreach (data[i]) data[i] inside {[1:255]};
  }
endclass
02

Answer choices (4)