@@ -230,8 +230,8 @@ begin
230230 drive_ar_invalid;
231231
232232 elsif is_write(msg_type) then
233- while rnd.Uniform(0.0 , 1.0 ) > axi_master_handle.p_write_high_probability loop
234- wait until rising_edge (aclk);
233+ while rnd.Uniform(0.0 , 1.0 ) > axi_master_handle.p_write_high_probability and areset_n = '1' loop
234+ wait until rising_edge (aclk) or areset_n = '0' ;
235235 end loop ;
236236
237237 addr := pop_std_ulogic_vector(request_msg);
@@ -287,7 +287,11 @@ begin
287287 wlast <= '1' when len = 0 else '0' ;
288288
289289 while not (w_done and aw_done) loop
290- wait until ((awvalid and awready) = '1' or (wvalid and wready) = '1' ) and rising_edge (aclk);
290+ wait until (((awvalid and awready) = '1' or (wvalid and wready) = '1' ) and rising_edge (aclk)) or areset_n = '0' ;
291+
292+ if areset_n = '0' then
293+ exit ;
294+ end if ;
291295
292296 if (awvalid and awready) = '1' then
293297 awvalid <= '0' ;
@@ -319,10 +323,12 @@ begin
319323
320324 end loop ;
321325
322- push_std_ulogic_vector(request_msg, addr);
323- push_std_ulogic_vector(request_msg, id);
324- push_std_ulogic_vector(request_msg, resp);
325- push(write_reply_queue, request_msg);
326+ if areset_n = '1' then
327+ push_std_ulogic_vector(request_msg, addr);
328+ push_std_ulogic_vector(request_msg, id);
329+ push_std_ulogic_vector(request_msg, resp);
330+ push(write_reply_queue, request_msg);
331+ end if ;
326332
327333 else
328334 unexpected_msg_type(msg_type);
@@ -417,18 +423,20 @@ begin
417423
418424 bready <= '1' ;
419425 wait until (bvalid and bready) = '1' and rising_edge (aclk);
420- bready <= '0' ;
426+ if areset_n = '1' then
427+ bready <= '0' ;
421428
422- request_msg := pop(write_reply_queue);
423- msg_type := message_type(request_msg);
424- addr := pop_std_ulogic_vector(request_msg);
425- id := pop_std_ulogic_vector(request_msg);
426- resp := pop_std_ulogic_vector(request_msg);
429+ request_msg := pop(write_reply_queue);
430+ msg_type := message_type(request_msg);
431+ addr := pop_std_ulogic_vector(request_msg);
432+ id := pop_std_ulogic_vector(request_msg);
433+ resp := pop_std_ulogic_vector(request_msg);
427434
428- check_axi_id(axi_master_handle.p_bus_handle, bid, id, " bid" );
429- check_axi_resp(axi_master_handle.p_bus_handle, bresp, resp, " bresp" );
435+ check_axi_id(axi_master_handle.p_bus_handle, bid, id, " bid" );
436+ check_axi_resp(axi_master_handle.p_bus_handle, bresp, resp, " bresp" );
430437
431- delete(request_msg);
438+ delete(request_msg);
439+ end if ;
432440 end process ;
433441
434442end architecture ;
0 commit comments