Skip to content

Commit a75d8f5

Browse files
committed
quests 08 & 14: Refactor loop variable names in test procedures for clarity and to not mask the outer loop's variable
1 parent 0918c3d commit a75d8f5

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

ip/08_Deserialiser/tb_deserialiser.vhd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ begin
117117
reset_module;
118118
start_module;
119119

120-
for i in 1 to 1000 loop
120+
for repetition in 1 to 1000 loop
121121
din_test := random.RandSlv(Size => dout'length);
122122

123123
for i in dout'low to dout'high loop

ip/14_Stopwatch_Timer/tb_stopwatch_timer.vhd

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ begin
217217
end procedure;
218218

219219
procedure test_when_reset is
220-
variable random_wait_in_clk_cycles: natural := 0;
220+
variable random_wait_in_clk_cycles: natural := 0;
221221
begin
222222
info("4.0) test_when_reset");
223223

@@ -248,7 +248,7 @@ begin
248248
reset_start_in;
249249

250250
for i in 1 to START_STOP_SEQUENCE loop
251-
for i in 1 to WAIT_REPETITIONS loop
251+
for j in 1 to WAIT_REPETITIONS loop
252252
random_wait_in_clk_cycles := random.RandInt(1, 10);
253253
wait_clk_cycles(random_wait_in_clk_cycles);
254254
expected_count := get_expected_count_after_wait(current_count => expected_count, wait_time => random_wait_in_clk_cycles);
@@ -259,7 +259,7 @@ begin
259259
wait_clk_cycles(1);
260260
stop_in <= '0';
261261

262-
for i in 1 to WAIT_REPETITIONS loop
262+
for j in 1 to WAIT_REPETITIONS loop
263263
wait_clk_cycles(1);
264264
check_stop(frozen_value => expected_count);
265265
end loop;
@@ -352,10 +352,10 @@ begin
352352
reset <= random.DistSl(Weight => RESET_WEIGHT);
353353
start_in <= random.DistSl(Weight => START_WEIGHT_SEQUENCE);
354354
stop_in <= random.DistSl(Weight => STOP_WEIGHT_SEQUENCE);
355-
355+
356356
random_wait_in_clk_cycles := random.RandInt(1, 10);
357357

358-
for i in 1 to random_wait_in_clk_cycles loop
358+
for j in 1 to random_wait_in_clk_cycles loop
359359
wait_clk_cycles(1);
360360
expected_count := get_expected_count(current_count => expected_count);
361361
end loop;

0 commit comments

Comments
 (0)