Skip to content

Commit a543a0f

Browse files
committed
rtl: fix declare after use lint warning
1 parent dddd726 commit a543a0f

File tree

2 files changed

+27
-29
lines changed

2 files changed

+27
-29
lines changed

rtl/idma/idma_obi_write.sv

Lines changed: 19 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -109,21 +109,23 @@ module idma_obi_write #(
109109
// the main buffer is conditionally to the write mask popped
110110
assign buffer_out_ready_o = write_happening ? mask_out : '0;
111111

112-
// signal the bus that we are ready
113-
assign write_req_o.req = ready_to_write;
114-
115112
// connect data and strobe either directly or mask invalid data
116-
if (MaskInvalidData) begin : gen_mask_invalid_data
117-
118-
// always_comb process implements masking of invalid data
119-
always_comb begin : proc_mask
120-
// defaults
113+
always_comb begin : proc_mask
114+
// defaults
115+
write_req_o = '0;
116+
buffer_data_masked = '0;
117+
// create back pressure on the b channel if the higher parts of the DMA
118+
// cannot accept more write responses
119+
write_req_o.rready = w_dp_ready_i;
120+
121+
if (MaskInvalidData) begin : gen_mask_invalid_data
121122
write_req_o.a.addr = aw_req_i.obi.a_chan.addr;
122123
write_req_o.a.aid = aw_req_i.obi.a_chan.aid;
123124
write_req_o.a.we = 1'b1;
124125
write_req_o.a.wdata = '0;
125126
write_req_o.a.be = '0;
126-
buffer_data_masked = '0;
127+
// signal the bus that we are ready
128+
write_req_o.req = ready_to_write;
127129
// control the write to the bus apply data to the bus only if data should be written
128130
if (ready_to_write == 1'b1 & !dp_poison_i) begin
129131
// assign data from buffers, mask non valid entries
@@ -135,18 +137,15 @@ module idma_obi_write #(
135137
// assign the out mask to the strobe
136138
write_req_o.a.be = mask_out;
137139
end
140+
end else begin : gen_direct_connect
141+
// assign meta data
142+
write_req_o.a.addr = aw_req_i.obi.a_chan.addr;
143+
write_req_o.a.aid = aw_req_i.obi.a_chan.aid;
144+
write_req_o.a.we = 1'b1;
145+
// simpler: direct connection
146+
write_req_o.a.wdata = buffer_out_i;
147+
write_req_o.a.be = dp_poison_i ? '0 : mask_out;
138148
end
139-
140-
end else begin : gen_direct_connect
141-
// assign meta data
142-
assign write_req_o.a.addr = aw_req_i.obi.a_chan.addr;
143-
assign write_req_o.a.aid = aw_req_i.obi.a_chan.aid;
144-
assign write_req_o.a.we = 1'b1;
145-
// not used signal
146-
assign buffer_data_masked = '0;
147-
// simpler: direct connection
148-
assign write_req_o.a.wdata = buffer_out_i;
149-
assign write_req_o.a.be = dp_poison_i ? '0 : mask_out;
150149
end
151150

152151
// we are ready for the next transfer internally, once the w last signal is applied
@@ -162,8 +161,4 @@ module idma_obi_write #(
162161
// w_dp_valid_o is triggered once the write answer is here
163162
assign w_dp_valid_o = write_rsp_i.rvalid;
164163

165-
// create back pressure on the b channel if the higher parts of the DMA cannot accept more
166-
// write responses
167-
assign write_req_o.rready = w_dp_ready_i;
168-
169164
endmodule

rtl/obi_uart/obi_uart_rx.sv

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -202,13 +202,15 @@ module obi_uart_rx import obi_uart_pkg::*; #()
202202
////////////////////////////////////////////////////////////////////////////////////////////////
203203
// General Logic //
204204
////////////////////////////////////////////////////////////////////////////////////////////////
205+
206+
// Character is all zeros, parity and stop indicate break, current line is still 0 -> break
207+
assign break_interrupt = (rsr_q == '0) & (break_q | break_d) & (~filtered_rxd_q);
208+
205209
always_comb begin
206210

207211
//--------------------------------------------------------------------------------------------
208212
// Defaults
209213
//--------------------------------------------------------------------------------------------
210-
// Character is all zeros, parity and stop indicate break, current line is still 0 -> break
211-
break_interrupt = (rsr_q == '0) & (break_q | break_d) & (~filtered_rxd_q);
212214

213215
//--FIFO Combinational------------------------------------------------------------------------
214216
fifo_clear = 1'b1; // Reset
@@ -221,9 +223,6 @@ module obi_uart_rx import obi_uart_pkg::*; #()
221223

222224
timeout_count_d = timeout_count_q;
223225
timeout_o = 1'b0; // timeout_o
224-
// timeout_level = (character_length * 4) +1
225-
character_length = (6'd02 +word_len_bits +reg_read_i.lcr.par_en +reg_read_i.lcr.stop_bits);
226-
timeout_level = (character_length << 2) + 6'd01;
227226

228227
fifo_error_index_d = fifo_error_index_q; // FIFO Error
229228

@@ -265,6 +264,10 @@ module obi_uart_rx import obi_uart_pkg::*; #()
265264
default: word_len_bits = 3'b111;
266265
endcase
267266

267+
// timeout_level = (character_length * 4) +1
268+
character_length = (6'd02 +word_len_bits +reg_read_i.lcr.par_en +reg_read_i.lcr.stop_bits);
269+
timeout_level = (character_length << 2) + 6'd01;
270+
268271
//--------------------------------------------------------------------------------------------
269272
// Clear RHR & LSR after OBI read
270273
//--------------------------------------------------------------------------------------------

0 commit comments

Comments
 (0)