*,
How can I randomize with a dist and specify a weight for values not being inside a range?
class randclass;
rand logic [3:0] randvalue;
function void post_randomize();
$display("value: %0d",randvalue);
endfunction
constraint inside_practice {
randvalue dist {
[3:4] :/ 50,
!(inside {[3:4]}) :/ 50 //<--- I try to have a sort of 'others' category here
};
}
endclass
module top;
randclass randclass;
initial begin
randclass = new();
repeat (10) begin
randclass.randomize();
end
$finish();
end
endmo