DescriptionQ916
Q916DVASIC interview problem
Rand_mode
TechniquesSystemVerilogAdvanced randomization
DifficultyHard
TopicConstraints
LanguageSystemVerilog
Format4 choices
01
Problem
What are ok and x after the call?
Class declarationSystemVerilog
class C; rand int x; endclass
C c = new; int ok;
initial begin
c.x = 7;
c.x.rand_mode(0);
ok = c.randomize() with { x == 9; };
$display("%0d %0d", ok, c.x);
end02
