@@ -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-
169164endmodule
0 commit comments