Skip to content

Commit 07e0e95

Browse files
robertszczepanskitmichalak
authored andcommitted
Resolve LINT errors
Internal-tag: [#74406]
1 parent 0cd9d44 commit 07e0e95

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

src/ctrl/flow_active.sv

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ module flow_active
264264
// - 6: Defining Byte + 1
265265
// - 7: Defining Byte + 2
266266
imm_use_def_byte = immediate_cmd_desc.dtt > 4 ? 1'b1 : 1'b0;
267-
data_length = imm_use_def_byte ? immediate_cmd_desc.dtt - 5 : immediate_cmd_desc.dtt;
267+
data_length = imm_use_def_byte ? 16'(immediate_cmd_desc.dtt - 5) : 16'(immediate_cmd_desc.dtt);
268268
end
269269
AddressAssignment: begin
270270
// TODO
@@ -398,7 +398,7 @@ module flow_active
398398
FetchDAT: begin
399399
// TODO: Optimize DAT read so it takes just 1 cycle
400400
dat_read_valid_hw_o = 1'b1;
401-
dat_index_hw_o = dev_index;
401+
dat_index_hw_o = $clog2(`DAT_DEPTH)'(dev_index);
402402
end
403403
// I2CWriteImmediate: Execute Immediate Transfer to Legacy I2C Device via I2C Controller
404404
I2CWriteImmediate: begin

src/ctrl/flow_standby_i2c.sv

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ module flow_standby_i2c
6262
// Are we currently mid-transfer?
6363
logic transfer_active;
6464
// Number of data bytes held in `fifo_buf`
65-
logic [AcqFifoDepth-1:0] byte_count; // Note: We handle only 4 entries of `fifo_buf`
65+
logic [1:0] byte_count; // Note: We handle only 4 entries of `fifo_buf`
6666
// Total number of bytes processed in transaction
6767
logic [15:0] transaction_byte_count;
6868
// Read transaction length
@@ -134,7 +134,9 @@ module flow_standby_i2c
134134
end : accumulate_bytes_in_dword
135135

136136
always_ff @(posedge clk_i or negedge rst_ni) begin : change_byte_count
137-
if (!rst_ni | reset_byte_count) begin
137+
if (!rst_ni) begin
138+
transaction_byte_count <= 0;
139+
end else if (reset_byte_count) begin
138140
transaction_byte_count <= 0;
139141
end else begin
140142
if (push_byte) begin
@@ -232,7 +234,7 @@ module flow_standby_i2c
232234
activate_transfer = start_detected;
233235
deactivate_transfer = stop_detected | restart_detected;
234236

235-
if (xfer_read) tx_fifo_rdata_o = fifo_buf[byte_count];
237+
if (xfer_read) tx_fifo_rdata_o = fifo_buf[byte_count][7:0];
236238
else tx_fifo_rdata_o = 0;
237239
end : state_outputs
238240

0 commit comments

Comments
 (0)