Skip to the selected question
ASIC.FYI

ASIC Question Bank

1,000+ hardware interview questions
DescriptionQ568
Q568DVASIC interview problem

Soft constraints

TechniquesSystemVerilogConstrained randomization
DifficultyMedium
TopicConstraints
LanguageSystemVerilog
Format4 choices
01

Problem

What happens when randomize is called?

Class declarationSystemVerilog
class C;
  rand int x;
  constraint defaults { soft x inside {[0:9]}; }
endclass
C c = new;
initial assert(c.randomize() with { x == 20; });
02

Answer choices (4)