diff --git a/vunit/vhdl/verification_components/run.py b/vunit/vhdl/verification_components/run.py index 4033e484f6..8dee0b51ea 100644 --- a/vunit/vhdl/verification_components/run.py +++ b/vunit/vhdl/verification_components/run.py @@ -144,7 +144,7 @@ def gen_avalon_master_tests(obj, *args): TB_AXI_STREAM_PROTOCOL_CHECKER = LIB.test_bench("tb_axi_stream_protocol_checker") -for data_length in [0, 8]: +for data_length in [0, 8, 32]: for test in TB_AXI_STREAM_PROTOCOL_CHECKER.get_tests("*passing*tdata*"): test.add_config(name="data_length=%d" % data_length, generics=dict(data_length=data_length)) diff --git a/vunit/vhdl/verification_components/test/tb_axi_stream_protocol_checker.vhd b/vunit/vhdl/verification_components/test/tb_axi_stream_protocol_checker.vhd index 092151b25d..1057314c65 100644 --- a/vunit/vhdl/verification_components/test/tb_axi_stream_protocol_checker.vhd +++ b/vunit/vhdl/verification_components/test/tb_axi_stream_protocol_checker.vhd @@ -42,7 +42,7 @@ architecture a of tb_axi_stream_protocol_checker is constant logger : logger_t := get_logger("protocol_checker"); constant protocol_checker : axi_stream_protocol_checker_t := new_axi_stream_protocol_checker( data_length => tdata'length, id_length => tid'length, dest_length => tdest'length, user_length => tuser'length, - logger => logger, actor => new_actor("protocol_checker"), max_waits => max_waits + logger => logger, actor => new_actor("protocol_checker"), max_waits => max_waits, allow_x_in_null_bytes => true ); constant meta_values : std_logic_vector(1 to 5) := "-XWZU"; constant valid_values : std_logic_vector(1 to 4) := "01LH"; @@ -168,6 +168,29 @@ begin end loop; end; + procedure pass_masked_unknown_test( + signal d, k, s : out std_logic_vector; + signal e1, e2 : out std_logic) is + begin + wait until rising_edge(aclk); + e1 <= '1'; + e2 <= '1'; + + for i in valid_values'range loop + for j in k'range loop + for l in meta_values'range loop + k <= (k'range => '1'); + s <= (s'range => '1'); + k(j) <= '0'; + s(j) <= '0'; + d <= (d'range => valid_values(i)); + d(j*8+7 downto j*8) <= (others => meta_values(l)); + wait until rising_edge(aclk); + end loop; + end loop; + end loop; + end; + procedure fail_unknown_test( signal d: out std_logic_vector; signal e1, e2: out std_logic; @@ -315,6 +338,9 @@ begin elsif run("Test passing check of that tdata must not be unknown when tvalid is high") then pass_unknown_test(tdata, tvalid, tready); + elsif run("Test passing check of that valid tdata bytes must not be unknown when tvalid is high") then + pass_masked_unknown_test(tdata, tkeep, tstrb, tvalid, tready); + elsif run("Test failing check of that tdata must not be unknown when tvalid is high") then fail_unknown_test(tdata, tvalid, tready, ":rule 5", "tdata", "tvalid");