Skip to content

Commit

Permalink
give meaningful name to generics to avoid comment
Browse files Browse the repository at this point in the history
  • Loading branch information
David Stadelmann authored and eine committed Dec 13, 2019
1 parent 07ee40c commit 6f769f9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions vunit/vhdl/verification_components/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,9 @@ def gen_avalon_master_tests(obj, *args):

tb_axi_stream = lib.test_bench("tb_axi_stream")
for test in tb_axi_stream.get_tests("test random stall on master"):
test.add_config(name="stall_master", generics=dict(g_stall_master=30))
test.add_config(name="stall_master", generics=dict(g_stall_percentage_master=30))

for test in tb_axi_stream.get_tests("test random stall on slave"):
test.add_config(name="stall_slave", generics=dict(g_stall_slave=30))
test.add_config(name="stall_slave", generics=dict(g_stall_percentage_slave=30))

ui.main()
16 changes: 8 additions & 8 deletions vunit/vhdl/verification_components/test/tb_axi_stream.vhd
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,19 @@ use work.sync_pkg.all;

entity tb_axi_stream is
generic(
runner_cfg : string;
g_id_length : natural := 8;
g_dest_length : natural := 8;
g_user_length : natural := 8;
g_stall_master : natural range 0 to 100 := 0; -- as in 0 to 100%
g_stall_slave : natural range 0 to 100 := 0; -- as in 0 to 100%
runner_cfg : string;
g_id_length : natural := 8;
g_dest_length : natural := 8;
g_user_length : natural := 8;
g_stall_percentage_master : natural range 0 to 100 := 0;
g_stall_percentage_slave : natural range 0 to 100 := 0
);
end entity;

architecture a of tb_axi_stream is

constant master_stall_config : stall_config_t := (stall_probability => real(g_stall_master)/100.0, min_stall_cycles => 5, max_stall_cycles => 15);
constant slave_stall_config : stall_config_t := (stall_probability => real(g_stall_slave)/100.0, min_stall_cycles => 5, max_stall_cycles => 15);
constant master_stall_config : stall_config_t := (stall_probability => real(g_stall_percentage_master)/100.0, min_stall_cycles => 5, max_stall_cycles => 15);
constant slave_stall_config : stall_config_t := (stall_probability => real(g_stall_percentage_slave)/100.0, min_stall_cycles => 5, max_stall_cycles => 15);

constant master_axi_stream : axi_stream_master_t := new_axi_stream_master(
data_length => 8,
Expand Down

0 comments on commit 6f769f9

Please sign in to comment.