Tests: Fix determinism of randomization.

This commit is contained in:
Wilson Snyder 2018-05-25 07:15:29 -04:00
parent 92649ba494
commit fd98d231e4
2 changed files with 3 additions and 2 deletions

View File

@ -1210,6 +1210,7 @@ sub _make_main {
}
print $fh " Verilated::commandArgs(argc, argv);\n";
print $fh " Verilated::debug(".($self->{verilated_debug}?1:0).");\n";
print $fh " srand48(5);\n"; # Ensure determinism
print $fh " Verilated::randReset(".$self->{verilated_randReset}.");\n" if defined $self->{verilated_randReset};
print $fh " topp = new $VM_PREFIX (\"top\");\n";
my $set;

View File

@ -116,8 +116,8 @@ module Test
p[1] = p1;
p[2] = p2;
p[3] = p3;
p1_r[0] = p[0];
p1_r[1] = p[1];
p1_r[0] <= p[0];
p1_r[1] <= p[1];
end
endtask
endmodule