1,传递seed
module top();
initial
begin
int test_args1;
int seed;
$value$plusargs("seed=%d",seed);
test_args1 = $urandom(seed);
$display("test_args1 = %d", test_args1);
$finish;
end
endmodule
2,使用系统级的seed
module top();
initial
begin
int test_args1;
test_args1 = $urandom();
$display("test_args1 = %d", test_args1);
$finish;
end
endmodule
方法2好用一点,不用每次都使用$random(seed);