Skip to content

Commit 9af5cd7

Browse files
committed
ibi: wait for stop or repeated start
1 parent 635caea commit 9af5cd7

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/ctrl/controller_standby_i3c.sv

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -579,6 +579,7 @@ module controller_standby_i3c
579579
.scl_posedge_i (ctrl_bus_i.scl.pos_edge),
580580
.bus_available_i(bus_available),
581581
.bus_stop_i (ctrl_bus_i.stop_det),
582+
.bus_rstart_i (ctrl_bus_i.rstart_det),
582583

583584
.bus_tx_done_i (ibi_bus_tx_done),
584585
.bus_tx_req_byte_o (ibi_bus_tx_req_byte),

src/ctrl/ibi.sv

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ module ibi (
4444
input logic scl_posedge_i,
4545
input logic bus_available_i,
4646
input logic bus_stop_i,
47+
input logic bus_rstart_i,
4748

4849
// Bus TX interface
4950
input logic bus_tx_done_i,
@@ -105,7 +106,7 @@ module ibi (
105106
// Transmitt T bit
106107
SendTbit,
107108
// Wait for stop condition
108-
WaitStop,
109+
WaitStopOrRstart,
109110
// Flush remaining IBI data bytes
110111
Flush,
111112
// Signal to primary FSM that IBI is done
@@ -144,7 +145,7 @@ module ibi (
144145
if (bus_stop_i) state_q <= Done;
145146
else if (bus_rx_done_i)
146147
if (bus_rx_req_nack) // NACK
147-
state_q <= WaitStop;
148+
state_q <= WaitStopOrRstart;
148149
else // ACK
149150
state_q <= WaitForSclNegedgeAfterAck;
150151

@@ -159,7 +160,7 @@ module ibi (
159160
if (bus_stop_i) state_q <= Flush;
160161
else if (bus_tx_done_i) state_q <= ibi_byte_last_i ? Done : SendData;
161162

162-
WaitStop: if (bus_stop_i) state_q <= Idle;
163+
WaitStopOrRstart: if (bus_stop_i | bus_rstart_i) state_q <= Idle;
163164

164165
Flush: if (!ibi_byte_valid_i) state_q <= Done;
165166

@@ -273,6 +274,6 @@ module ibi (
273274
assign done_o = (state_q == Done);
274275

275276
assign ibi_status_o = ibi_status;
276-
assign ibi_status_we_o = (state_q == Done) | ((state_q == WaitStop) & bus_stop_i);
277+
assign ibi_status_we_o = (state_q == Done) | ((state_q == WaitStopOrRstart) & bus_stop_i);
277278

278279
endmodule

0 commit comments

Comments
 (0)