Skip to content

Commit 165a981

Browse files
committed
let's stick to verilog for now
1 parent e9e408a commit 165a981

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

tb/i2c_master_tb.v

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -58,23 +58,23 @@ module i2c_master_tb;
5858
reg sda2 = 1;
5959
reg scl2 = 1;
6060

61-
62-
task wait_for_success();
63-
64-
do begin
61+
task wait_for_success;
62+
reg continue_waiting;
63+
begin
64+
continue_waiting = 1;
65+
while (continue_waiting) begin
6566
@(posedge missed_ack or posedge value_has_been_written or posedge m_axis_data_tvalid or posedge s_axis_cmd_stop);
6667
if (missed_ack) begin
6768
s_axis_data_tvalid = 1;
68-
$display("missed ack detected we retry happiliy?");
69+
$display("missed ack detected we retry happily?");
6970
end else if (value_has_been_written | m_axis_data_tvalid | s_axis_cmd_stop) begin
70-
7171
s_axis_data_tvalid = 0;
7272
s_axis_cmd_valid = 0;
73+
continue_waiting = 0;
7374
end
74-
end while (s_axis_data_tvalid == 1'b1); //what happens if it gets no ack at the end?
75-
76-
77-
endtask : wait_for_success
75+
end
76+
end
77+
endtask
7878
// Generate block for Device 3
7979
generate
8080
if (ENABLE_DEVICE_3) begin : device_3

0 commit comments

Comments
 (0)