From ad4773057c77fa833e55a39cf0373c3ee7464597 Mon Sep 17 00:00:00 2001 From: Olof Kraigher Date: Sat, 4 Nov 2023 21:22:15 +0100 Subject: [PATCH] Remove unused code --- vunit/vhdl/check/src/check.vhd | 1 - vunit/vhdl/check/test/tb_check.vhd | 2 +- vunit/vhdl/check/test/tb_check_not_unknown.vhd | 2 -- vunit/vhdl/check/test/tb_checker.vhd | 6 ++---- vunit/vhdl/check/test/tb_result.vhd | 1 - vunit/vhdl/com/src/com.vhd | 3 --- vunit/vhdl/com/test/tb_com.vhd | 4 +--- vunit/vhdl/data_types/test/tb_codec.vhd | 4 ---- vunit/vhdl/dictionary/test/tb_dictionary.vhd | 4 +--- vunit/vhdl/logging/src/log_handler_pkg-body.vhd | 9 --------- vunit/vhdl/logging/src/log_levels_pkg-body.vhd | 1 - vunit/vhdl/logging/src/logger_pkg-body.vhd | 11 ----------- vunit/vhdl/logging/src/print_pkg-body.vhd | 1 - vunit/vhdl/logging/test/tb_log.vhd | 4 ---- vunit/vhdl/run/src/run.vhd | 1 - vunit/vhdl/run/test/run_tests.vhd | 7 ------- vunit/vhdl/string_ops/test/tb_string_ops.vhd | 1 - .../verification_components/src/wishbone_master.vhd | 8 +------- .../verification_components/test/tb_avalon_slave.vhd | 3 --- .../test/tb_wishbone_slave.vhd | 2 -- 20 files changed, 6 insertions(+), 69 deletions(-) diff --git a/vunit/vhdl/check/src/check.vhd b/vunit/vhdl/check/src/check.vhd index 643292f1d..8e500969c 100644 --- a/vunit/vhdl/check/src/check.vhd +++ b/vunit/vhdl/check/src/check.vhd @@ -909,7 +909,6 @@ package body check_pkg is procedure close_window(cycle : unsigned; is_ok : boolean) is variable close_ok : boolean := is_ok; - variable pass_msg_en : boolean; begin if is_x(end_event) then close_ok := false; diff --git a/vunit/vhdl/check/test/tb_check.vhd b/vunit/vhdl/check/test/tb_check.vhd index 774930c6c..542e1e55b 100644 --- a/vunit/vhdl/check/test/tb_check.vhd +++ b/vunit/vhdl/check/test/tb_check.vhd @@ -65,7 +65,7 @@ begin check_runner : process variable passed : boolean; - variable check_result, check_result2 : check_result_t; + variable check_result : check_result_t; variable stat : checker_stat_t; constant default_level : log_level_t := error; diff --git a/vunit/vhdl/check/test/tb_check_not_unknown.vhd b/vunit/vhdl/check/test/tb_check_not_unknown.vhd index b8d3f274a..a8f5925b2 100644 --- a/vunit/vhdl/check/test/tb_check_not_unknown.vhd +++ b/vunit/vhdl/check/test/tb_check_not_unknown.vhd @@ -43,10 +43,8 @@ architecture test_fixture of tb_check_not_unknown is alias en_5 : std_logic is check_not_unknown_in_5(0); alias en_6 : std_logic is check_not_unknown_in_6(0); - constant my_checker : checker_t := new_checker("my_checker1"); constant my_checker2 : checker_t := new_checker("my_checker2"); constant my_checker3 : checker_t := new_checker("my_checker3", default_log_level => info); - constant my_checker4 : checker_t := new_checker("my_checker4"); constant my_checker5 : checker_t := new_checker("my_checker5"); constant my_checker6 : checker_t := new_checker("my_checker6", default_log_level => info); diff --git a/vunit/vhdl/check/test/tb_checker.vhd b/vunit/vhdl/check/test/tb_checker.vhd index db6979568..d20057ac3 100644 --- a/vunit/vhdl/check/test/tb_checker.vhd +++ b/vunit/vhdl/check/test/tb_checker.vhd @@ -22,15 +22,13 @@ use vunit_lib.logger_pkg.all; entity tb_checker is generic ( - runner_cfg : string := ""; - output_path : string); + runner_cfg : string := ""); end entity; architecture test_fixture of tb_checker is begin test_runner : process - variable checker1, checker2 : checker_t; - variable stat, stat1, stat2 : checker_stat_t; + variable stat1, stat2 : checker_stat_t; variable stat_before, stat_after : checker_stat_t; variable my_checker : checker_t := new_checker("my_checker"); variable my_logger : logger_t := get_logger(my_checker); diff --git a/vunit/vhdl/check/test/tb_result.vhd b/vunit/vhdl/check/test/tb_result.vhd index 0e022c6ed..fd7c2641a 100644 --- a/vunit/vhdl/check/test/tb_result.vhd +++ b/vunit/vhdl/check/test/tb_result.vhd @@ -24,7 +24,6 @@ architecture test_fixture of tb_result is begin test_runner : process constant punctuation_marks_not_preceeded_by_space : string := ".,:;?!"; - variable stat : checker_stat_t; begin test_runner_setup(runner, runner_cfg); diff --git a/vunit/vhdl/com/src/com.vhd b/vunit/vhdl/com/src/com.vhd index 33069c5af..8b4c88d45 100644 --- a/vunit/vhdl/com/src/com.vhd +++ b/vunit/vhdl/com/src/com.vhd @@ -250,9 +250,6 @@ package body com_pkg is variable reply_msg : inout msg_t; constant timeout : in time := max_timeout) is variable status : com_status_t; - variable source_actor : actor_t; - variable mailbox : mailbox_id_t; - variable message : message_ptr_t; begin delete(reply_msg); diff --git a/vunit/vhdl/com/test/tb_com.vhd b/vunit/vhdl/com/test/tb_com.vhd index 840c80b93..f3fe2edb1 100644 --- a/vunit/vhdl/com/test/tb_com.vhd +++ b/vunit/vhdl/com/test/tb_com.vhd @@ -34,7 +34,7 @@ begin test_runner : process variable self, actor, actor2, actor3, actor4 : actor_t; variable actor5, my_receiver, my_sender, server, publisher : actor_t; - variable publisher2, subscriber, subscriber2, subscriber3 : actor_t; + variable subscriber : actor_t; variable actor_vec : actor_vec_t(0 to 2); variable status : com_status_t; variable n_actors : natural; @@ -43,9 +43,7 @@ begin variable msg, msg2, msg3, msg4 : msg_t; variable request_msg, request_msg2, request_msg3, reply_msg : msg_t; variable peeked_msg1, peeked_msg2 : msg_t; - variable msg_vec_ptr : msg_vec_ptr_t; variable deprecated_message : message_ptr_t; - variable subscription_vec_ptr : subscription_vec_ptr_t; variable actor_state : actor_state_t; variable mailbox_state : mailbox_state_t; variable l : line; diff --git a/vunit/vhdl/data_types/test/tb_codec.vhd b/vunit/vhdl/data_types/test/tb_codec.vhd index 48cb7e92f..0458b72ae 100644 --- a/vunit/vhdl/data_types/test/tb_codec.vhd +++ b/vunit/vhdl/data_types/test/tb_codec.vhd @@ -81,16 +81,12 @@ begin return ieee.numeric_std."="(l, r); end function "="; - variable r1, r2 : real; constant positive_zero : real := 0.0; constant negative_zero : real := -1.0/1.0e45; constant positive_infinity : real := 1.0e39; constant negative_infinity : real := -1.0e39; constant special_chars : string(1 to 3) := "),("; - constant comma : character := ','; - constant lp : character := '('; - constant rp : character := ')'; variable null_string : string(10 to 9); variable t1 : time; variable string_15_downto_4 : string(15 downto 4); diff --git a/vunit/vhdl/dictionary/test/tb_dictionary.vhd b/vunit/vhdl/dictionary/test/tb_dictionary.vhd index 62fbc0f73..1f35bd9b7 100644 --- a/vunit/vhdl/dictionary/test/tb_dictionary.vhd +++ b/vunit/vhdl/dictionary/test/tb_dictionary.vhd @@ -16,8 +16,7 @@ use std.textio.all; entity tb_dictionary is generic ( - runner_cfg : string; - output_path : string); + runner_cfg : string); end entity tb_dictionary; architecture test_fixture of tb_dictionary is @@ -25,7 +24,6 @@ begin test_runner : process variable value : line; - variable stat : checker_stat_t; variable passed : boolean; constant empty_dict : frozen_dictionary_t := empty; constant test_dict : frozen_dictionary_t := "output path : c::\foo\bar, input path : c::\ying\yang, active python runner : true"; diff --git a/vunit/vhdl/logging/src/log_handler_pkg-body.vhd b/vunit/vhdl/logging/src/log_handler_pkg-body.vhd index 5f1a68b0d..a8eb25499 100644 --- a/vunit/vhdl/logging/src/log_handler_pkg-body.vhd +++ b/vunit/vhdl/logging/src/log_handler_pkg-body.vhd @@ -28,15 +28,6 @@ package body log_handler_pkg is constant max_logger_name_idx : natural := 5; constant log_handler_length : natural := max_logger_name_idx + 1; - constant max_time_str : string := time'image(1 sec); - constant max_time_length : natural := max_time_str'length; - - procedure assert_status(status : file_open_status; file_name : string) is - begin - assert status = open_ok - report "Failed to open file " & file_name & " - " & file_open_status'image(status) severity failure; - end procedure; - procedure init_log_file(log_handler : log_handler_t; file_name : string) is variable file_id : file_id_t := to_file_id(get(log_handler.p_data, file_id_idx)); begin diff --git a/vunit/vhdl/logging/src/log_levels_pkg-body.vhd b/vunit/vhdl/logging/src/log_levels_pkg-body.vhd index c11ac5fb3..a70bea412 100644 --- a/vunit/vhdl/logging/src/log_levels_pkg-body.vhd +++ b/vunit/vhdl/logging/src/log_levels_pkg-body.vhd @@ -44,7 +44,6 @@ package body log_levels_pkg is impure function create_levels return levels_t is variable result : levels_t; - variable name_ptr : string_ptr_t; procedure add_level(log_level : log_level_t; fg, bg : ansi_color_t := no_color; style : ansi_style_t := normal) is begin diff --git a/vunit/vhdl/logging/src/logger_pkg-body.vhd b/vunit/vhdl/logging/src/logger_pkg-body.vhd index ca01a4f07..af9733e13 100644 --- a/vunit/vhdl/logging/src/logger_pkg-body.vhd +++ b/vunit/vhdl/logging/src/logger_pkg-body.vhd @@ -155,17 +155,6 @@ package body logger_pkg is return to_id(get(logger.p_data, id_idx)); end; - impure function new_logger(name : string; parent : logger_t) return logger_t is - constant parent_id : id_t := get_id(parent); - constant id : id_t := get_id(name, parent_id); - begin - if id = null_id then - return null_logger; - end if; - - return new_logger(id, parent); - end; - impure function get_real_parent(parent : logger_t) return logger_t is begin if parent = null_logger then diff --git a/vunit/vhdl/logging/src/print_pkg-body.vhd b/vunit/vhdl/logging/src/print_pkg-body.vhd index cc32e64f8..b6b1109ad 100644 --- a/vunit/vhdl/logging/src/print_pkg-body.vhd +++ b/vunit/vhdl/logging/src/print_pkg-body.vhd @@ -23,7 +23,6 @@ package body print_pkg is procedure print(str : string; file_name : string; mode : file_open_kind range write_mode to append_mode := append_mode) is - variable l : line; variable status : file_open_status; file f : text; begin diff --git a/vunit/vhdl/logging/test/tb_log.vhd b/vunit/vhdl/logging/test/tb_log.vhd index 0ac76262b..2ca58cde2 100644 --- a/vunit/vhdl/logging/test/tb_log.vhd +++ b/vunit/vhdl/logging/test/tb_log.vhd @@ -70,9 +70,6 @@ begin procedure check_log_file (file_handler : log_handler_t; file_name : string; entries : dict_t) is - file fptr : text; - variable l : line; - variable status : file_open_status; begin assert get_file_name(file_handler) = file_name report "file name mismatch"; flush_file_handler(file_handler); @@ -83,7 +80,6 @@ begin constant print_file_name : string := output_path(runner_cfg) & "print.csv"; variable logger : logger_t := get_logger("logger"); variable nested_logger : logger_t := get_logger("nested", parent => logger); - variable other_logger : logger_t := get_logger("other"); variable tmp_logger : logger_t; variable entries : dict_t := new_dict; variable entries2 : dict_t := new_dict; diff --git a/vunit/vhdl/run/src/run.vhd b/vunit/vhdl/run/src/run.vhd index b3ed6891f..8befd5fcc 100644 --- a/vunit/vhdl/run/src/run.vhd +++ b/vunit/vhdl/run/src/run.vhd @@ -142,7 +142,6 @@ package body run_pkg is impure function enabled( constant name : string) return boolean is - variable i : natural := 1; begin if get_run_all(runner_state) then return true; diff --git a/vunit/vhdl/run/test/run_tests.vhd b/vunit/vhdl/run/test/run_tests.vhd index 4a24c1910..54356ea50 100644 --- a/vunit/vhdl/run/test/run_tests.vhd +++ b/vunit/vhdl/run/test/run_tests.vhd @@ -194,15 +194,8 @@ begin variable i : natural; variable n_run_a, n_run_b, n_run_c : natural := 0; variable t_start : time; - constant test_checker : checker_t := new_checker("test_checker"); variable runner_cfg : line; variable passed : boolean; - variable level : log_level_t; - variable my_checker : checker_t; - variable error_counter : natural := 0; - constant test_runner_logger : logger_t := get_logger("test_runner"); - constant test_runner_setup_entry_key : key_t := get_entry_key(test_runner_setup); - constant test_runner_setup_exit_key : key_t := get_exit_key(test_runner_setup); constant test_case_setup_entry_key : key_t := get_entry_key(test_case_setup); constant test_case_setup_exit_key : key_t := get_exit_key(test_case_setup); diff --git a/vunit/vhdl/string_ops/test/tb_string_ops.vhd b/vunit/vhdl/string_ops/test/tb_string_ops.vhd index 9566f9b4a..2fed42451 100644 --- a/vunit/vhdl/string_ops/test/tb_string_ops.vhd +++ b/vunit/vhdl/string_ops/test/tb_string_ops.vhd @@ -65,7 +65,6 @@ begin variable ascending_vector : std_logic_vector(3 to 11); variable descending_vector : std_logic_vector(13 downto 5); variable l : lines_t; - variable n_asserts_value, n_errors_value : integer; constant offset_string :string(10 to 16) := "foo bar"; constant reverse_string :string(16 downto 10) := "foo bar"; constant reversed_vector :unsigned(16 downto 4) := "1011010101001"; diff --git a/vunit/vhdl/verification_components/src/wishbone_master.vhd b/vunit/vhdl/verification_components/src/wishbone_master.vhd index f345ba253..33cb0f5ec 100644 --- a/vunit/vhdl/verification_components/src/wishbone_master.vhd +++ b/vunit/vhdl/verification_components/src/wishbone_master.vhd @@ -41,10 +41,7 @@ entity wishbone_master is end entity; architecture a of wishbone_master is - constant rd_request_queue : queue_t := new_queue; - constant wr_request_queue : queue_t := new_queue; constant acknowledge_queue : queue_t := new_queue; - constant bus_ack_msg : msg_type_t := new_msg_type("wb master ack msg"); constant wb_master_ack_actor : actor_t := new_actor; signal start_cycle : std_logic := '0'; signal end_cycle : std_logic := '0'; @@ -109,10 +106,7 @@ begin end process; p_cycle : process - variable request_msg : msg_t; - variable ack_msg : msg_t; variable pending : natural := 0; - variable received_acks : natural := 0; begin cyc <= '0'; cycle <= false; @@ -139,7 +133,7 @@ begin end process; acknowledge : process - variable request_msg, reply_msg, ack_msg : msg_t; + variable request_msg, reply_msg : msg_t; begin wait until ack = '1' and rising_edge(clk); request_msg := pop(acknowledge_queue); diff --git a/vunit/vhdl/verification_components/test/tb_avalon_slave.vhd b/vunit/vhdl/verification_components/test/tb_avalon_slave.vhd index 9e8f7b2f4..7c8b361ea 100644 --- a/vunit/vhdl/verification_components/test/tb_avalon_slave.vhd +++ b/vunit/vhdl/verification_components/test/tb_avalon_slave.vhd @@ -58,7 +58,6 @@ architecture a of tb_avalon_slave is constant tb_logger : logger_t := get_logger("tb"); - signal wr_ack_cnt : natural range 0 to tb_cfg.num_cycles; signal rd_ack_cnt : natural range 0 to tb_cfg.num_cycles; constant memory : memory_t := new_memory; @@ -72,8 +71,6 @@ architecture a of tb_avalon_slave is begin main_stim : process - variable tmp : std_logic_vector(writedata'range); - variable value : std_logic_vector(writedata'range) := (others => '1'); begin test_runner_setup(runner, runner_cfg); set_format(display_handler, verbose, true); diff --git a/vunit/vhdl/verification_components/test/tb_wishbone_slave.vhd b/vunit/vhdl/verification_components/test/tb_wishbone_slave.vhd index 1c4f76f28..5f9fe8c74 100644 --- a/vunit/vhdl/verification_components/test/tb_wishbone_slave.vhd +++ b/vunit/vhdl/verification_components/test/tb_wishbone_slave.vhd @@ -69,8 +69,6 @@ architecture a of tb_wishbone_slave is begin main_stim : process - variable tmp : std_logic_vector(dat_i'range); - variable value : std_logic_vector(dat_i'range) := (others => '1'); begin test_runner_setup(runner, runner_cfg); set_format(display_handler, verbose, true);