Strong answerA soft expression supplies a default that yields to a conflicting hard constraint. An inline hard constraint is added to the active class hard constraints, while constraint_mode() and rand_mode() change which blocks and variables participate.
Override a soft default, not a hard rulesystemverilog
class transfer;
rand bit [7:0] addr;
rand bit [3:0] size;
constraint default_addr_c { soft addr inside {[16:239]}; }
constraint legal_size_c { size inside {1, 2, 4, 8}; }
endclass
transfer t = new;
if (!t.randomize() with {
addr inside {[0:15]};
size == 4;
}) $fatal(1, "soft-default scenario failed");