@@ -43,14 +43,15 @@ architecture a of tb_apb_master is
4343 address_length => paddr'length );
4444 constant memory : memory_t := new_memory;
4545 constant slave_handle : apb_slave_t := new_apb_slave(memory => memory,
46- logger => get_logger(" apb slave" ));
46+ logger => get_logger(" apb slave" ),
47+ ready_high_probability => 0.5 );
4748
4849 signal start : boolean := false ;
4950begin
5051
5152 main_stim : process
5253 variable buf : buffer_t;
53- variable data : std_logic_vector (prdata'range );
54+ variable data, data2 : std_logic_vector (prdata'range );
5455 variable bus_ref1, bus_ref2 : bus_reference_t;
5556 begin
5657 show(get_logger(" apb slave" ), display_handler, debug);
9596 wait_until_idle(net, bus_handle);
9697 check_expected_was_written(memory);
9798
99+ elsif run(" many_reads" ) then
100+ for i in 1 to 100 loop
101+ buf := allocate(memory => memory, num_bytes => 2 , permissions => read_only);
102+ data := std_logic_vector (to_unsigned (i, BUS_DATA_WIDTH));
103+ write_word(memory, base_address(buf), data);
104+ read_bus(net, bus_handle, base_address(buf), data2);
105+ check_equal(data2, data, " Check read data." );
106+ end loop ;
107+
108+ elsif run(" many_writes" ) then
109+ for i in 1 to 100 loop
110+ buf := allocate(memory => memory, num_bytes => 2 , permissions => write_only);
111+ data := std_logic_vector (to_unsigned (i, BUS_DATA_WIDTH));
112+ set_expected_word(memory, base_address(buf), data);
113+ write_bus(net, bus_handle, base_address(buf), data);
114+ end loop ;
115+ wait_until_idle(net, bus_handle);
116+ check_expected_was_written(memory);
117+
98118 end if ;
99119
100120 wait for 100 ns ;
0 commit comments