axi_stream_slave: check_axi_stream does not compare TDATA bits beyond the last whole byte
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 65/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 領域
- testing
調査の方向性
axi_stream_slave.vhd の check_axi_stream 内の比較ループ for idx in tkeep'range から始めてください。このループは、完全な TKEEP バイトに対応する TDATA のビットしか検査していません。data_width を 4 と 12 にして再現用テストベンチを実行し、MSB が異なる場合でも通過することを確認します。MSB と、最後の完全なバイトより上のすべてのビットが比較され、4、8、12、16 ビットの構成が想定どおり失敗すれば完了です。提案されている 2 つの修正案のどちらにするかは、先にメンテナーと相談して決めてください。
索引モデルが issue の本文から書いたものです。
説明
check_axi_stream compares TDATA per TKEEP bit, i.e. byte by byte (axi_stream_slave.vhd, the loop for idx in tkeep'range). tkeep has data_length / 8 bits, so:
- for a data width below 8 bits the loop range is empty and
TDATAis not checked at all; - for a width that is not a multiple of 8, the bits above the last whole byte are not checked.
TLAST, TUSER, TID and TDEST are checked as expected. The loop is unchanged on master (5921757e21).
Reproduction (GHDL 6.0.0, VUnit 5.0.0.dev7): a master and a slave of the same width connected directly; the test sends all zeros and expects the most significant bit set.
sent_v := (others => '0');
expected_v := (others => '0');
expected_v(data_width-1) := '1';
push_axi_stream(net, master_c, sent_v, tlast => '1');
check_axi_stream(net, slave_c, expected_v, tlast => '1', msg => "MSB differs");
| data_width | Result | Expected |
|---|---|---|
| 4 | pass | fail |
| 8 | fail | fail |
| 12 | pass | fail |
| 16 | fail | fail |
We found it through a mutation test of a Reed-Solomon encoder with 4-bit symbols: a wrong encoder passed every 4-bit configuration.
Suggested fix: compare the bits above 8 * tkeep'length unconditionally, since there is no TKEEP bit for them. Alternatively, compare the whole TDATA when data_length is not a multiple of 8.
Complete testbench and run script
library ieee;
use ieee.std_logic_1164.all;
library vunit_lib;
context vunit_lib.vunit_context;
context vunit_lib.vc_context;
entity tb_axis_width is
generic (
runner_cfg : string;
data_width : positive := 4
);
end entity;
architecture tb of tb_axis_width is
constant master_c : axi_stream_master_t := new_axi_stream_master(data_length => data_width);
constant slave_c : axi_stream_slave_t := new_axi_stream_slave(data_length => data_width);
signal clk : std_logic := '0';
signal valid : std_logic;
signal ready : std_logic;
signal last : std_logic;
signal data : std_logic_vector(data_width - 1 downto 0);
begin
clk <= not clk after 5 ns;
main : process is
variable sent_v, expected_v : std_logic_vector(data_width - 1 downto 0);
begin
test_runner_setup(runner, runner_cfg);
sent_v := (others => '0');
expected_v := (others => '0');
-- The expected value differs from the sent value in the most significant bit only
expected_v(data_width-1) := '1';
push_axi_stream(net, master_c, sent_v, tlast => '1');
check_axi_stream(net, slave_c, expected_v, tlast => '1', msg => "MSB differs");
wait_until_idle(net, as_sync(slave_c));
test_runner_cleanup(runner);
end process;
i_master : entity vunit_lib.axi_stream_master
generic map (master => master_c)
port map (aclk => clk, tvalid => valid, tready => ready, tdata => data, tlast => last);
i_slave : entity vunit_lib.axi_stream_slave
generic map (slave => slave_c)
port map (aclk => clk, tvalid => valid, tready => ready, tdata => data, tlast => last);
end architecture;
from pathlib import Path
from vunit import VUnit
vu = VUnit.from_argv()
vu.add_vhdl_builtins()
vu.add_verification_components()
lib = vu.add_library("lib")
lib.add_source_files(Path(__file__).parent / "tb_axis_width.vhd")
tb = lib.test_bench("tb_axis_width")
for w in (4, 8, 12, 16):
tb.add_config(name=f"w{w}", generics={"data_width": w})
vu.main()
- 主要言語
- VHDL
- スター
- 850
- フォーク
- 305
- 平均マージ
- 2日 10時間
- マージ済み PR(30日)
- 7
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
VUnit/vunit のほかの issue
-
KeyError in test scheduler when using TestBench.scan_tests_from_file()対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
GHDL: generics leak between configurations when `ghdl.sim_flags` is set対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
メンテナーはふだん 1 日以内に返信
-
AXI slave VCs have identical stalling behavior対応中かも @Lay007 が 27 日前に担当しました。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 1〜2日 初心者へのやさしさ 52/100
メンテナーはふだん 1 日以内に返信
似ている issue
-
area-testing p1-recommended
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
ehmpathy/rhachet-roles-bhrain#705 ·
メンテナーはふだん 1 日以内に返信
-
evals: run-validity calls runs VALID when every Bash call failed to start the sandbox (long TMPDIR)オープンpriority: medium status: needs-decision work-class: scoped
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
melodic-software/claude-code-plugins#9611 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
failed-test failure:ai-fixable failure:insufficient-data failure:test-needs-update scout-playwright Team:Discover
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
elastic/kibana#300328 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
aws-cloudformation/cfn-lint#4888 ·
メンテナーはふだん 2 日以内に返信