fix testbench RNG for preamble length

This commit is contained in:
Arthur Lu 2022-08-20 23:27:22 -07:00
parent 770f6eb8cc
commit d27def5296
3 changed files with 3 additions and 3 deletions

View File

@ -57,7 +57,7 @@ module program1_tb ();
// set preamble length for the program run (always > 9 but < 26)
always_comb begin
pre_length = $urandom;
pre_length = $urandom_range(10, 26);
if(pre_length < 10) pre_length = 10; // prevents pre_length < 10
else if(pre_length > 26) pre_length = 26; // prevets pre_length > 26
end

View File

@ -56,7 +56,7 @@ module program2_tb () ;
// set preamble lengths for the four program runs (always > 9 but < 16)
always_comb begin
pre_length = $urandom;//$random>>10 ; // program 1 run
pre_length = $urandom_range(10, 26);//$random>>10 ; // program 1 run
if(pre_length < 10) pre_length = 10; // prevents pre_length < 10
else if(pre_length > 26) pre_length = 26;
end

View File

@ -57,7 +57,7 @@ module program3_tb ();
// set preamble length for the program run (always > 9 but < 26)
always_comb begin
pre_length = $urandom;
pre_length = $urandom_range(10, 26);
if(pre_length < 10) pre_length = 10; // prevents pre_length < 10
else if(pre_length > 26) pre_length = 26; // prevets pre_length > 26
end