diff --git a/vunit/vhdl/verification_components/src/axi_stream_protocol_checker.vhd b/vunit/vhdl/verification_components/src/axi_stream_protocol_checker.vhd index 49b49c84e5..d9f81cb5e1 100644 --- a/vunit/vhdl/verification_components/src/axi_stream_protocol_checker.vhd +++ b/vunit/vhdl/verification_components/src/axi_stream_protocol_checker.vhd @@ -69,6 +69,20 @@ architecture a of axi_stream_protocol_checker is signal areset_n_d : std_logic := '0'; signal areset_rose : std_logic; signal not_tvalid : std_logic; + + signal tdata_masked : std_logic_vector(tdata'range); + + function mask_unused_bytes(data : std_logic_vector; keep : std_logic_vector) return std_logic_vector is + variable ret : std_logic_vector(data'range); + begin + ret := data; + for i in keep'range loop + if keep(i) = '0' then + ret(i*8+7 downto i*8) := (others => '0'); + end if; + end loop; + return ret; + end function; begin handshake_is_not_x <= '1' when not is_x(tvalid) and not is_x(tready) else '0'; @@ -112,7 +126,8 @@ begin -- AXI4STREAM_ERRM_TDATA_X A value of X on TDATA is not permitted when TVALID -- is HIGH - check_not_unknown(rule5_checker, aclk, tvalid, tdata, result("for tdata when tvalid is high")); + tdata_masked <= mask_unused_bytes(tdata, tkeep); + check_not_unknown(rule5_checker, aclk, tvalid, tdata_masked, result("for tdata when tvalid is high")); -- AXI4STREAM_ERRM_TLAST_X A value of X on TLAST is not permitted when TVALID -- is HIGH