Skip to content

Commit

Permalink
Fix bug in AXI stream protocol checker rule 5.
Browse files Browse the repository at this point in the history
This rule would trigger incorrectly for tdata bytes that are masked by tkeep.
  • Loading branch information
bewimm committed Feb 11, 2022
1 parent 1b42dfe commit 58d0b82
Showing 1 changed file with 16 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 58d0b82

Please sign in to comment.