File tree Expand file tree Collapse file tree 1 file changed +10
-10
lines changed Expand file tree Collapse file tree 1 file changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -58,23 +58,23 @@ module i2c_master_tb;
58
58
reg sda2 = 1 ;
59
59
reg scl2 = 1 ;
60
60
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
65
66
@(posedge missed_ack or posedge value_has_been_written or posedge m_axis_data_tvalid or posedge s_axis_cmd_stop);
66
67
if (missed_ack) begin
67
68
s_axis_data_tvalid = 1 ;
68
- $display ("missed ack detected we retry happiliy ?" );
69
+ $display ("missed ack detected we retry happily ?" );
69
70
end else if (value_has_been_written | m_axis_data_tvalid | s_axis_cmd_stop) begin
70
-
71
71
s_axis_data_tvalid = 0 ;
72
72
s_axis_cmd_valid = 0 ;
73
+ continue_waiting = 0 ;
73
74
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
78
78
// Generate block for Device 3
79
79
generate
80
80
if (ENABLE_DEVICE_3) begin : device_3
You can’t perform that action at this time.
0 commit comments