├── .gitattributes ├── .github ├── images.sh ├── publish_site.sh ├── run.sh └── workflows │ ├── coverage.yml │ ├── docs.yml │ ├── images.yml │ └── push.yml ├── .gitignore ├── .gitmodules ├── LICENSE.rst ├── README.md ├── docs ├── .gitignore ├── _static │ ├── VUnit_banner.png │ ├── VUnit_diagram.png │ ├── VUnit_logo.png │ ├── vunit.drawio │ ├── vunit.ico │ └── vunit_demo.gif ├── about.rst ├── blog │ ├── 2015_09_24_short_introduction_to_vunit.rst │ ├── 2015_10_08_who_is_using_UVM.rst │ ├── 2015_12_15_free_and_open_source_verification_with_vunit_and_ghdl.rst │ ├── 2016_01_26_welcome_to_our_new_website.rst │ ├── 2016_01_29_chat_with_vunit_users_and_developers.rst │ ├── 2016_02_01_website_updates.rst │ ├── 2016_02_21_improving_vhdl_testbench_design_with_message_passing.rst │ ├── 2016_08_08_making_osvvm_a_submodule.rst │ ├── 2016_11_15_vunit_the_best_value_for_initial_effort_part1.rst │ ├── 2016_11_16_vunit_the_best_value_for_initial_effort_part2.rst │ ├── 2016_11_22_vunit_the_best_value_for_initial_effort_part3.rst │ ├── 2017_01_12_vunit_getting_started_1_2_3.rst │ ├── 2017_06_03_enable_your_simulator_to_handle_complex_top_level_generics.rst │ ├── 2017_09_28_sigasi_adds_support_for_vunit_testing_framework.rst │ ├── 2017_10_31_vunit_3_0_color_logging.rst │ ├── 2017_11_07_vunit_3_0_while_waiting_for_vhdl_2017.rst │ ├── 2017_11_23_vunit_matlab_integration.rst │ ├── 2017_12_14_vunit_bfms_as_simple_as_emailing.rst │ ├── 2018_02_12_vunit3.rst │ ├── 2018_03_22_vunit_community_developed_bfms.rst │ ├── 2018_07_22_sigasi_deepens_its_commitment_to_the_vunit_testing_framework.rst │ ├── 2018_09_22_sigasi_adds_full_vunit_support.rst │ ├── 2020_08_12_continuous_integration_with_vunit_action_in_10_lines_of_code.rst │ ├── 2022_09_06_vunit_and_other_frameworks.rst │ ├── 2022_09_19_vunit_user_conference.rst │ ├── 2023_03_31_vunit_events.rst │ ├── 2023_04_01_vunit_phases.rst │ ├── 2023_08_26_vhdl_configurations.rst │ ├── img │ │ ├── 4x.png │ │ ├── CPU_load.png │ │ ├── VUnit3.0.png │ │ ├── activity.png │ │ ├── bestvalue1.jpg │ │ ├── bestvalue2.jpg │ │ ├── bestvalue3.jpg │ │ ├── blogging_chat_room_documentation.png │ │ ├── caesar_encoder.png │ │ ├── color_logging.jpg │ │ ├── contributors.png │ │ ├── gha_flow.png │ │ ├── gha_top_image.png │ │ ├── log1.jpg │ │ ├── log2.jpg │ │ ├── log3.jpg │ │ ├── log4.jpg │ │ ├── log5.jpg │ │ ├── log_example.jpg │ │ ├── log_output.png │ │ ├── logging_hierarchy.png │ │ ├── low_throughput.png │ │ ├── matlab_figure.jpg │ │ ├── message_passing.png │ │ ├── message_passing_model.png │ │ ├── orange_man.jpeg │ │ ├── osvb.png │ │ ├── parallel_recipe.jpg │ │ ├── remote_caching_and_execution.png │ │ ├── repositories_providing_tests.png │ │ ├── sequential_recipe.jpg │ │ ├── sigasi_deep.png │ │ ├── sigasi_full.png │ │ ├── the_brain.jpg │ │ ├── third_interface.png │ │ ├── traffic_data.png │ │ ├── uvm.png │ │ ├── vhdl_configuration │ │ │ ├── create_vunit_configuration_for_selecting_dut.html │ │ │ ├── create_vunit_configuration_for_selecting_dut_and_runner_with_a_vhdl_configuration.html │ │ │ ├── create_vunit_configuration_for_selecting_dut_with_a_vhdl_configuration.html │ │ │ ├── selecting_dut_with_generics.html │ │ │ ├── selecting_dut_with_vhdl_configuration.html │ │ │ ├── tb_selecting_dut_with_generics_stdout.html │ │ │ ├── tb_selecting_dut_with_vhdl_configuration_stdout.html │ │ │ ├── tb_selecting_test_runner_with_vhdl_configuration_stdout.html │ │ │ ├── test_reset_architecture_of_test_runner.html │ │ │ ├── test_reset_configurations.html │ │ │ ├── test_runner_component_instantiation.html │ │ │ ├── test_runner_entity.html │ │ │ └── vhdl_configuration_on_a_test_case.html │ │ ├── vunit_co_simulation.png │ │ ├── vunit_emailing.jpg │ │ ├── vunit_faq.png │ │ ├── vunit_github_io.png │ │ ├── vunit_matlab.jpg │ │ ├── vunit_overview.drawio.png │ │ ├── vunit_phases │ │ │ ├── dut_checker_with_combined_if.html │ │ │ ├── dut_checker_with_combined_if_log.html │ │ │ ├── dut_checker_with_event.html │ │ │ ├── dut_checker_with_initial_unlock.html │ │ │ ├── dut_checker_with_initial_unlock_log.html │ │ │ ├── dut_checker_with_lock.html │ │ │ ├── dut_checker_with_lock_log.html │ │ │ ├── end_of_simulation_process.html │ │ │ ├── end_of_simulation_process_log.html │ │ │ ├── phases.html │ │ │ ├── phases_minimal.html │ │ │ ├── test_runner.html │ │ │ ├── test_runner_minimal.html │ │ │ └── test_runner_with_event.html │ │ ├── vunit_popularity.png │ │ ├── vunit_sigasistudio.jpg │ │ ├── vunit_view.png │ │ ├── vunit_waiting.jpg │ │ ├── vunit_wishbone.png │ │ └── world.png │ ├── index.rst │ └── src │ │ ├── vhdl_configuration │ │ ├── dff.vhd │ │ ├── run.py │ │ ├── tb_selecting_dut_with_generics.vhd │ │ ├── tb_selecting_dut_with_vhdl_configuration.vhd │ │ ├── tb_selecting_test_runner_with_vhdl_configuration.vhd │ │ ├── test_reset.vhd │ │ ├── test_runner.vhd │ │ └── test_state_change.vhd │ │ └── vunit_phases │ │ ├── phases_pkg.vhd │ │ ├── run.py │ │ ├── tb_phase_lock.vhd │ │ ├── tb_phases.vhd │ │ └── tb_phases_minimal.vhd ├── check │ ├── check_api.rst │ ├── checker_pkg.rst │ ├── images │ │ ├── check_next_passing.json │ │ ├── check_next_passing.png │ │ ├── check_next_passing_with_missing_start.json │ │ ├── check_next_passing_with_missing_start.png │ │ ├── check_next_passing_with_overlap.json │ │ ├── check_next_passing_with_overlap.png │ │ ├── check_sequence_first_no_pipe_passing.json │ │ ├── check_sequence_first_no_pipe_passing.png │ │ ├── check_sequence_first_pipe_failing.json │ │ ├── check_sequence_first_pipe_failing.png │ │ ├── check_sequence_first_pipe_passing.json │ │ ├── check_sequence_first_pipe_passing.png │ │ ├── check_sequence_penultimate_failing.json │ │ ├── check_sequence_penultimate_failing.png │ │ ├── check_sequence_penultimate_passing.json │ │ ├── check_sequence_penultimate_passing.png │ │ ├── check_stable_failing.json │ │ ├── check_stable_failing.png │ │ ├── check_stable_passing.json │ │ ├── check_stable_passing.png │ │ ├── check_true.json │ │ └── check_true.png │ └── user_guide.rst ├── ci │ ├── container.rst │ ├── intro.rst │ ├── manual.rst │ ├── script.rst │ └── usecases.rst ├── cli.rst ├── com │ └── user_guide.rst ├── conf.py ├── contributing.rst ├── create_release_notes.py ├── data_types │ ├── cosim.png │ ├── event_user_guide.rst │ ├── ext_integer_vector.rst │ ├── ext_string.rst │ ├── external_api.rst │ ├── img │ │ └── vunit_events │ │ │ ├── add_preprocessor.html │ │ │ ├── check_latency.html │ │ │ ├── core_dump.html │ │ │ ├── custom_logger.html │ │ │ ├── custom_message.html │ │ │ ├── decorated_message.html │ │ │ ├── done_event.html │ │ │ ├── dut_checker.html │ │ │ ├── dut_checker_logger.html │ │ │ ├── event_creation.html │ │ │ ├── is_active_msg.html │ │ │ ├── listening_to_vhdl_events.html │ │ │ ├── listening_to_vhdl_transactions.html │ │ │ ├── log_active.html │ │ │ ├── log_after_log_active.html │ │ │ ├── log_for_check_latency.html │ │ │ ├── log_for_check_latency_with_vunit_error.html │ │ │ ├── log_with_core_dump.html │ │ │ ├── log_with_custom_message.html │ │ │ ├── log_with_decorated_message.html │ │ │ ├── log_with_dut_checker_logger.html │ │ │ ├── n_samples_field.html │ │ │ ├── non_toggling_event_log.html │ │ │ ├── notify_if_fail.html │ │ │ ├── notify_with_boolean_event.html │ │ │ ├── notify_with_toggling_event.html │ │ │ ├── test_runner_process.html │ │ │ ├── timeout_due_to_bug.html │ │ │ ├── toggling_event_log.html │ │ │ ├── vunit_error.html │ │ │ ├── wait_done_event.html │ │ │ ├── wait_on_signal_event.html │ │ │ ├── wait_on_signal_transaction.html │ │ │ └── wait_statement_preprocessor.html │ ├── integer_array.rst │ ├── queue.rst │ ├── src │ │ └── vunit_events │ │ │ ├── event_pkg.vhd │ │ │ ├── incrementer.vhd │ │ │ ├── incrementer_pkg.vhd │ │ │ ├── run.py │ │ │ ├── tb_event.vhd │ │ │ └── tb_traditional.vhd │ └── user_guide.rst ├── examples.py ├── examples.rst ├── genindex.rst ├── hdl_libraries.rst ├── id │ ├── full_tree_log.html │ ├── get_tree.html │ ├── get_tree_log.html │ ├── has_id_log.html │ ├── id_from_attribute.html │ ├── id_from_parent.html │ ├── id_from_string.html │ ├── id_from_string_wo_colon.html │ ├── id_naming.html │ ├── id_naming_log.html │ ├── local_declarations.html │ ├── null_id.html │ ├── null_id_log.html │ ├── second_id_from_string.html │ ├── src │ │ ├── dut.vhd │ │ ├── run.py │ │ ├── tb_dut.vhd │ │ ├── tb_dut_local_declarations.vhd │ │ ├── tb_id.vhd │ │ ├── verification_component_x.vhd │ │ ├── verification_component_x_with_logger.vhd │ │ └── verification_component_y.vhd │ ├── tb_dut.html │ ├── tb_dut_local_declarations_log.html │ ├── tb_dut_log.html │ ├── traversing_log.html │ └── user_guide.rst ├── index.rst ├── installing.rst ├── logging │ ├── additional_subprograms.html │ ├── another_convenience_procedure.html │ ├── conditional_log.html │ ├── convenience_procedure.html │ ├── custom_log_level.html │ ├── disabled_log.html │ ├── fix_decimals_log.html │ ├── full_time_resolution_log.html │ ├── location_preprocessing.html │ ├── log_call.html │ ├── log_call_with_custom_level.html │ ├── log_call_with_logger.html │ ├── log_location_log.html │ ├── log_time_unit_log.html │ ├── log_visibility.html │ ├── logger_declaration.html │ ├── logger_from_id.html │ ├── mock_queue_length.html │ ├── mocking.html │ ├── print.html │ ├── print_to_open_file.html │ ├── set_debug_option.html │ ├── set_format.html │ ├── set_format_log.html │ ├── src │ │ ├── path │ │ │ └── to │ │ │ │ └── file │ │ ├── run.py │ │ └── tb_logging.vhd │ ├── standard_log_levels.html │ ├── stopping_simulation.html │ ├── use_external_log.html │ ├── user_guide.rst │ └── verbose_format_log.html ├── news.d │ └── .gitkeep ├── py │ ├── opts.rst │ ├── ui.rst │ └── vunit.rst ├── release_notes.rst ├── release_notes │ ├── 0.52.0.rst │ ├── 0.53.0.rst │ ├── 0.54.0.rst │ ├── 0.56.0.rst │ ├── 0.57.0.rst │ ├── 0.58.0.rst │ ├── 0.59.0.rst │ ├── 0.60.0.rst │ ├── 0.60.1.rst │ ├── 0.61.0.rst │ ├── 0.62.0.rst │ ├── 0.62.1.rst │ ├── 0.63.0.rst │ ├── 0.64.0.rst │ ├── 0.65.0.rst │ ├── 0.66.0.rst │ ├── 0.67.0.rst │ ├── 0.68.0.rst │ ├── 0.68.1.rst │ ├── 0.69.0.rst │ ├── 0.70.0.rst │ ├── 0.71.0.rst │ ├── 1.0.0.rst │ ├── 1.1.1.rst │ ├── 1.2.0.rst │ ├── 1.3.0.rst │ ├── 1.3.1.rst │ ├── 1.4.0.rst │ ├── 2.0.0.rst │ ├── 2.0.1.rst │ ├── 2.1.0.rst │ ├── 2.1.1.rst │ ├── 2.2.0.rst │ ├── 2.3.0.rst │ ├── 2.4.0.rst │ ├── 2.4.1.rst │ ├── 2.4.2.rst │ ├── 2.4.3.rst │ ├── 3.0.0.rst │ ├── 3.0.1.rst │ ├── 3.0.2.rst │ ├── 3.0.3.rst │ ├── 3.1.0.rst │ ├── 3.2.0.rst │ ├── 3.3.0.rst │ ├── 3.4.0.rst │ ├── 3.5.0.rst │ ├── 3.6.0.rst │ ├── 3.6.1.rst │ ├── 3.6.2.rst │ ├── 3.7.0.rst │ ├── 3.8.0.rst │ ├── 3.9.0.rst │ ├── 4.0.0.rst │ ├── 4.0.1.rst │ ├── 4.0.2.rst │ ├── 4.0.3.rst │ ├── 4.0.4.rst │ ├── 4.0.5.rst │ ├── 4.0.6.rst │ ├── 4.0.7.rst │ ├── 4.0.8.rst │ ├── 4.1.0.rst │ ├── 4.2.0.rst │ ├── 4.3.0.rst │ ├── 4.4.0.rst │ ├── 4.5.0.rst │ ├── 4.6.0.rst │ ├── 4.7.0.rst │ ├── 5.0.0.dev1.rst │ ├── 5.0.0.dev2.rst │ ├── 5.0.0.dev3.rst │ ├── 5.0.0.dev4.rst │ ├── 5.0.0.dev5.rst │ └── 5.0.0.dev6.rst ├── run │ ├── img │ │ ├── get_seed_and_runner_cfg.html │ │ ├── get_seed_wo_runner_cfg.html │ │ ├── get_uniform_seed.html │ │ ├── list.html │ │ ├── seed_option.html │ │ ├── tb_fail_on_warning.html │ │ ├── tb_magic_paths.html │ │ ├── tb_magic_paths_stdout.html │ │ ├── tb_minimal.html │ │ ├── tb_minimal_stdout.html │ │ ├── tb_minimal_tb_running_test_case_tb_with_lower_level_control_stdout.html │ │ ├── tb_minimal_tb_with_test_cases_stdout.html │ │ ├── tb_run_all_in_same_sim.html │ │ ├── tb_running_test_case.html │ │ ├── tb_running_test_case_stdout.html │ │ ├── tb_seed_stdout.html │ │ ├── tb_standalone.html │ │ ├── tb_stop_level.html │ │ ├── tb_stop_level_stdout.html │ │ ├── tb_stopping_failure.html │ │ ├── tb_stopping_failure_stdout.html │ │ ├── tb_with_lower_level_control.html │ │ ├── tb_with_lower_level_control_stdout.html │ │ ├── tb_with_test_cases_stdout.html │ │ ├── tb_with_watchdog.html │ │ ├── tb_with_watchdog_stdout.html │ │ ├── test_control.html │ │ └── test_runner_with_test_cases.html │ ├── src │ │ ├── run.py │ │ ├── tb_fail_on_warning.vhd │ │ ├── tb_magic_paths.vhd │ │ ├── tb_minimal.vhd │ │ ├── tb_run_all_in_same_sim.vhd │ │ ├── tb_running_test_case.vhd │ │ ├── tb_seed.vhd │ │ ├── tb_standalone.vhd │ │ ├── tb_stop_level.vhd │ │ ├── tb_stopping_failure.vhd │ │ ├── tb_with_lower_level_control.vhd │ │ ├── tb_with_test_cases.vhd │ │ ├── tb_with_watchdog.vhd │ │ └── test_control.vhd │ └── user_guide.rst ├── testimonials │ ├── airhdl.png │ ├── autoliv.png │ ├── ci_csn_khai_edu.png │ ├── effective_coding.png │ ├── pluralsight.png │ ├── sigasi.png │ ├── synective_labs.png │ ├── testimonials.rst │ └── vhdl-2017.png ├── user_guide.rst └── verification_components │ ├── memory_model.rst │ ├── user_guide.rst │ └── vci.rst ├── examples ├── verilog │ ├── uart │ │ ├── run.py │ │ └── src │ │ │ ├── test │ │ │ ├── tb_uart_rx.sv │ │ │ └── tb_uart_tx.sv │ │ │ ├── uart_rx.sv │ │ │ └── uart_tx.sv │ ├── user_guide │ │ ├── run.py │ │ ├── tb_example.sv │ │ └── tb_example_basic.sv │ └── verilog_ams │ │ ├── dut.vams │ │ ├── run.py │ │ └── tb_dut.sv └── vhdl │ ├── array │ ├── run.py │ └── src │ │ ├── sobel_x.vhd │ │ └── test │ │ ├── input.csv │ │ ├── output.csv │ │ └── tb_sobel_x.vhd │ ├── array_axis_vcs │ ├── run.py │ ├── runall_addwave.do │ └── src │ │ ├── axis_buffer.vhd │ │ ├── fifo.vhd │ │ └── test │ │ ├── data │ │ └── in.csv │ │ ├── tb_axis_loop.vhd │ │ └── vc_axis.vhd │ ├── axi_dma │ ├── run.py │ └── src │ │ ├── axi_burst_gen.vhd │ │ ├── axi_dma.vhd │ │ ├── axi_dma_regs.vhd │ │ ├── axi_dma_regs_pkg.vhd │ │ ├── axi_pkg.vhd │ │ ├── axil_pkg.vhd │ │ ├── test │ │ ├── tb_axi_dma.vhd │ │ ├── tb_axi_dma_regs.vhd │ │ └── tb_util_pkg.vhd │ │ └── util_pkg.vhd │ ├── check │ ├── run.py │ └── tb_example.vhd │ ├── com │ ├── run.py │ ├── src │ │ └── adder.vhd │ └── test │ │ ├── memory_bfm.vhd │ │ ├── memory_bfm_pkg.vhd │ │ └── tb_user_guide.vhd │ ├── composite_generics │ ├── run.py │ └── test │ │ └── tb_composite_generics.vhd │ ├── coverage │ ├── run.py │ └── tb_coverage.vhd │ ├── data_types │ └── tb_dict_transactions.vhd │ ├── docker_runall.sh │ ├── generate_tests │ ├── run.py │ └── test │ │ └── tb_generated.vhd │ ├── json4vhdl │ ├── run.py │ └── src │ │ └── test │ │ ├── data │ │ └── data.json │ │ └── tb_json_gens.vhd │ ├── logging │ ├── run.py │ └── tb_logging_example.vhd │ ├── osvvm_log_integration │ ├── osvvm_integration │ │ ├── AlertLogPkg.vhd │ │ ├── osvvm_to_vunit_common_log_pkg-body.vhd │ │ ├── osvvm_to_vunit_common_log_pkg.vhd │ │ └── vunit_to_osvvm_common_log_pkg-body.vhd │ ├── run.py │ └── tb_example.vhd │ ├── run │ ├── run.py │ ├── tb_counting_errors.vhd │ ├── tb_magic_paths.vhd │ ├── tb_many_ways_to_fail.vhd │ ├── tb_minimal.vhd │ ├── tb_running_test_case.vhd │ ├── tb_standalone.vhd │ ├── tb_with_lower_level_control.vhd │ ├── tb_with_test_cases.vhd │ ├── tb_with_watchdog.vhd │ └── test_control.vhd │ ├── third_party_integration │ ├── run.py │ └── test │ │ └── tb_external_framework_integration.vhd │ ├── uart │ ├── run.py │ └── src │ │ ├── test │ │ ├── tb_uart_rx.vhd │ │ └── tb_uart_tx.vhd │ │ ├── uart_rx.vhd │ │ └── uart_tx.vhd │ ├── user_guide │ ├── run.py │ ├── tb_example.vhd │ ├── tb_example_many.vhd │ └── vhdl1993 │ │ ├── run.py │ │ ├── tb_example.vhd │ │ └── tb_example_many.vhd │ ├── vhdl_configuration │ ├── dff.vhd │ ├── run.py │ ├── tb_selecting_dut_with_vhdl_configuration.vhd │ ├── tb_selecting_test_runner_with_vhdl_configuration.vhd │ ├── test_reset.vhd │ ├── test_reset_behavioral.vhd │ ├── test_reset_rtl.vhd │ ├── test_runner.vhd │ ├── test_state_change.vhd │ ├── test_state_change_behavioral.vhd │ └── test_state_change_rtl.vhd │ └── vivado │ ├── generate_vivado_project.py │ ├── readme.md │ ├── run.py │ ├── src │ ├── test │ │ └── tb_top.vhd │ └── top.vhd │ ├── tcl │ ├── compile_standard_libs.tcl │ └── generate_project.tcl │ └── vivado_util.py ├── logo ├── banners.svg └── vunit.svg ├── pyproject.toml ├── requirements.txt ├── setup.py ├── tests ├── __init__.py ├── acceptance │ ├── __init__.py │ ├── artificial │ │ ├── verilog │ │ │ ├── other_file_tests.sv │ │ │ ├── run.py │ │ │ ├── tb_fail_on_fatal_and_early_finish.sv │ │ │ ├── tb_fail_on_warning.sv │ │ │ ├── tb_fail_on_warning_from_python.sv │ │ │ ├── tb_magic_paths.sv │ │ │ ├── tb_other_file_tests.sv │ │ │ ├── tb_same_sim_all_pass.sv │ │ │ ├── tb_same_sim_from_python_all_pass.sv │ │ │ ├── tb_same_sim_from_python_some_fail.sv │ │ │ ├── tb_same_sim_some_fail.sv │ │ │ ├── tb_with_define.sv │ │ │ ├── tb_with_parameter_config.sv │ │ │ └── tb_with_runner.sv │ │ └── vhdl │ │ │ ├── bool_driver.vhd │ │ │ ├── cfg1.vhd │ │ │ ├── cfg2.vhd │ │ │ ├── cfg3.vhd │ │ │ ├── ent.vhd │ │ │ ├── ent_arch1.vhd │ │ │ ├── ent_arch2.vhd │ │ │ ├── ent_arch3.vhd │ │ │ ├── other_file_tests.vhd │ │ │ ├── reference_test_history │ │ │ ├── 0 │ │ │ └── 1 │ │ │ ├── run.py │ │ │ ├── tb_assert_stop_level.vhd │ │ │ ├── tb_elab_fail.vhd │ │ │ ├── tb_fail.vhd │ │ │ ├── tb_fail_on_warning.vhd │ │ │ ├── tb_fail_on_warning_from_python.vhd │ │ │ ├── tb_ieee_warning.vhd │ │ │ ├── tb_infinite_events.vhd │ │ │ ├── tb_magic_paths.vhd │ │ │ ├── tb_no_fail_after_cleanup.vhd │ │ │ ├── tb_no_fail_on_warning.vhd │ │ │ ├── tb_no_generic_override.vhd │ │ │ ├── tb_other_file_tests.vhd │ │ │ ├── tb_pass.vhd │ │ │ ├── tb_same_sim_all_pass.vhd │ │ │ ├── tb_same_sim_from_python_all_pass.vhd │ │ │ ├── tb_same_sim_from_python_some_fail.vhd │ │ │ ├── tb_same_sim_some_fail.vhd │ │ │ ├── tb_seed.vhd │ │ │ ├── tb_set_generic.vhd │ │ │ ├── tb_test_prio_1.vhd │ │ │ ├── tb_test_prio_2.vhd │ │ │ ├── tb_with_checks.vhd │ │ │ ├── tb_with_generic_config.vhd │ │ │ ├── tb_with_vhdl_configuration.vhd │ │ │ └── tb_with_vhdl_runner.vhd │ ├── dependencies │ │ ├── pkg.vhd │ │ ├── pkg_body1.vhd │ │ ├── pkg_body2.vhd │ │ └── tb_pkg.vhd │ ├── test_artificial.py │ ├── test_dependencies.py │ └── test_external_run_scripts.py ├── common.py ├── lint │ ├── __init__.py │ ├── pylintrc │ ├── test_license.py │ ├── test_mypy.py │ ├── test_pycodestyle.py │ └── test_pylint.py └── unit │ ├── __init__.py │ ├── non_utf8_printer.py │ ├── test_activehdl_interface.py │ ├── test_builtins.py │ ├── test_cds_file.py │ ├── test_check_preprocessor.py │ ├── test_configuration.py │ ├── test_csv_logs.py │ ├── test_database.py │ ├── test_dependency_graph.py │ ├── test_ghdl_interface.py │ ├── test_incisive_interface.py │ ├── test_location_preprocessor.py │ ├── test_modelsim_interface.py │ ├── test_ostools.py │ ├── test_project.py │ ├── test_rivierapro_interface.py │ ├── test_simulator_interface.py │ ├── test_test_bench.py │ ├── test_test_bench_list.py │ ├── test_test_report.py │ ├── test_test_runner.py │ ├── test_test_scheduler.py │ ├── test_test_suites.py │ ├── test_tokenizer.py │ ├── test_ui.py │ ├── test_verilog_parser.py │ ├── test_verilog_preprocessor.py │ ├── test_verilog_tokenizer.py │ ├── test_vhdl_parser.py │ └── test_vhdl_standard.py ├── tools ├── build_docs.py ├── doc_support.py ├── incisive_vhdl_fixup.py └── release.py └── vunit ├── __init__.py ├── about.py ├── builtins.py ├── cached.py ├── check_preprocessor.py ├── color_printer.py ├── com ├── __init__.py ├── codec_datatype_template.py ├── codec_generator.py ├── codec_vhdl_array_type.py ├── codec_vhdl_enumeration_type.py ├── codec_vhdl_package.py └── codec_vhdl_record_type.py ├── configuration.py ├── csv_logs.py ├── database.py ├── dependency_graph.py ├── design_unit.py ├── exceptions.py ├── hashing.py ├── json4vhdl.py ├── library.py ├── location_preprocessor.py ├── ostools.py ├── parsing ├── __init__.py ├── encodings.py ├── tokenizer.py └── verilog │ ├── __init__.py │ ├── parser.py │ ├── preprocess.py │ ├── tokenizer.py │ └── tokens.py ├── persistent_tcl_shell.py ├── project.py ├── py.typed ├── sim_if ├── __init__.py ├── _viewermixin.py ├── activehdl.py ├── cds_file.py ├── common.py ├── factory.py ├── ghdl.py ├── incisive.py ├── modelsim.py ├── nvc.py ├── rivierapro.py ├── tcl_read_eval_loop.tcl └── vsim_simulator_mixin.py ├── source_file.py ├── test ├── __init__.py ├── bench.py ├── bench_list.py ├── list.py ├── report.py ├── runner.py ├── suites.py └── unit │ └── test_report_output.txt ├── ui ├── __init__.py ├── common.py ├── library.py ├── packagefacade.py ├── preprocessor.py ├── results.py ├── source.py ├── test.py └── testbench.py ├── verilog ├── check │ ├── run.py │ └── test │ │ └── check_tb.sv ├── include │ └── vunit_defines.svh └── vunit_pkg.sv ├── version_check.py ├── vhdl ├── check │ ├── run.py │ ├── src │ │ ├── check-2008p.vhd │ │ ├── check.vhd │ │ ├── check_api-2008p.vhd │ │ ├── check_api.vhd │ │ ├── checker_pkg-body.vhd │ │ └── checker_pkg.vhd │ ├── test │ │ ├── tb_check.vhd │ │ ├── tb_check_equal-2008p.vhd │ │ ├── tb_check_equal_real.vhd │ │ ├── tb_check_failed.vhd │ │ ├── tb_check_false.vhd │ │ ├── tb_check_implication.vhd │ │ ├── tb_check_next.vhd │ │ ├── tb_check_not_unknown.vhd │ │ ├── tb_check_one_hot.vhd │ │ ├── tb_check_passed.vhd │ │ ├── tb_check_relation.vhd │ │ ├── tb_check_relation_2008p.vhd │ │ ├── tb_check_sequence.vhd │ │ ├── tb_check_stable.vhd │ │ ├── tb_check_zero_one_hot.vhd │ │ ├── tb_checker.vhd │ │ ├── tb_result.vhd │ │ └── test_support.vhd │ └── tools │ │ ├── generate_check_equal.py │ │ ├── generate_check_equal_2008p.py │ │ └── generate_check_match.py ├── com │ ├── run.py │ ├── src │ │ ├── com.vhd │ │ ├── com_api.vhd │ │ ├── com_common.vhd │ │ ├── com_context.vhd │ │ ├── com_debug_codec_builder.vhd │ │ ├── com_deprecated.vhd │ │ ├── com_messenger.vhd │ │ ├── com_string.vhd │ │ ├── com_support.vhd │ │ └── com_types.vhd │ └── test │ │ ├── constants.vhd │ │ ├── custom_types.vhd │ │ ├── more_constants.vhd │ │ ├── tb_com.vhd │ │ ├── tb_com_codec.vhd │ │ ├── tb_com_deprecated.vhd │ │ └── tb_com_msg_building.vhd ├── compile_vunit_lib.py ├── core │ └── src │ │ ├── core_pkg.vhd │ │ ├── stop_body_2008p.vhd │ │ ├── stop_body_93-2002.vhd │ │ └── stop_pkg.vhd ├── data_types │ ├── run.py │ ├── src │ │ ├── api │ │ │ ├── external_integer_vector_pkg.vhd │ │ │ └── external_string_pkg.vhd │ │ ├── byte_vector_ptr_pkg.vhd │ │ ├── codec-2008p.vhd │ │ ├── codec.vhd │ │ ├── codec_builder-2008p.vhd │ │ ├── codec_builder.vhd │ │ ├── data_types_context.vhd │ │ ├── data_types_private_pkg.vhd │ │ ├── dict_pkg-2008p.vhd │ │ ├── dict_pkg-body.vhd │ │ ├── dict_pkg.vhd │ │ ├── event_common_pkg.vhd │ │ ├── event_pkg.vhd │ │ ├── event_private_pkg.vhd │ │ ├── id_pkg.vhd │ │ ├── integer_array_pkg-body.vhd │ │ ├── integer_array_pkg.vhd │ │ ├── integer_vector_ptr_pkg-body-2002p.vhd │ │ ├── integer_vector_ptr_pkg-body-93.vhd │ │ ├── integer_vector_ptr_pkg.vhd │ │ ├── integer_vector_ptr_pool_pkg.vhd │ │ ├── queue_pkg-2008p.vhd │ │ ├── queue_pkg-body.vhd │ │ ├── queue_pkg.vhd │ │ ├── queue_pool_pkg.vhd │ │ ├── string_ptr_pkg-body-2002p.vhd │ │ ├── string_ptr_pkg-body-93.vhd │ │ ├── string_ptr_pkg.vhd │ │ ├── string_ptr_pool_pkg.vhd │ │ └── types.vhd │ ├── test │ │ ├── tb_byte_vector_ptr.vhd │ │ ├── tb_codec-2008p.vhd │ │ ├── tb_codec.vhd │ │ ├── tb_dict-2008p.vhd │ │ ├── tb_dict.vhd │ │ ├── tb_event_pkg.vhd │ │ ├── tb_event_private_pkg.vhd │ │ ├── tb_id.vhd │ │ ├── tb_integer_array.vhd │ │ ├── tb_integer_vector_ptr.vhd │ │ ├── tb_integer_vector_ptr_pool.vhd │ │ ├── tb_queue-2008p.vhd │ │ ├── tb_queue.vhd │ │ ├── tb_queue_pool.vhd │ │ ├── tb_string_ptr.vhd │ │ └── tb_string_ptr_pool.vhd │ └── tools │ │ └── generate_dict.py ├── dictionary │ ├── run.py │ ├── src │ │ └── dictionary.vhd │ └── test │ │ └── tb_dictionary.vhd ├── logging │ ├── run.py │ ├── src │ │ ├── ansi_pkg.vhd │ │ ├── common_log_pkg-body.vhd │ │ ├── common_log_pkg.vhd │ │ ├── file_pkg.vhd │ │ ├── location_pkg-body-2008m.vhd │ │ ├── location_pkg-body-2019p.vhd │ │ ├── location_pkg.vhd │ │ ├── log_handler_pkg-body.vhd │ │ ├── log_handler_pkg.vhd │ │ ├── log_levels_pkg-body.vhd │ │ ├── log_levels_pkg.vhd │ │ ├── logger_pkg-body.vhd │ │ ├── logger_pkg.vhd │ │ ├── print_pkg-body.vhd │ │ └── print_pkg.vhd │ └── test │ │ ├── tb_location.vhd │ │ ├── tb_log.vhd │ │ ├── tb_log_levels.vhd │ │ ├── tb_sim_time_formatting.vhd │ │ └── test_support_pkg.vhd ├── path │ ├── run.py │ ├── src │ │ └── path.vhd │ └── test │ │ └── tb_path.vhd ├── random │ ├── run.py │ ├── src │ │ └── random_pkg.vhd │ └── test │ │ └── tb_random_pkg.vhd ├── run │ ├── run.py │ ├── src │ │ ├── run.vhd │ │ ├── run_api.vhd │ │ ├── run_types.vhd │ │ └── runner_pkg.vhd │ └── test │ │ ├── run_tests.vhd │ │ ├── tb_run.vhd │ │ └── tb_watchdog.vhd ├── string_ops │ ├── run.py │ ├── src │ │ └── string_ops.vhd │ └── test │ │ └── tb_string_ops.vhd ├── verification_components │ ├── run.py │ ├── src │ │ ├── avalon_master.vhd │ │ ├── avalon_pkg.vhd │ │ ├── avalon_sink.vhd │ │ ├── avalon_slave.vhd │ │ ├── avalon_source.vhd │ │ ├── avalon_stream_pkg.vhd │ │ ├── axi_lite_master.vhd │ │ ├── axi_lite_master_pkg.vhd │ │ ├── axi_pkg.vhd │ │ ├── axi_read_slave.vhd │ │ ├── axi_slave_pkg.vhd │ │ ├── axi_slave_private_pkg.vhd │ │ ├── axi_statistics_pkg.vhd │ │ ├── axi_stream_master.vhd │ │ ├── axi_stream_monitor.vhd │ │ ├── axi_stream_pkg.vhd │ │ ├── axi_stream_private_pkg.vhd │ │ ├── axi_stream_protocol_checker.vhd │ │ ├── axi_stream_slave.vhd │ │ ├── axi_write_slave.vhd │ │ ├── bus2memory.vhd │ │ ├── bus_master_pkg-body.vhd │ │ ├── bus_master_pkg.vhd │ │ ├── memory_pkg-body.vhd │ │ ├── memory_pkg.vhd │ │ ├── memory_utils_pkg.vhd │ │ ├── ram_master.vhd │ │ ├── signal_checker_pkg.vhd │ │ ├── std_logic_checker.vhd │ │ ├── stream_master_pkg-body.vhd │ │ ├── stream_master_pkg.vhd │ │ ├── stream_slave_pkg-body.vhd │ │ ├── stream_slave_pkg.vhd │ │ ├── sync_pkg-body.vhd │ │ ├── sync_pkg.vhd │ │ ├── uart_master.vhd │ │ ├── uart_pkg.vhd │ │ ├── uart_slave.vhd │ │ ├── vc_context.vhd │ │ ├── vc_pkg.vhd │ │ ├── wishbone_master.vhd │ │ ├── wishbone_pkg.vhd │ │ └── wishbone_slave.vhd │ └── test │ │ ├── tb_avalon.vhd │ │ ├── tb_avalon_master.gtkw │ │ ├── tb_avalon_master.vhd │ │ ├── tb_avalon_slave.gtkw │ │ ├── tb_avalon_slave.vhd │ │ ├── tb_avalon_stream.gtkw │ │ ├── tb_avalon_stream.vhd │ │ ├── tb_avalon_stream_pkg.vhd │ │ ├── tb_axi_lite_master.vhd │ │ ├── tb_axi_read_slave.vhd │ │ ├── tb_axi_slave_private_pkg.vhd │ │ ├── tb_axi_statistics_pkg.vhd │ │ ├── tb_axi_stream.vhd │ │ ├── tb_axi_stream_protocol_checker.vhd │ │ ├── tb_axi_write_slave.vhd │ │ ├── tb_bus_master_pkg.vhd │ │ ├── tb_memory.vhd │ │ ├── tb_memory_utils_pkg.vhd │ │ ├── tb_ram_master.vhd │ │ ├── tb_std_logic_checker.vhd │ │ ├── tb_sync_pkg.vhd │ │ ├── tb_uart.vhd │ │ ├── tb_vc_pkg.vhd │ │ ├── tb_wishbone_master.gtkw │ │ ├── tb_wishbone_master.vhd │ │ ├── tb_wishbone_slave.gtkw │ │ └── tb_wishbone_slave.vhd ├── vunit_context.vhd └── vunit_run_context.vhd ├── vhdl_parser.py ├── vhdl_standard.py ├── vivado ├── __init__.py ├── tcl │ └── extract_compile_order.tcl └── vivado.py └── vunit_cli.py /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto 2 | 3 | *.css text 4 | *.csv text 5 | *.do text 6 | *.gitattributes text 7 | *.gitignore text 8 | *.gitmodules text 9 | *.gtkw text 10 | *.html text 11 | *.ini text 12 | *.json text 13 | *.md text 14 | *.py text 15 | *.rst text 16 | *.sh text 17 | *.sv text 18 | *.svg text 19 | *.svh text 20 | *.tcl text 21 | *.txt text 22 | *.vams text 23 | *.vhd text 24 | *.yml text 25 | 26 | *.gif binary 27 | *.ico binary 28 | *.jpeg binary 29 | *.png binary 30 | -------------------------------------------------------------------------------- /.github/images.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Stop in case of error 4 | set -e 5 | 6 | docker build \ 7 | --build-arg IMAGE="python:3-slim-bullseye" \ 8 | --build-arg LLVM_VER=9 \ 9 | --build-arg GNAT_VER=9 \ 10 | --target vunit \ 11 | -t "vunit/dev/${TAG}" \ 12 | - <<-EOF 13 | $(curl -fsSL https://raw.githubusercontent.com/ghdl/docker/master/run_debian.dockerfile) 14 | 15 | FROM $TAG AS vunit 16 | COPY --from=ghdl/pkg:bullseye-$PKG / / 17 | RUN pip install -U tox colorama coverage --progress-bar off 18 | EOF 19 | -------------------------------------------------------------------------------- /.github/publish_site.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | # 3 | # Usage: publish_site.sh [github.repository] 4 | # If the repository is 'VUnit/vunit', GH_DEPKEY is required. 5 | # Otherwise, the default token is used. 6 | 7 | set -e 8 | 9 | [ "x$1" = 'xVUnit/vunit' ] && isVUnit=1 || unset isVUnit 10 | 11 | echo "isVUnit: $isVUnit" 12 | 13 | cd $(dirname "$0")/../.tox/py313-docs/tmp/docsbuild/ 14 | touch .nojekyll 15 | git init 16 | 17 | if [ -z "${isVUnit+x}" ]; then 18 | cp ../../../../.git/config ./.git/config 19 | fi 20 | 21 | git add . 22 | git config --local user.email "Pages@GitHubActions" 23 | git config --local user.name "GitHub Actions" 24 | git commit -a -m "update $GITHUB_SHA" 25 | 26 | if [ -z "${isVUnit+x}" ]; then 27 | git push -u origin +HEAD:gh-pages 28 | fi 29 | 30 | if [ -n "${isVUnit+x}" ]; then 31 | git remote add origin git@github.com:VUnit/VUnit.github.io 32 | eval `ssh-agent -t 60 -s` 33 | echo "$GH_DEPKEY" | ssh-add - 34 | mkdir -p ~/.ssh/ 35 | ssh-keyscan github.com >> ~/.ssh/known_hosts 36 | git push -u origin +master 37 | ssh-agent -k 38 | fi 39 | -------------------------------------------------------------------------------- /.github/run.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | docker run --rm -t \ 4 | -v $(pwd):/src \ 5 | -w /src \ 6 | -e PYTHONPATH=/src \ 7 | ghcr.io/vunit/dev/llvm \ 8 | "$@" 9 | -------------------------------------------------------------------------------- /.github/workflows/coverage.yml: -------------------------------------------------------------------------------- 1 | name: 'coverage' 2 | 3 | on: 4 | push: 5 | workflow_dispatch: 6 | schedule: 7 | - cron: '0 0 * * 5' 8 | 9 | jobs: 10 | 11 | coverage: 12 | runs-on: ubuntu-latest 13 | steps: 14 | 15 | - uses: actions/checkout@v4 16 | with: 17 | submodules: recursive 18 | 19 | - uses: actions/setup-python@v5 20 | with: 21 | python-version: '3.13' 22 | 23 | - name: Run coverage 24 | run: | 25 | ./.github/run.sh tox -e coverage 26 | ./.github/run.sh coverage html --directory=htmlcov 27 | 28 | - name: Report coverage 29 | run: ./.github/run.sh coverage report -m --skip-covered 30 | 31 | - uses: actions/upload-artifact@v4 32 | with: 33 | name: VUnit_coverage 34 | path: htmlcov 35 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | **/vunit_out 2 | *.pyc 3 | *.bak 4 | *.o 5 | *.so 6 | *.egg-info 7 | .devcontainer 8 | .tox 9 | .vscode 10 | env/ 11 | venv/ 12 | error.csv 13 | log.csv 14 | my_logger.csv 15 | /build/ 16 | /dist/ 17 | /examples/vhdl/array_axis_vcs/src/test/data/out.csv 18 | /tests/acceptance/*_out 19 | /tests/unit/test_report_output.txt 20 | /vunit/vhdl/check/test/tb_check_equal.vhd 21 | /vunit/vhdl/check/test/tb_check_match.vhd 22 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "vunit/vhdl/osvvm"] 2 | path = vunit/vhdl/osvvm 3 | url = ../../OSVVM/OSVVM.git 4 | [submodule "vunit/vhdl/JSON-for-VHDL"] 5 | path = vunit/vhdl/JSON-for-VHDL 6 | url = ../../Paebbels/JSON-for-VHDL.git 7 | -------------------------------------------------------------------------------- /docs/.gitignore: -------------------------------------------------------------------------------- 1 | /_build/ 2 | /*.inc 3 | /license.rst 4 | -------------------------------------------------------------------------------- /docs/_static/VUnit_banner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VUnit/vunit/4e30fa124ea84609af0f957dbc55b82adaed1d76/docs/_static/VUnit_banner.png -------------------------------------------------------------------------------- /docs/_static/VUnit_diagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VUnit/vunit/4e30fa124ea84609af0f957dbc55b82adaed1d76/docs/_static/VUnit_diagram.png -------------------------------------------------------------------------------- /docs/_static/VUnit_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VUnit/vunit/4e30fa124ea84609af0f957dbc55b82adaed1d76/docs/_static/VUnit_logo.png -------------------------------------------------------------------------------- /docs/_static/vunit.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VUnit/vunit/4e30fa124ea84609af0f957dbc55b82adaed1d76/docs/_static/vunit.ico -------------------------------------------------------------------------------- /docs/_static/vunit_demo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VUnit/vunit/4e30fa124ea84609af0f957dbc55b82adaed1d76/docs/_static/vunit_demo.gif -------------------------------------------------------------------------------- /docs/blog/2016_01_29_chat_with_vunit_users_and_developers.rst: -------------------------------------------------------------------------------- 1 | :tags: VUnit 2 | :author: lasplund 3 | :excerpt: 1 4 | 5 | Chat with VUnit Users and Developers 6 | ==================================== 7 | Today I created a VUnit chat room using Gitter. Click the chat icon on 8 | the left of the page to join the discussion. 9 | 10 | Lars 11 | -------------------------------------------------------------------------------- /docs/blog/2016_02_01_website_updates.rst: -------------------------------------------------------------------------------- 1 | :tags: VUnit 2 | :author: lasplund 3 | :excerpt: 2 4 | 5 | .. _vunit_website_updates: 6 | 7 | 8 | Website Updates 9 | =============== 10 | 11 | .. figure:: img/blogging_chat_room_documentation.png 12 | 13 | Our website has been updated with a 14 | `Gitter `__-based 15 | `chat `__ and an improved 16 | `documentation `__ platform 17 | based on `Sphinx `__. When 18 | changing to Sphinx it came natural to also switch the blogging platform 19 | to `ABlog `__ which is based on Sphinx. 20 | 21 | The chat has just been active for a few days but it's already very 22 | active. Currently it's used to port VUnit to Cadence Incisive. We don't 23 | have such licenses but the chat has been used to support the porting 24 | work done by people that do. FOSS collaboration at its best! 25 | -------------------------------------------------------------------------------- /docs/blog/2017_01_12_vunit_getting_started_1_2_3.rst: -------------------------------------------------------------------------------- 1 | :tags: VUnit 2 | :author: lasplund 3 | :excerpt: 1 4 | 5 | VUnit - Getting Started 1-2-3 6 | ============================= 7 | 8 | I recently started a LinkedIn blog series about getting started with VUnit. The 9 | first three parts are: 10 | 11 | 1. `Installing VUnit in 1 minute `__ 12 | 2. `Compiling your project in 1 minute `__ 13 | 3. `Automating your testbenches with 5 lines of code `__ 14 | 15 | Three more blogs are planned. They will cover: 16 | 17 | 4. Improve testbench speed and quality with test cases 18 | 5. Daily work with VUnit 19 | 6. Testbench configurations 20 | -------------------------------------------------------------------------------- /docs/blog/2023_03_31_vunit_events.rst: -------------------------------------------------------------------------------- 1 | :tags: VUnit 2 | :author: lasplund 3 | :excerpt: 1 4 | 5 | VUnit Events 6 | ============ 7 | 8 | What You Will Learn 9 | ------------------- 10 | 11 | 1. An improved method for synchronizing various components of your testbench. 12 | 2. Techniques to ensure your testbench does not terminate prematurely, before the DUT has been fully verified. 13 | 3. Ways to quickly identify where the testbench is stuck on timeout or other errors. 14 | 4. A method for generating a system "core dump" for easier debugging when errors are detected. 15 | 16 | Introduction 17 | ------------ 18 | 19 | .. include:: ../data_types/event_user_guide.rst 20 | :start-after: ------------ 21 | :end-before: Fortunately VUnit provides such a solution 22 | 23 | Fortunately VUnit provides such a solution. It's called VUnit phases and it will be the topic for the next blog. 24 | 25 | -------------------------------------------------------------------------------- /docs/blog/img/4x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VUnit/vunit/4e30fa124ea84609af0f957dbc55b82adaed1d76/docs/blog/img/4x.png -------------------------------------------------------------------------------- /docs/blog/img/CPU_load.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VUnit/vunit/4e30fa124ea84609af0f957dbc55b82adaed1d76/docs/blog/img/CPU_load.png -------------------------------------------------------------------------------- /docs/blog/img/VUnit3.0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VUnit/vunit/4e30fa124ea84609af0f957dbc55b82adaed1d76/docs/blog/img/VUnit3.0.png -------------------------------------------------------------------------------- /docs/blog/img/activity.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VUnit/vunit/4e30fa124ea84609af0f957dbc55b82adaed1d76/docs/blog/img/activity.png -------------------------------------------------------------------------------- /docs/blog/img/bestvalue1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VUnit/vunit/4e30fa124ea84609af0f957dbc55b82adaed1d76/docs/blog/img/bestvalue1.jpg -------------------------------------------------------------------------------- /docs/blog/img/bestvalue2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VUnit/vunit/4e30fa124ea84609af0f957dbc55b82adaed1d76/docs/blog/img/bestvalue2.jpg -------------------------------------------------------------------------------- /docs/blog/img/bestvalue3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VUnit/vunit/4e30fa124ea84609af0f957dbc55b82adaed1d76/docs/blog/img/bestvalue3.jpg -------------------------------------------------------------------------------- /docs/blog/img/blogging_chat_room_documentation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VUnit/vunit/4e30fa124ea84609af0f957dbc55b82adaed1d76/docs/blog/img/blogging_chat_room_documentation.png -------------------------------------------------------------------------------- /docs/blog/img/caesar_encoder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VUnit/vunit/4e30fa124ea84609af0f957dbc55b82adaed1d76/docs/blog/img/caesar_encoder.png -------------------------------------------------------------------------------- /docs/blog/img/color_logging.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VUnit/vunit/4e30fa124ea84609af0f957dbc55b82adaed1d76/docs/blog/img/color_logging.jpg -------------------------------------------------------------------------------- /docs/blog/img/contributors.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VUnit/vunit/4e30fa124ea84609af0f957dbc55b82adaed1d76/docs/blog/img/contributors.png -------------------------------------------------------------------------------- /docs/blog/img/gha_flow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VUnit/vunit/4e30fa124ea84609af0f957dbc55b82adaed1d76/docs/blog/img/gha_flow.png -------------------------------------------------------------------------------- /docs/blog/img/gha_top_image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VUnit/vunit/4e30fa124ea84609af0f957dbc55b82adaed1d76/docs/blog/img/gha_top_image.png -------------------------------------------------------------------------------- /docs/blog/img/log1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VUnit/vunit/4e30fa124ea84609af0f957dbc55b82adaed1d76/docs/blog/img/log1.jpg -------------------------------------------------------------------------------- /docs/blog/img/log2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VUnit/vunit/4e30fa124ea84609af0f957dbc55b82adaed1d76/docs/blog/img/log2.jpg -------------------------------------------------------------------------------- /docs/blog/img/log3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VUnit/vunit/4e30fa124ea84609af0f957dbc55b82adaed1d76/docs/blog/img/log3.jpg -------------------------------------------------------------------------------- /docs/blog/img/log4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VUnit/vunit/4e30fa124ea84609af0f957dbc55b82adaed1d76/docs/blog/img/log4.jpg -------------------------------------------------------------------------------- /docs/blog/img/log5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VUnit/vunit/4e30fa124ea84609af0f957dbc55b82adaed1d76/docs/blog/img/log5.jpg -------------------------------------------------------------------------------- /docs/blog/img/log_example.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VUnit/vunit/4e30fa124ea84609af0f957dbc55b82adaed1d76/docs/blog/img/log_example.jpg -------------------------------------------------------------------------------- /docs/blog/img/log_output.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VUnit/vunit/4e30fa124ea84609af0f957dbc55b82adaed1d76/docs/blog/img/log_output.png -------------------------------------------------------------------------------- /docs/blog/img/logging_hierarchy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VUnit/vunit/4e30fa124ea84609af0f957dbc55b82adaed1d76/docs/blog/img/logging_hierarchy.png -------------------------------------------------------------------------------- /docs/blog/img/low_throughput.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VUnit/vunit/4e30fa124ea84609af0f957dbc55b82adaed1d76/docs/blog/img/low_throughput.png -------------------------------------------------------------------------------- /docs/blog/img/matlab_figure.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VUnit/vunit/4e30fa124ea84609af0f957dbc55b82adaed1d76/docs/blog/img/matlab_figure.jpg -------------------------------------------------------------------------------- /docs/blog/img/message_passing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VUnit/vunit/4e30fa124ea84609af0f957dbc55b82adaed1d76/docs/blog/img/message_passing.png -------------------------------------------------------------------------------- /docs/blog/img/message_passing_model.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VUnit/vunit/4e30fa124ea84609af0f957dbc55b82adaed1d76/docs/blog/img/message_passing_model.png -------------------------------------------------------------------------------- /docs/blog/img/orange_man.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VUnit/vunit/4e30fa124ea84609af0f957dbc55b82adaed1d76/docs/blog/img/orange_man.jpeg -------------------------------------------------------------------------------- /docs/blog/img/osvb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VUnit/vunit/4e30fa124ea84609af0f957dbc55b82adaed1d76/docs/blog/img/osvb.png -------------------------------------------------------------------------------- /docs/blog/img/parallel_recipe.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VUnit/vunit/4e30fa124ea84609af0f957dbc55b82adaed1d76/docs/blog/img/parallel_recipe.jpg -------------------------------------------------------------------------------- /docs/blog/img/remote_caching_and_execution.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VUnit/vunit/4e30fa124ea84609af0f957dbc55b82adaed1d76/docs/blog/img/remote_caching_and_execution.png -------------------------------------------------------------------------------- /docs/blog/img/repositories_providing_tests.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VUnit/vunit/4e30fa124ea84609af0f957dbc55b82adaed1d76/docs/blog/img/repositories_providing_tests.png -------------------------------------------------------------------------------- /docs/blog/img/sequential_recipe.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VUnit/vunit/4e30fa124ea84609af0f957dbc55b82adaed1d76/docs/blog/img/sequential_recipe.jpg -------------------------------------------------------------------------------- /docs/blog/img/sigasi_deep.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VUnit/vunit/4e30fa124ea84609af0f957dbc55b82adaed1d76/docs/blog/img/sigasi_deep.png -------------------------------------------------------------------------------- /docs/blog/img/sigasi_full.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VUnit/vunit/4e30fa124ea84609af0f957dbc55b82adaed1d76/docs/blog/img/sigasi_full.png -------------------------------------------------------------------------------- /docs/blog/img/the_brain.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VUnit/vunit/4e30fa124ea84609af0f957dbc55b82adaed1d76/docs/blog/img/the_brain.jpg -------------------------------------------------------------------------------- /docs/blog/img/third_interface.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VUnit/vunit/4e30fa124ea84609af0f957dbc55b82adaed1d76/docs/blog/img/third_interface.png -------------------------------------------------------------------------------- /docs/blog/img/traffic_data.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VUnit/vunit/4e30fa124ea84609af0f957dbc55b82adaed1d76/docs/blog/img/traffic_data.png -------------------------------------------------------------------------------- /docs/blog/img/uvm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VUnit/vunit/4e30fa124ea84609af0f957dbc55b82adaed1d76/docs/blog/img/uvm.png -------------------------------------------------------------------------------- /docs/blog/img/vhdl_configuration/tb_selecting_dut_with_generics_stdout.html: -------------------------------------------------------------------------------- 1 |
> python run.py --list
 2 | lib.tb_selecting_dut_with_generics.rtl_8.Test reset
 3 | lib.tb_selecting_dut_with_generics.rtl_16.Test reset
 4 | lib.tb_selecting_dut_with_generics.behavioral_8.Test reset
 5 | lib.tb_selecting_dut_with_generics.behavioral_16.Test reset
 6 | lib.tb_selecting_dut_with_generics.rtl_8.Test state change
 7 | lib.tb_selecting_dut_with_generics.rtl_16.Test state change
 8 | lib.tb_selecting_dut_with_generics.behavioral_8.Test state change
 9 | lib.tb_selecting_dut_with_generics.behavioral_16.Test state change
10 | Listed 8 tests
11 | 
12 | -------------------------------------------------------------------------------- /docs/blog/img/vhdl_configuration/tb_selecting_dut_with_vhdl_configuration_stdout.html: -------------------------------------------------------------------------------- 1 |
> python run.py --list
 2 | lib.tb_selecting_dut_with_vhdl_configuration.rtl_8.Test reset
 3 | lib.tb_selecting_dut_with_vhdl_configuration.rtl_16.Test reset
 4 | lib.tb_selecting_dut_with_vhdl_configuration.behavioral_8.Test reset
 5 | lib.tb_selecting_dut_with_vhdl_configuration.behavioral_16.Test reset
 6 | lib.tb_selecting_dut_with_vhdl_configuration.rtl_32.Test reset
 7 | lib.tb_selecting_dut_with_vhdl_configuration.rtl_8.Test state change
 8 | lib.tb_selecting_dut_with_vhdl_configuration.rtl_16.Test state change
 9 | lib.tb_selecting_dut_with_vhdl_configuration.behavioral_8.Test state change
10 | lib.tb_selecting_dut_with_vhdl_configuration.behavioral_16.Test state change
11 | Listed 9 tests
12 | 
13 | -------------------------------------------------------------------------------- /docs/blog/img/vhdl_configuration/tb_selecting_test_runner_with_vhdl_configuration_stdout.html: -------------------------------------------------------------------------------- 1 |
> python run.py --list
 2 | lib.tb_selecting_test_runner_with_vhdl_configuration.test_reset_rtl_8
 3 | lib.tb_selecting_test_runner_with_vhdl_configuration.test_state_change_rtl_8
 4 | lib.tb_selecting_test_runner_with_vhdl_configuration.test_reset_rtl_16
 5 | lib.tb_selecting_test_runner_with_vhdl_configuration.test_state_change_rtl_16
 6 | lib.tb_selecting_test_runner_with_vhdl_configuration.test_reset_behavioral_8
 7 | lib.tb_selecting_test_runner_with_vhdl_configuration.test_state_change_behavioral_8
 8 | lib.tb_selecting_test_runner_with_vhdl_configuration.test_reset_behavioral_16
 9 | lib.tb_selecting_test_runner_with_vhdl_configuration.test_state_change_behavioral_16
10 | Listed 8 tests
11 | 
12 | -------------------------------------------------------------------------------- /docs/blog/img/vhdl_configuration/vhdl_configuration_on_a_test_case.html: -------------------------------------------------------------------------------- 1 |
tb.test("Test reset").add_config(name="rtl_32", generics=dict(width=32), vhdl_configuration_name="rtl")
2 | 
3 | -------------------------------------------------------------------------------- /docs/blog/img/vunit_co_simulation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VUnit/vunit/4e30fa124ea84609af0f957dbc55b82adaed1d76/docs/blog/img/vunit_co_simulation.png -------------------------------------------------------------------------------- /docs/blog/img/vunit_emailing.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VUnit/vunit/4e30fa124ea84609af0f957dbc55b82adaed1d76/docs/blog/img/vunit_emailing.jpg -------------------------------------------------------------------------------- /docs/blog/img/vunit_faq.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VUnit/vunit/4e30fa124ea84609af0f957dbc55b82adaed1d76/docs/blog/img/vunit_faq.png -------------------------------------------------------------------------------- /docs/blog/img/vunit_github_io.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VUnit/vunit/4e30fa124ea84609af0f957dbc55b82adaed1d76/docs/blog/img/vunit_github_io.png -------------------------------------------------------------------------------- /docs/blog/img/vunit_matlab.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VUnit/vunit/4e30fa124ea84609af0f957dbc55b82adaed1d76/docs/blog/img/vunit_matlab.jpg -------------------------------------------------------------------------------- /docs/blog/img/vunit_overview.drawio.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VUnit/vunit/4e30fa124ea84609af0f957dbc55b82adaed1d76/docs/blog/img/vunit_overview.drawio.png -------------------------------------------------------------------------------- /docs/blog/img/vunit_phases/dut_checker_with_combined_if_log.html: -------------------------------------------------------------------------------- 1 |
       0 fs - dut_checker                  -   TRACE - Unlocked test runner cleanup phase entry gate.
2 | 78000000 fs - dut_checker                  -   TRACE - Locked test runner cleanup phase entry gate.
3 | 82000000 fs - check                        -   ERROR - Equality check failed - Got 0000_0000_1011_1001 (185). Expected 0000_0000_1000_0011 (131).
4 | 
5 | -------------------------------------------------------------------------------- /docs/blog/img/vunit_phases/test_runner_with_event.html: -------------------------------------------------------------------------------- 1 |
wait until is_active_msg(dut_checker_done);
2 | test_runner_cleanup(runner);
3 | 
4 | -------------------------------------------------------------------------------- /docs/blog/img/vunit_popularity.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VUnit/vunit/4e30fa124ea84609af0f957dbc55b82adaed1d76/docs/blog/img/vunit_popularity.png -------------------------------------------------------------------------------- /docs/blog/img/vunit_sigasistudio.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VUnit/vunit/4e30fa124ea84609af0f957dbc55b82adaed1d76/docs/blog/img/vunit_sigasistudio.jpg -------------------------------------------------------------------------------- /docs/blog/img/vunit_view.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VUnit/vunit/4e30fa124ea84609af0f957dbc55b82adaed1d76/docs/blog/img/vunit_view.png -------------------------------------------------------------------------------- /docs/blog/img/vunit_waiting.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VUnit/vunit/4e30fa124ea84609af0f957dbc55b82adaed1d76/docs/blog/img/vunit_waiting.jpg -------------------------------------------------------------------------------- /docs/blog/img/vunit_wishbone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VUnit/vunit/4e30fa124ea84609af0f957dbc55b82adaed1d76/docs/blog/img/vunit_wishbone.png -------------------------------------------------------------------------------- /docs/blog/img/world.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VUnit/vunit/4e30fa124ea84609af0f957dbc55b82adaed1d76/docs/blog/img/world.png -------------------------------------------------------------------------------- /docs/blog/index.rst: -------------------------------------------------------------------------------- 1 | .. _blog: 2 | 3 | Blog 4 | ================ 5 | The Blog 6 | 7 | .. toctree:: 8 | :titlesonly: 9 | :glob: 10 | :reversed: 11 | 12 | * -------------------------------------------------------------------------------- /docs/blog/src/vhdl_configuration/test_runner.vhd: -------------------------------------------------------------------------------- 1 | -- This Source Code Form is subject to the terms of the Mozilla Public 2 | -- License, v. 2.0. If a copy of the MPL was not distributed with this file, 3 | -- You can obtain one at http://mozilla.org/MPL/2.0/. 4 | -- 5 | -- Copyright (c) 2014-2025, Lars Asplund lars.anders.asplund@gmail.com 6 | 7 | library ieee; 8 | use ieee.std_logic_1164.all; 9 | 10 | -- start_snippet test_runner_entity 11 | entity test_runner is 12 | generic( 13 | clk_period : time; 14 | width : positive; 15 | nested_runner_cfg : string 16 | ); 17 | port( 18 | reset : out std_logic; 19 | clk : in std_logic; 20 | d : out std_logic_vector(width - 1 downto 0); 21 | q : in std_logic_vector(width - 1 downto 0) 22 | ); 23 | end entity; 24 | -- end_snippet test_runner_entity 25 | -------------------------------------------------------------------------------- /docs/check/check_api.rst: -------------------------------------------------------------------------------- 1 | .. _check_api: 2 | 3 | *check* package 4 | --------------- 5 | 6 | .. literalinclude:: ../../vunit/vhdl/check/src/check_api.vhd 7 | :language: vhdl 8 | :lines: 10- -------------------------------------------------------------------------------- /docs/check/checker_pkg.rst: -------------------------------------------------------------------------------- 1 | .. _checker_pkg: 2 | 3 | *checker* package 4 | ----------------- 5 | 6 | .. literalinclude:: ../../vunit/vhdl/check/src/checker_pkg.vhd 7 | :language: vhdl 8 | :lines: 9- -------------------------------------------------------------------------------- /docs/check/images/check_next_passing.json: -------------------------------------------------------------------------------- 1 | { 2 | signal: [ 3 | {name: 'clock', wave: 'p.......'}, 4 | {name: 'en', wave: '1...01..'}, 5 | {name: 'start_event', wave: '010.....'}, 6 | {name: 'expr', wave: '0.....10'}, 7 | {name: 'active_clock_edge', wave: '=.......', data: ['rising_edge']}, 8 | {name: 'num_cks', wave: '=.......', data: ['4']}, 9 | {name: 'allow_overlapping', wave: '=.......', data: ['true/false']}, 10 | {name: 'allow_missing_start', wave: '=.......', data: ['true/false']} 11 | ], 12 | head:{ 13 | tick:0, 14 | }} 15 | -------------------------------------------------------------------------------- /docs/check/images/check_next_passing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VUnit/vunit/4e30fa124ea84609af0f957dbc55b82adaed1d76/docs/check/images/check_next_passing.png -------------------------------------------------------------------------------- /docs/check/images/check_next_passing_with_missing_start.json: -------------------------------------------------------------------------------- 1 | { 2 | signal: [ 3 | {name: 'clock', wave: 'p.........'}, 4 | {name: 'en', wave: '1...01....'}, 5 | {name: 'start_event', wave: '010.......'}, 6 | {name: 'expr', wave: '0.....1010'}, 7 | {name: 'active_clock_edge', wave: '=.........', data: ['rising_edge']}, 8 | {name: 'num_cks', wave: '=.........', data: ['4']}, 9 | {name: 'allow_overlapping', wave: '=.........', data: ['true']}, 10 | {name: 'allow_missing_start', wave: '=.........', data: ['true']} 11 | ], 12 | head:{ 13 | tick:0, 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /docs/check/images/check_next_passing_with_missing_start.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VUnit/vunit/4e30fa124ea84609af0f957dbc55b82adaed1d76/docs/check/images/check_next_passing_with_missing_start.png -------------------------------------------------------------------------------- /docs/check/images/check_next_passing_with_overlap.json: -------------------------------------------------------------------------------- 1 | { 2 | signal: [ 3 | {name: 'clock', wave: 'p.........'}, 4 | {name: 'en', wave: '1...01....'}, 5 | {name: 'start_event', wave: '01010.....'}, 6 | {name: 'expr', wave: '0.....1010'}, 7 | {name: 'active_clock_edge', wave: '=.........', data: ['rising_edge']}, 8 | {name: 'num_cks', wave: '=.........', data: ['4']}, 9 | {name: 'allow_overlapping', wave: '=.........', data: ['true']}, 10 | {name: 'allow_missing_start', wave: '=.........', data: ['true/false']} 11 | ], 12 | head:{ 13 | tick:0, 14 | }} 15 | -------------------------------------------------------------------------------- /docs/check/images/check_next_passing_with_overlap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VUnit/vunit/4e30fa124ea84609af0f957dbc55b82adaed1d76/docs/check/images/check_next_passing_with_overlap.png -------------------------------------------------------------------------------- /docs/check/images/check_sequence_first_no_pipe_passing.json: -------------------------------------------------------------------------------- 1 | { 2 | signal: [ 3 | {name: 'clock', wave: 'p.......'}, 4 | {name: 'en', wave: '1.......'}, 5 | {name: 'event_sequence', wave: '=======.', data: ['0000','1000','0100','1010','0101','0010','0000']}, 6 | {name: 'active_clock_edge', wave: '=.......', data: ['rising_edge']}, 7 | {name: 'trigger_event', wave: '=.......', data: ['first_no_pipe']} 8 | ], 9 | head:{ 10 | tick:0, 11 | }} 12 | -------------------------------------------------------------------------------- /docs/check/images/check_sequence_first_no_pipe_passing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VUnit/vunit/4e30fa124ea84609af0f957dbc55b82adaed1d76/docs/check/images/check_sequence_first_no_pipe_passing.png -------------------------------------------------------------------------------- /docs/check/images/check_sequence_first_pipe_failing.json: -------------------------------------------------------------------------------- 1 | { 2 | signal: [ 3 | {name: 'clock', wave: 'p....'}, 4 | {name: 'en', wave: '1....'}, 5 | {name: 'event_sequence', wave: '====.', data: ['0000','1000','0100','0000']}, 6 | {name: 'active_clock_edge', wave: '=....', data: ['rising_edge']}, 7 | {name: 'trigger_event', wave: '=....', data: ['first_pipe']} 8 | ], 9 | head:{ 10 | tick:0, 11 | }} 12 | -------------------------------------------------------------------------------- /docs/check/images/check_sequence_first_pipe_failing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VUnit/vunit/4e30fa124ea84609af0f957dbc55b82adaed1d76/docs/check/images/check_sequence_first_pipe_failing.png -------------------------------------------------------------------------------- /docs/check/images/check_sequence_first_pipe_passing.json: -------------------------------------------------------------------------------- 1 | { 2 | signal: [ 3 | {name: 'clock', wave: 'p........'}, 4 | {name: 'en', wave: '1........'}, 5 | {name: 'event_sequence', wave: '========.', data: ['0000','1000','0100','1010','0101','0010','0001','0000']}, 6 | {name: 'active_clock_edge', wave: '=........', data: ['rising_edge']}, 7 | {name: 'trigger_event', wave: '=........', data: ['first_pipe']} 8 | ], 9 | head:{ 10 | tick:0, 11 | }} 12 | -------------------------------------------------------------------------------- /docs/check/images/check_sequence_first_pipe_passing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VUnit/vunit/4e30fa124ea84609af0f957dbc55b82adaed1d76/docs/check/images/check_sequence_first_pipe_passing.png -------------------------------------------------------------------------------- /docs/check/images/check_sequence_penultimate_failing.json: -------------------------------------------------------------------------------- 1 | { 2 | signal: [ 3 | {name: 'clock', wave: 'p.....'}, 4 | {name: 'en', wave: '1.....'}, 5 | {name: 'event_sequence', wave: '=====.', data: ['0000','1000','0100','0010','0000','0000']}, 6 | {name: 'active_clock_edge', wave: '=.....', data: ['rising_edge']}, 7 | {name: 'trigger_event', wave: '=.....', data: ['penultimate']} 8 | ], 9 | head:{ 10 | tick:0, 11 | }, 12 | } 13 | -------------------------------------------------------------------------------- /docs/check/images/check_sequence_penultimate_failing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VUnit/vunit/4e30fa124ea84609af0f957dbc55b82adaed1d76/docs/check/images/check_sequence_penultimate_failing.png -------------------------------------------------------------------------------- /docs/check/images/check_sequence_penultimate_passing.json: -------------------------------------------------------------------------------- 1 | { 2 | signal: [ 3 | {name: 'clock', wave: 'p............'}, 4 | {name: 'en', wave: '1.....01.....'}, 5 | {name: 'event_sequence', wave: '======.=====.', data: ['0000','1000','0100','1010','0101','0010','0001','0000','1000','0100','0000','0000']}, 6 | {name: 'active_clock_edge', wave: '=............', data: ['rising_edge']}, 7 | {name: 'trigger_event', wave: '=............', data: ['penultimate']} 8 | ], 9 | head:{ 10 | tick:0, 11 | }} 12 | -------------------------------------------------------------------------------- /docs/check/images/check_sequence_penultimate_passing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VUnit/vunit/4e30fa124ea84609af0f957dbc55b82adaed1d76/docs/check/images/check_sequence_penultimate_passing.png -------------------------------------------------------------------------------- /docs/check/images/check_stable_failing.json: -------------------------------------------------------------------------------- 1 | { 2 | signal: [ 3 | {name: 'clock', wave: 'p..........'}, 4 | {name: 'en', wave: '1..........'}, 5 | {name: 'start_event', wave: '010...10...'}, 6 | {name: 'end_event', wave: '0..10...10.'}, 7 | {name: 'expr', wave: '===.=.=....', data: ['101','111','101','111','1U1']}, 8 | {name: 'active_clock_edge', wave: '=..........', data: ['rising_edge']} 9 | ], 10 | head:{ 11 | tick:0, 12 | }} 13 | -------------------------------------------------------------------------------- /docs/check/images/check_stable_failing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VUnit/vunit/4e30fa124ea84609af0f957dbc55b82adaed1d76/docs/check/images/check_stable_failing.png -------------------------------------------------------------------------------- /docs/check/images/check_stable_passing.json: -------------------------------------------------------------------------------- 1 | { 2 | signal: [ 3 | {name: 'clock', wave: 'p..........'}, 4 | {name: 'en', wave: '1......01..'}, 5 | {name: 'start_event', wave: '010...10...'}, 6 | {name: 'end_event', wave: '0..10....10'}, 7 | {name: 'expr', wave: '==..=..==..', data: ['101','111','101','111','101']}, 8 | {name: 'active_clock_edge', wave: '=..........', data: ['rising_edge']} 9 | ], 10 | head:{ 11 | tick:0, 12 | }} 13 | 14 | 15 | -------------------------------------------------------------------------------- /docs/check/images/check_stable_passing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VUnit/vunit/4e30fa124ea84609af0f957dbc55b82adaed1d76/docs/check/images/check_stable_passing.png -------------------------------------------------------------------------------- /docs/check/images/check_true.json: -------------------------------------------------------------------------------- 1 | { 2 | signal: [ 3 | {name: 'clock', wave: 'p....'}, 4 | {name: 'en', wave: '1.01.'}, 5 | {name: 'expr', wave: '=.==.', data: ['true', 'false', 'true']}, 6 | {name: 'active_clock_edge', wave: '=....', data: ['rising_edge']} 7 | ], 8 | head:{ 9 | tick:0, 10 | }} 11 | 12 | -------------------------------------------------------------------------------- /docs/check/images/check_true.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VUnit/vunit/4e30fa124ea84609af0f957dbc55b82adaed1d76/docs/check/images/check_true.png -------------------------------------------------------------------------------- /docs/data_types/cosim.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VUnit/vunit/4e30fa124ea84609af0f957dbc55b82adaed1d76/docs/data_types/cosim.png -------------------------------------------------------------------------------- /docs/data_types/ext_integer_vector.rst: -------------------------------------------------------------------------------- 1 | .. _ext_integer_vector_pkg: 2 | 3 | *external integer vector* package 4 | --------------------------------- 5 | .. literalinclude:: ../../vunit/vhdl/data_types/src/api/external_integer_vector_pkg.vhd 6 | :language: vhdl 7 | :lines: 7- 8 | -------------------------------------------------------------------------------- /docs/data_types/ext_string.rst: -------------------------------------------------------------------------------- 1 | .. _ext_string_pkg: 2 | 3 | *external string* package 4 | ------------------------- 5 | .. literalinclude:: ../../vunit/vhdl/data_types/src/api/external_string_pkg.vhd 6 | :language: vhdl 7 | :lines: 7- -------------------------------------------------------------------------------- /docs/data_types/img/vunit_events/add_preprocessor.html: -------------------------------------------------------------------------------- 1 |
vu = VUnit.from_argv()
2 | vu.enable_location_preprocessing()  # order = 100 if no other value is provided
3 | vu.add_preprocessor(WaitStatementPreprocessor(order=99))
4 | 
5 | -------------------------------------------------------------------------------- /docs/data_types/img/vunit_events/custom_logger.html: -------------------------------------------------------------------------------- 1 |
wait until (rising_edge(clk) and output_tvalid = '1') or log_active(runner_timeout, logger => dut_checker_logger);
2 | 
3 | -------------------------------------------------------------------------------- /docs/data_types/img/vunit_events/custom_message.html: -------------------------------------------------------------------------------- 1 |
wait until (rising_edge(clk) and output_tvalid = '1') or log_active(runner_timeout, "Waiting on output data", logger => dut_checker_logger);
2 | 
3 | -------------------------------------------------------------------------------- /docs/data_types/img/vunit_events/dut_checker_logger.html: -------------------------------------------------------------------------------- 1 |
constant dut_checker_logger : logger_t := get_logger("dut_checker");
2 | 
3 | -------------------------------------------------------------------------------- /docs/data_types/img/vunit_events/event_creation.html: -------------------------------------------------------------------------------- 1 |
signal new_data_set : event_t := new_event("new_data_set");
2 | -- The above is equivalent to
3 | -- signal new_data_set : event_t := new_event(get_id("new_data_set"));
4 | 
5 | -------------------------------------------------------------------------------- /docs/data_types/img/vunit_events/is_active_msg.html: -------------------------------------------------------------------------------- 1 |
     0 ps - default                      -    INFO - Identity hierarchy: (tb_event.vhd:134)
2 |                                                      dut_checker
3 |                                                      \---done
4 | 326000 ps - vunit_lib:event_pkg          -    INFO - Event dut_checker:done activated (tb_event.vhd:151)
5 | 
6 | -------------------------------------------------------------------------------- /docs/data_types/img/vunit_events/log_after_log_active.html: -------------------------------------------------------------------------------- 1 |
500000 ps - vunit_lib:event_pkg          -    INFO - Event runner:timeout activated (tb_event.vhd:368)
2 | 500000 ps - runner                       -   ERROR - Test runner timeout after 500000 ps. (tb_event.vhd:155)
3 | 
4 | -------------------------------------------------------------------------------- /docs/data_types/img/vunit_events/log_for_check_latency.html: -------------------------------------------------------------------------------- 1 |
174000 ps - check                        -   ERROR - Equality check failed for #processed samples - Got 0000_0101 (5). Expected 10 (0000_1010). (tb_event.vhd:206)
2 | 
3 | -------------------------------------------------------------------------------- /docs/data_types/img/vunit_events/log_for_check_latency_with_vunit_error.html: -------------------------------------------------------------------------------- 1 |
178000 ps - vunit_lib:event_pkg          -    INFO - Event vunit_lib:vunit_error activated while waiting on "wait until is_active(new_data_set);" (tb_event.vhd:417)
2 | 178000 ps - check                        -   ERROR - Equality check failed for #processed samples - Got 0000_0101 (5). Expected 10 (0000_1010). (tb_event.vhd:265)
3 | 
4 | -------------------------------------------------------------------------------- /docs/data_types/img/vunit_events/log_with_custom_message.html: -------------------------------------------------------------------------------- 1 |
500000 ps - dut_checker                  -    INFO - Waiting on output data (tb_event.vhd:396)
2 | 500000 ps - runner                       -   ERROR - Test runner timeout after 500000 ps. (tb_event.vhd:155)
3 | 
4 | -------------------------------------------------------------------------------- /docs/data_types/img/vunit_events/log_with_decorated_message.html: -------------------------------------------------------------------------------- 1 |
500000 ps - dut_checker                  -    INFO - Event runner:timeout activated while waiting on output data (tb_event.vhd:400)
2 | 500000 ps - runner                       -   ERROR - Test runner timeout after 500000 ps. (tb_event.vhd:155)
3 | 
4 | -------------------------------------------------------------------------------- /docs/data_types/img/vunit_events/log_with_dut_checker_logger.html: -------------------------------------------------------------------------------- 1 |
500000 ps - dut_checker                  -    INFO - Event runner:timeout activated (tb_event.vhd:392)
2 | 500000 ps - runner                       -   ERROR - Test runner timeout after 500000 ps. (tb_event.vhd:155)
3 | 
4 | -------------------------------------------------------------------------------- /docs/data_types/img/vunit_events/n_samples_field.html: -------------------------------------------------------------------------------- 1 |
subtype n_samples_field is integer range 8 downto 1;
2 | 
3 | -------------------------------------------------------------------------------- /docs/data_types/img/vunit_events/notify_with_boolean_event.html: -------------------------------------------------------------------------------- 1 |
for data_set in 1 to 3 loop
2 |   produce_data(data_set);
3 |   new_data_set <= true;
4 | end loop;
5 | 
6 | -------------------------------------------------------------------------------- /docs/data_types/img/vunit_events/notify_with_toggling_event.html: -------------------------------------------------------------------------------- 1 |
for data_set in 1 to 3 loop
2 |   produce_data(data_set);
3 |   new_data_set <= not new_data_set;
4 | end loop;
5 | 
6 | -------------------------------------------------------------------------------- /docs/data_types/img/vunit_events/timeout_due_to_bug.html: -------------------------------------------------------------------------------- 1 |
500000 ps - runner                       -   ERROR - Test runner timeout after 500000 ps. (tb_event.vhd:155)
2 | 
3 | -------------------------------------------------------------------------------- /docs/data_types/img/vunit_events/wait_done_event.html: -------------------------------------------------------------------------------- 1 |
  wait until is_active_msg(dut_checker_done);
2 |   test_runner_cleanup(runner);
3 | end process;
4 | 
5 | test_runner_watchdog(runner, 500 ns);
6 | 
7 | -------------------------------------------------------------------------------- /docs/data_types/img/vunit_events/wait_on_signal_event.html: -------------------------------------------------------------------------------- 1 |
wait on new_data_set;
2 | 
3 | -------------------------------------------------------------------------------- /docs/data_types/img/vunit_events/wait_on_signal_transaction.html: -------------------------------------------------------------------------------- 1 |
wait on new_data_set'transaction;
2 | 
3 | -------------------------------------------------------------------------------- /docs/data_types/integer_array.rst: -------------------------------------------------------------------------------- 1 | .. _integer_array_pkg: 2 | 3 | *integer_array* package 4 | ----------------------- 5 | 6 | .. literalinclude:: ../../vunit/vhdl/data_types/src/integer_array_pkg.vhd 7 | :language: vhdl 8 | :lines: 7- -------------------------------------------------------------------------------- /docs/data_types/queue.rst: -------------------------------------------------------------------------------- 1 | .. _queue_pkg: 2 | 3 | *queue* package 4 | --------------- 5 | 6 | .. literalinclude:: ../../vunit/vhdl/data_types/src/queue_pkg.vhd 7 | :language: vhdl 8 | :lines: 7- -------------------------------------------------------------------------------- /docs/data_types/src/vunit_events/incrementer_pkg.vhd: -------------------------------------------------------------------------------- 1 | -- This Source Code Form is subject to the terms of the Mozilla Public 2 | -- License, v. 2.0. If a copy of the MPL was not distributed with this file, 3 | -- You can obtain one at http://mozilla.org/MPL/2.0/. 4 | -- 5 | -- Copyright (c) 2014-2025, Lars Asplund lars.anders.asplund@gmail.com 6 | 7 | package incrementer_pkg is 8 | constant increment_reg_addr : natural := 0; 9 | constant status_reg_addr : natural := 4; 10 | 11 | -- start_snippet n_samples_field 12 | subtype n_samples_field is integer range 8 downto 1; 13 | -- end_snippet n_samples_field 14 | end package incrementer_pkg; 15 | -------------------------------------------------------------------------------- /docs/data_types/user_guide.rst: -------------------------------------------------------------------------------- 1 | .. _data_types_library: 2 | 3 | Data Types User Guide 4 | ##################### 5 | 6 | VUnit comes with a number of convenient data types included: 7 | 8 | * **event_t and basic_event_t** (:ref:`event user guide `) 9 | 10 | * **queue_t** (:ref:`Queue API `) 11 | Queue (FIFO) to which any VHDL primitive data type can be pushed and 12 | popped (by serializing data to bytes internally). This queue can be 13 | used to, for example, push expected data from a driver process to a 14 | checker process in a test bench. 15 | 16 | * **integer_array_t** (:ref:`Integer array API `) 17 | Dynamic array of integers in up to 3 dimensions. Supports dynamic 18 | append and reshape operations, and reading/writing data to/from 19 | *.csv* or *.raw* byte files. 20 | 21 | .. toctree:: 22 | :hidden: 23 | 24 | event_user_guide 25 | queue 26 | integer_array 27 | 28 | .. _data_types_library:external: 29 | 30 | External VHDL API 31 | ================= 32 | 33 | .. include:: external_api.rst 34 | -------------------------------------------------------------------------------- /docs/examples.rst: -------------------------------------------------------------------------------- 1 | .. _examples: 2 | 3 | Examples 4 | ======== 5 | 6 | .. HINT:: 7 | Most of the examples expect the simulator to support several VHDL 2008 features. 8 | This is made explicit by using ``context`` instead of multiple ``use`` statements. 9 | However, some vendors do support enough VHDL 2008 features in order to run some of the examples, but they cannot 10 | handle contexts. 11 | In those cases, replacing ``context vunit_lib.vunit_context`` with the content of :vunit_file:`vunit/vhdl/vunit_context.vhd` 12 | and :vunit_file:`vunit/vhdl/data_types/src/data_types_context.vhd` might work. 13 | 14 | .. include:: examples.inc 15 | -------------------------------------------------------------------------------- /docs/genindex.rst: -------------------------------------------------------------------------------- 1 | .. # This file is a placeholder and will be replaced 2 | 3 | .. _genindex: 4 | 5 | Index 6 | ##### 7 | -------------------------------------------------------------------------------- /docs/id/full_tree_log.html: -------------------------------------------------------------------------------- 1 |
This is the full identity tree:
 2 | (root)
 3 | +---default
 4 | +---vunit_lib
 5 | |   \---dictionary
 6 | +---check
 7 | +---runner
 8 | \---tb_dut
 9 |     +---vc_x
10 |     \---vc_y
11 | 
12 | -------------------------------------------------------------------------------- /docs/id/get_tree.html: -------------------------------------------------------------------------------- 1 |
print("This is the tb_dut tree:" & get_tree(parent_id));
2 | 
3 | -------------------------------------------------------------------------------- /docs/id/get_tree_log.html: -------------------------------------------------------------------------------- 1 |
This is the tb_dut tree:
2 | tb_dut
3 | +---vc_x
4 | \---vc_y
5 | 
6 | -------------------------------------------------------------------------------- /docs/id/has_id_log.html: -------------------------------------------------------------------------------- 1 |
has_id("") = true
2 | has_id("tb_dut:vc_x") = true
3 | has_id("vc_y", parent => get_id("tb_dut")) = true
4 | has_id("vc_x") = false
5 | 
6 | -------------------------------------------------------------------------------- /docs/id/id_from_attribute.html: -------------------------------------------------------------------------------- 1 |
variable vc_x_id : id_t;
2 | 
3 | vc_x_id := get_id(vc_x'path_name);
4 | 
5 | -------------------------------------------------------------------------------- /docs/id/id_from_parent.html: -------------------------------------------------------------------------------- 1 |
vc_y_id := get_id("vc_y", parent => parent_id);
2 | 
3 | -------------------------------------------------------------------------------- /docs/id/id_from_string.html: -------------------------------------------------------------------------------- 1 |
vc_x_id := get_id(":tb_dut:vc_x:");
2 | 
3 | -------------------------------------------------------------------------------- /docs/id/id_from_string_wo_colon.html: -------------------------------------------------------------------------------- 1 |
vc_x_id := get_id("tb_dut:vc_x");
2 | 
3 | -------------------------------------------------------------------------------- /docs/id/id_naming_log.html: -------------------------------------------------------------------------------- 1 |
Name = vc_x
2 | Full name = tb_dut:vc_x
3 | Parent name = tb_dut
4 | 
5 | -------------------------------------------------------------------------------- /docs/id/null_id_log.html: -------------------------------------------------------------------------------- 1 |
10000000 fs - Acme Corporation:vc_x:1 -   DEBUG - Writing 0xDEADBEEF to address 0x12345678.
2 | 
3 | -------------------------------------------------------------------------------- /docs/id/second_id_from_string.html: -------------------------------------------------------------------------------- 1 |
vc_y_id := get_id(vc_y'path_name); -- Creates an identity for vc_y but not for tb_dut.
2 | 
3 | -------------------------------------------------------------------------------- /docs/id/src/dut.vhd: -------------------------------------------------------------------------------- 1 | -- This Source Code Form is subject to the terms of the Mozilla Public 2 | -- License, v. 2.0. If a copy of the MPL was not distributed with this file, 3 | -- You can obtain one at http://mozilla.org/MPL/2.0/. 4 | -- 5 | -- Copyright (c) 2014-2025, Lars Asplund lars.anders.asplund@gmail.com 6 | 7 | entity dut is 8 | port( 9 | d : in bit; 10 | q : out bit 11 | ); 12 | end; 13 | 14 | architecture a of dut is 15 | begin 16 | q <= d; 17 | end; 18 | -------------------------------------------------------------------------------- /docs/id/tb_dut_local_declarations_log.html: -------------------------------------------------------------------------------- 1 |
Writing 0xDEADBEEF to address 0x12345678 (:tb_dut2:local_declarations:vc_x:).
2 | 
3 | -------------------------------------------------------------------------------- /docs/id/tb_dut_log.html: -------------------------------------------------------------------------------- 1 |
Writing 0xDEADBEEF to address 0x12345678 (:tb_dut:vc_x:).
2 | 
3 | -------------------------------------------------------------------------------- /docs/id/traversing_log.html: -------------------------------------------------------------------------------- 1 |
num_children(get_id("tb_dut"))) = 2
2 | name(get_child(get_id("tb_dut"), 1)) = vc_y
3 | 
4 | -------------------------------------------------------------------------------- /docs/logging/additional_subprograms.html: -------------------------------------------------------------------------------- 1 |
ui = VUnit.from_argv()
2 | ui.add_vhdl_builtins()
3 | ui.enable_location_preprocessing(additional_subprograms=["my_convenience_procedure"])
4 | 
5 | -------------------------------------------------------------------------------- /docs/logging/conditional_log.html: -------------------------------------------------------------------------------- 1 |
warning_if(True, "A warning happened");
2 | warning_if(False, "A warning did not happen");
3 | 
4 | -- There are also variants for error and failure as well as with
5 | -- non-default logger argument.
6 | 
7 | -------------------------------------------------------------------------------- /docs/logging/convenience_procedure.html: -------------------------------------------------------------------------------- 1 |
procedure my_convenience_procedure(
 2 |   -- Parameters ...
 3 | ) is
 4 | begin
 5 |   -- Some code ...
 6 |   info("Some message", path_offset => 1);
 7 |   -- Some code ...
 8 | end procedure my_convenience_procedure;
 9 | 
10 | -------------------------------------------------------------------------------- /docs/logging/custom_log_level.html: -------------------------------------------------------------------------------- 1 |
constant license_info : log_level_t := new_log_level("license", fg => red, bg => yellow, style => bright);
2 | 
3 | -------------------------------------------------------------------------------- /docs/logging/disabled_log.html: -------------------------------------------------------------------------------- 1 |
-- Irrelevant warning
2 | disable(get_logger("memory_ip:timing_check"), warning);
3 | 
4 | -------------------------------------------------------------------------------- /docs/logging/fix_decimals_log.html: -------------------------------------------------------------------------------- 1 |
123.45 ns - default              -    PASS - Passes are green
2 | 
3 | -------------------------------------------------------------------------------- /docs/logging/full_time_resolution_log.html: -------------------------------------------------------------------------------- 1 |
0.123456 us - check                - FAILURE - Failures are even more red
2 | 
3 | -------------------------------------------------------------------------------- /docs/logging/location_preprocessing.html: -------------------------------------------------------------------------------- 1 |
ui = VUnit.from_argv()
2 | ui.add_vhdl_builtins()
3 | ui.enable_location_preprocessing()
4 | 
5 | -------------------------------------------------------------------------------- /docs/logging/log_call.html: -------------------------------------------------------------------------------- 1 |
info("Hello world");
2 | 
3 | -------------------------------------------------------------------------------- /docs/logging/log_call_with_custom_level.html: -------------------------------------------------------------------------------- 1 |
log("Mozilla Public License, v. 2.0.", license_info);
2 | log(my_logger, "Mozilla Public License, v. 2.0.", license_info);
3 | 
4 | -------------------------------------------------------------------------------- /docs/logging/log_call_with_logger.html: -------------------------------------------------------------------------------- 1 |
info(my_logger, "Hello world");
2 | 
3 | -------------------------------------------------------------------------------- /docs/logging/log_location_log.html: -------------------------------------------------------------------------------- 1 |
1.260 us - check                -   ERROR - Equality check failed for packet length - Got 15. Expected 16. (receiver.vhd:73)
2 | 
3 | -------------------------------------------------------------------------------- /docs/logging/log_time_unit_log.html: -------------------------------------------------------------------------------- 1 |
123.456 ns - check                -   ERROR - Errors are red
2 | 
3 | -------------------------------------------------------------------------------- /docs/logging/logger_declaration.html: -------------------------------------------------------------------------------- 1 |
constant my_logger : logger_t := get_logger("system0:uart0");
2 | 
3 | -------------------------------------------------------------------------------- /docs/logging/logger_from_id.html: -------------------------------------------------------------------------------- 1 |
constant my_id : id_t := get_id("system0:uart0");
2 | constant my_logger : logger_t := get_logger(my_id);
3 | 
4 | -------------------------------------------------------------------------------- /docs/logging/mocking.html: -------------------------------------------------------------------------------- 1 |
logger := get_logger("my_library");
 2 | mock(logger, failure);
 3 | 
 4 | -- Code to trigger an error
 5 | 
 6 | -- Verify that the expected error message has been produced
 7 | check_only_log(logger, "Some error message", failure);
 8 | unmock(logger);
 9 | 
10 | -------------------------------------------------------------------------------- /docs/logging/print.html: -------------------------------------------------------------------------------- 1 |
print("Message to stdout");
2 | print("Append this message to an existing file or create a new file if it doesn't exist", "path/to/file");
3 | print("Create new file with this message", "path/to/file", write_mode);
4 | 
5 | -------------------------------------------------------------------------------- /docs/logging/print_to_open_file.html: -------------------------------------------------------------------------------- 1 |
print("Message to file object", my_file_object);
2 | 
3 | -------------------------------------------------------------------------------- /docs/logging/set_debug_option.html: -------------------------------------------------------------------------------- 1 |
testbenches = lib.get_source_files("*tb*")
2 | testbenches.set_compile_option("rivierapro.vcom_flags", ["-dbg"])
3 | 
4 | -------------------------------------------------------------------------------- /docs/logging/set_format.html: -------------------------------------------------------------------------------- 1 |
set_format(display_handler, level);
2 | info("Hello world");
3 | 
4 | -------------------------------------------------------------------------------- /docs/logging/set_format_log.html: -------------------------------------------------------------------------------- 1 |
INFO - Hello world
2 | 
3 | -------------------------------------------------------------------------------- /docs/logging/src/path/to/file: -------------------------------------------------------------------------------- 1 | Create new file with this message 2 | Message to file object 3 | -------------------------------------------------------------------------------- /docs/logging/use_external_log.html: -------------------------------------------------------------------------------- 1 |
ui.add_vhdl_builtins(use_external_log="path/to/other/common_log_pkg/body")
2 | 
3 | -------------------------------------------------------------------------------- /docs/logging/verbose_format_log.html: -------------------------------------------------------------------------------- 1 |
123456 ps - default              - WARNING - Warnings are yellow
2 | 
3 | -------------------------------------------------------------------------------- /docs/news.d/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VUnit/vunit/4e30fa124ea84609af0f957dbc55b82adaed1d76/docs/news.d/.gitkeep -------------------------------------------------------------------------------- /docs/release_notes.rst: -------------------------------------------------------------------------------- 1 | .. _release_notes: 2 | 3 | Release notes 4 | ============= 5 | 6 | .. NOTE:: For installation instructions read :ref:`this `. 7 | 8 | :vunit_commit:`Next ` 9 | ----------------------------- 10 | 11 | .. include:: news.inc 12 | 13 | .. include:: release_notes.inc 14 | -------------------------------------------------------------------------------- /docs/release_notes/0.52.0.rst: -------------------------------------------------------------------------------- 1 | Added function to get the number of messages missed by a com package actor. 2 | -------------------------------------------------------------------------------- /docs/release_notes/0.53.0.rst: -------------------------------------------------------------------------------- 1 | - ``add_source_files`` accepts a list of files 2 | - Added ``-f/--files`` command line flag to list all files in compile order 3 | - Verilog parser improvements in robustness and error messages. 4 | -------------------------------------------------------------------------------- /docs/release_notes/0.54.0.rst: -------------------------------------------------------------------------------- 1 | - Adds support for Verilog preprocessor ifdef/ifndef/elsif/else/endif 2 | - Fixes regression in modelsim persistent mode. Makes many short tests faster. 3 | -------------------------------------------------------------------------------- /docs/release_notes/0.56.0.rst: -------------------------------------------------------------------------------- 1 | - Verilog preprocessing of resetall / undefineall / undef 2 | -------------------------------------------------------------------------------- /docs/release_notes/0.57.0.rst: -------------------------------------------------------------------------------- 1 | - Adds ``include_dirs`` argument also to ``Library`` add_source_file(s) 2 | - Ignores more builtin Verilog preprocessor directives. 3 | -------------------------------------------------------------------------------- /docs/release_notes/0.58.0.rst: -------------------------------------------------------------------------------- 1 | - Parsing Verilog package references. :vunit_issue:`119` 2 | - Added ``scan_tests_from_file`` public method. :vunit_issue:`121`. 3 | -------------------------------------------------------------------------------- /docs/release_notes/0.59.0.rst: -------------------------------------------------------------------------------- 1 | - Covered a miss in circular dependency detection. 2 | - Added detection of circular includes and macro expansions in verilog preprocessing. 3 | - Added caching of verilog parse results for significant speed when running run.py more than once. 4 | -------------------------------------------------------------------------------- /docs/release_notes/0.60.0.rst: -------------------------------------------------------------------------------- 1 | - Better error messages when there are circular dependencies. 2 | - Added ``defines`` argument to add_source_file(s) :vunit_issue:`126` 3 | - Made ``--files`` deterministic with Python 3 :vunit_issue:`116` 4 | -------------------------------------------------------------------------------- /docs/release_notes/0.60.1.rst: -------------------------------------------------------------------------------- 1 | - Avoids crash with errors in Verilog defines from Python string in run.py 2 | -------------------------------------------------------------------------------- /docs/release_notes/0.61.0.rst: -------------------------------------------------------------------------------- 1 | - Adds ``.all`` suffix to test benches with no test to better align with XUnit architecture. 2 | - Enables better hierarchical JUnit XML report view in Jenkins. 3 | - Fixes :vunit_issue:`129`. 4 | -------------------------------------------------------------------------------- /docs/release_notes/0.62.0.rst: -------------------------------------------------------------------------------- 1 | - Early runtime error when gtkwave is missing. Closes :vunit_issue:`137` 2 | - Added add_compile_option. Closes :vunit_issue:`118` 3 | -------------------------------------------------------------------------------- /docs/release_notes/0.62.1.rst: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VUnit/vunit/4e30fa124ea84609af0f957dbc55b82adaed1d76/docs/release_notes/0.62.1.rst -------------------------------------------------------------------------------- /docs/release_notes/0.63.0.rst: -------------------------------------------------------------------------------- 1 | - Update test scanner pattern to be based on ``runner_cfg``. :vunit_issue:`138` 2 | -------------------------------------------------------------------------------- /docs/release_notes/0.64.0.rst: -------------------------------------------------------------------------------- 1 | - Added python version check. Closes :vunit_issue:`141`. 2 | - Not adding .all suffix when there are named configurations 3 | -------------------------------------------------------------------------------- /docs/release_notes/0.65.0.rst: -------------------------------------------------------------------------------- 1 | - Added sim and compile options to set rivierapro/activehdl flags. :vunit_issue:`143`. 2 | - Removed builtin ``-dbg`` flag to vcom for aldec tools. Use set_compile_option instead to set it yourself. 3 | - Fixed a bug with custom relative output_path. 4 | - Documentation fixes & improvements. 5 | - Update rivierapro and activehdl toolchain discovery. :vunit_issue:`148`. 6 | - Added possibility to set ``VUNIT__PATH`` environment 7 | variable to specify simulation executable path. :vunit_issue:`148`. 8 | - Added ``-k/--keep-compiling`` flag. :vunit_issue:`140`. 9 | - Added optional ``output_path`` argument to ``pre_config``. :vunit_issue:`146`. 10 | -------------------------------------------------------------------------------- /docs/release_notes/0.66.0.rst: -------------------------------------------------------------------------------- 1 | - Fixed :vunit_issue:`109`, :vunit_issue:`141`, :vunit_issue:`153`, :vunit_issue:`155`. 2 | - Fixed relative path for multiple drives on windows. 3 | -------------------------------------------------------------------------------- /docs/release_notes/0.67.0.rst: -------------------------------------------------------------------------------- 1 | - A number of minor enhancements and bug fixes 2 | - Added vunit_restart TCL procedure to ModelSim 3 | - Print out remaining number of tests when pressing ctrl-c 4 | - Updated OSVVM and made it a git submodule. Run 5 | 6 | .. code-block:: console 7 | 8 | git submodule update --init --recursive 9 | 10 | after updating an existing Git repository or 11 | 12 | .. code-block:: console 13 | 14 | git clone --recursive https://github.com/VUnit/vunit.git 15 | 16 | when creating a new clone to get the OSVVM subdirectory of VUnit populated. Doesn't affect installations made from PyPi 17 | -------------------------------------------------------------------------------- /docs/release_notes/0.68.0.rst: -------------------------------------------------------------------------------- 1 | Added check_equal for time and updated documentation. 2 | -------------------------------------------------------------------------------- /docs/release_notes/0.68.1.rst: -------------------------------------------------------------------------------- 1 | New version to fix broken PyPi upload 2 | -------------------------------------------------------------------------------- /docs/release_notes/0.69.0.rst: -------------------------------------------------------------------------------- 1 | Added check_equal for strings. 2 | -------------------------------------------------------------------------------- /docs/release_notes/0.70.0.rst: -------------------------------------------------------------------------------- 1 | - Hashing test output_path to protect against special characters and long paths on Windows. 2 | - Added ``.vo`` as recognized Verilog file ending. 3 | - Enable setting vhdl_standard per file. 4 | -------------------------------------------------------------------------------- /docs/release_notes/0.71.0.rst: -------------------------------------------------------------------------------- 1 | - Improved location preprocessing control 2 | -------------------------------------------------------------------------------- /docs/release_notes/1.0.0.rst: -------------------------------------------------------------------------------- 1 | - Adds ActiveHDL custom simulation flags support 2 | - Made library simulator flag argument deterministic and same as the order added to VUnit 3 | - Added check_equal between std_logic_vector and natural for unsigned comparison 4 | - Can now set vhdl_standard on an external library 5 | - Added no_parse argument to add_source_files(s) to inhibit any dependency or test scanning 6 | - Renamed public method depends_on to add_dependency_on 7 | -------------------------------------------------------------------------------- /docs/release_notes/1.1.1.rst: -------------------------------------------------------------------------------- 1 | - Adds vunit_restart and vunit_compile TCL commands for both ModelSim and RivieraPro 2 | - Also support persistent simulator to save startup overhead for RivieraPro. 3 | - Changes --new-vsim into -u/--unique-sim which also works for riviera 4 | -------------------------------------------------------------------------------- /docs/release_notes/1.2.0.rst: -------------------------------------------------------------------------------- 1 | - Updated OSVVM submodule 2 | -------------------------------------------------------------------------------- /docs/release_notes/1.3.0.rst: -------------------------------------------------------------------------------- 1 | - Added support for pass acknowledge messages for check subprograms. 2 | - Made design unit duplication a warning instead of runtime error again. 3 | -------------------------------------------------------------------------------- /docs/release_notes/1.3.1.rst: -------------------------------------------------------------------------------- 1 | - Fixed compile errors with GHDL 0.33 2 | -------------------------------------------------------------------------------- /docs/release_notes/1.4.0.rst: -------------------------------------------------------------------------------- 1 | - Removed bug when compiling Verilog with Active-HDL 2 | - Updated array package 3 | - Added support for simulation init script 4 | - Added support for setting VHDL asserts stop level from run script 5 | -------------------------------------------------------------------------------- /docs/release_notes/2.0.1.rst: -------------------------------------------------------------------------------- 1 | - Various small fixes 2 | -------------------------------------------------------------------------------- /docs/release_notes/2.1.0.rst: -------------------------------------------------------------------------------- 1 | - Add ``{rivierapro, modelsim}_init_files.after_load`` 2 | sim_options. They allow setting a list of DO/TCL files to be 3 | executed during ``vunit_load`` after the top level has been loaded 4 | using the ``vsim`` command. 5 | - Add input validation to sim and compile options 6 | -------------------------------------------------------------------------------- /docs/release_notes/2.1.1.rst: -------------------------------------------------------------------------------- 1 | - Fix ``init_file(s)`` broken in 2.1.0 2 | - Fix test bench regex that could match \*_tb\*. :vunit_issue:`263` 3 | - Add external library sanity check. :vunit_issue:`230` 4 | - Add non-empty operation check. :vunit_issue:`250` 5 | -------------------------------------------------------------------------------- /docs/release_notes/2.2.0.rst: -------------------------------------------------------------------------------- 1 | - Add support for tokenizing verilog multi line strings. :vunit_issue:`278` 2 | - Added support for restarting window in check_stable 3 | - Added support for num_cks=0 in check_next. 4 | - Error on adding duplicate source files. :vunit_issue:`274` 5 | - Update Vivado example. 6 | - Add support for non-system-verilog verilog files. :vunit_issue:`268` 7 | - Add dependency scanning of the use of an instantiated package. :vunit_issue:`233` 8 | - Add human readable test output paths. :vunit_issue:`211` 9 | -------------------------------------------------------------------------------- /docs/release_notes/2.3.0.rst: -------------------------------------------------------------------------------- 1 | - Fix commas in Modelsim generics :vunit_issue:`284`. 2 | - Fix problem with vsim_extra_args between entity and architecture in riviera and activehdl. 3 | - Update Verilog preprocessor to read using latin-1 encoding. :vunit_issue:`285`. 4 | - Improve compile printouts :vunit_issue:`283`. 5 | - Add -q/--quiet flag. :vunit_issue:`283`. 6 | - Add printout of output file location. :vunit_issue:`283`. 7 | - Dropped support and testing of Python 3.3 (might still work anyway). 8 | - Fix of Modelsim `--coverage` argument :vunit_issue:`288`. 9 | -------------------------------------------------------------------------------- /docs/release_notes/2.4.0.rst: -------------------------------------------------------------------------------- 1 | - Ignore test cases in SystemVerilog comments. 2 | - Make integer_array_t metadata get-functions public. 3 | - dictionary: add default value option to get function. 4 | - Improve get_implementation_subset :vunit_issue:`286`. 5 | -------------------------------------------------------------------------------- /docs/release_notes/2.4.1.rst: -------------------------------------------------------------------------------- 1 | - SystemVerilog: Fix WATCHDOG macro with local timescale set :vunit_issue:`299`. 2 | -------------------------------------------------------------------------------- /docs/release_notes/2.4.2.rst: -------------------------------------------------------------------------------- 1 | - SystemVerilog: Allow MACRO argument within ({[]}). :vunit_issue:`300`. 2 | -------------------------------------------------------------------------------- /docs/release_notes/2.4.3.rst: -------------------------------------------------------------------------------- 1 | - SystemVerilog: Fix dependency scanning with instance directly after block label :vunit_issue:`305`. 2 | -------------------------------------------------------------------------------- /docs/release_notes/3.0.0.rst: -------------------------------------------------------------------------------- 1 | - *beta* version of a :ref:`verification component ` library. 2 | 3 | - AXI read/write slaves 4 | - Memory model 5 | - AXI master 6 | - AXI stream 7 | - UART RX/TX 8 | - (B)RAM master 9 | 10 | - Hiearchical and color logging support. 11 | 12 | - Communication library usability improvements. 13 | 14 | - Push/pop message creation and debugging tools. 15 | -------------------------------------------------------------------------------- /docs/release_notes/3.0.1.rst: -------------------------------------------------------------------------------- 1 | - Replace deprecated aliases with constants to work around Sigasi-limitation. 2 | -------------------------------------------------------------------------------- /docs/release_notes/3.0.2.rst: -------------------------------------------------------------------------------- 1 | - Added is_empty on queues 2 | - Documented queue_t and integer_array_t 3 | - Fixed memory leak 4 | 5 | -------------------------------------------------------------------------------- /docs/release_notes/3.0.3.rst: -------------------------------------------------------------------------------- 1 | - Add ``check_equal`` for real with ``max_diff`` 2 | - Improve ``com`` library performance 3 | - Added support for message forwarding 4 | - Improve axi stream verification components 5 | - Add wishbone verification component 6 | - Protect against unexpected mutation of compile and sim options 7 | -------------------------------------------------------------------------------- /docs/release_notes/3.1.0.rst: -------------------------------------------------------------------------------- 1 | - Add ``--fail-fast`` CLI argument to stop on first test failure. 2 | - Delay simulator selection until VUnit class instantiation instead of import 3 | - Add ``post_run`` to VUnit main. 4 | - Add ``disable_coverage`` compile option. 5 | - Improve AXI read/write slaves 6 | 7 | - Add debug logging 8 | - Add setting of stall, fifo depth and response latency 9 | - Add burst length statistics 10 | 11 | - Improve AXI-lite master 12 | 13 | - Add debug logging 14 | -------------------------------------------------------------------------------- /docs/release_notes/3.2.0.rst: -------------------------------------------------------------------------------- 1 | - Add ``output`` argument to ``post_check``. :vunit_issue:`332` 2 | -------------------------------------------------------------------------------- /docs/release_notes/3.3.0.rst: -------------------------------------------------------------------------------- 1 | - Add SystemVerilog support for test benches without test cases. :vunit_issue:`328` 2 | - Graceful recovery and error message from failed VHDL parsing. 3 | - Stripping clean from re-compile command. 4 | - Add `JSON-for-VHDL `_ as a submodule. 5 | -------------------------------------------------------------------------------- /docs/release_notes/3.4.0.rst: -------------------------------------------------------------------------------- 1 | - Updated context files 2 | -------------------------------------------------------------------------------- /docs/release_notes/3.5.0.rst: -------------------------------------------------------------------------------- 1 | - Added the ability to specify actor for AXI stream masters and slaves 2 | - Added as_sync function to bus masters and AXI stream masters 3 | -------------------------------------------------------------------------------- /docs/release_notes/3.6.0.rst: -------------------------------------------------------------------------------- 1 | - Ignore files added twice with identical contents. Closes #341 2 | - Made queues type safe 3 | -------------------------------------------------------------------------------- /docs/release_notes/3.6.1.rst: -------------------------------------------------------------------------------- 1 | - Increase message id on publish 2 | -------------------------------------------------------------------------------- /docs/release_notes/3.6.2.rst: -------------------------------------------------------------------------------- 1 | - Fixed memory leak when popping messages from queues. 2 | -------------------------------------------------------------------------------- /docs/release_notes/3.7.0.rst: -------------------------------------------------------------------------------- 1 | - Fixed lint issues from new pylint version. 2 | - Log output of failed vsim startup to stderr. :vunit_issue:`354` 3 | - Allow case-insensitive lookup of entities. :vunit_issue:`#346` 4 | - Added vhdl_standard attribute at class initialization. :vunit_issue:`#350` 5 | - Adding csv mapping support for files and libraries. :vunit_issue:`349` 6 | - Fix broken vivado example wrt verilog headers. :vunit_issue:`344` 7 | - Allow adding duplicate libraries. :vunit_issue:`341` 8 | - Make adding duplicate file INFO instead of WARNING. :vunit_issue:`341` 9 | -------------------------------------------------------------------------------- /docs/release_notes/3.8.0.rst: -------------------------------------------------------------------------------- 1 | - Verification components 2 | - Avalon 3 | - Add Avalon memory mapped slave and master. :vunit_issue:`359` 4 | - Add Avalon stream source and sink. :vunit_issue:`361` 5 | - AXI 6 | - Add AXI stream monitor 7 | - Wishbone 8 | - Strict command order in wishbone master. :vunit_issue:`372` 9 | - Remove warnings when using built-in RivieraPRO libraries. :vunit_issue:`374` 10 | -------------------------------------------------------------------------------- /docs/release_notes/3.9.0.rst: -------------------------------------------------------------------------------- 1 | - Verification components 2 | - Avalon 3 | - Add Avalon streaming packet signals :vunit_issue:`383` 4 | - AXI 5 | - Various AXI BFM improvements. 6 | - Added special JUnit XML format for Bamboo CI server. :vunit_issue:`384` 7 | - Add support for requirements trace-ability via user defined test attributes. 8 | - Add ``--json--export`` flag to export list of all files and tests with associated attributes. 9 | - Add test case filtering for user defined attributes. 10 | - For example allows marking tests that should be run per commit or only every night. 11 | - Always use the most up to date version of modelsim.ini. 12 | -------------------------------------------------------------------------------- /docs/release_notes/4.0.0.rst: -------------------------------------------------------------------------------- 1 | - New coverage support: 2 | 3 | The ``--coverage`` flag has been removed in favor of exposing a 4 | more flexible :ref:`coverage interface `. The flag was 5 | was not flexible enough for many users and we decided to make a 6 | breaking change to get a better solution moving forward. An 7 | example of using the new interface can be found here 8 | :vunit_example:`here `. For users who liked the old 9 | flag VUnit supports adding :ref:`custom ` command line 10 | arguments. 11 | 12 | - Add ability to set watchdog timer dynamically. :vunit_issue:`400` 13 | 14 | - Skipping protected regions in the Verilog preprocessor. 15 | 16 | - Integrate utility to add Vivado IP to a VUnit project see :vunit_example:`example `. 17 | 18 | - Make tb_path work in combination with preprocessing. :vunit_issue:`402` 19 | -------------------------------------------------------------------------------- /docs/release_notes/4.0.1.rst: -------------------------------------------------------------------------------- 1 | - Set value to null when pushing pointer types in queue_t and com to avoid accidental dupliction of ownership. 2 | - Fix broken ram_master.vhd where the response messages where deleted to early. 3 | -------------------------------------------------------------------------------- /docs/release_notes/4.0.2.rst: -------------------------------------------------------------------------------- 1 | - Fix missing msg_type in push and pop of msg_t. 2 | - Ensure axi_lite_master always aligns with aclk to avoid VHDL/Verilog simulation mismatch. 3 | -------------------------------------------------------------------------------- /docs/release_notes/4.0.3.rst: -------------------------------------------------------------------------------- 1 | - Fix ``set_timeout`` for large values in ModelSim. :vunit_issue:`405` 2 | -------------------------------------------------------------------------------- /docs/release_notes/4.0.4.rst: -------------------------------------------------------------------------------- 1 | - Fix broken ActiveHDL support. 2 | -------------------------------------------------------------------------------- /docs/release_notes/4.0.5.rst: -------------------------------------------------------------------------------- 1 | - Make tb_path absolute again. :vunit_issue:`406` 2 | - Fix ``--export-json`` test location offets for DOS line endings. :vunit_issue:`437` 3 | -------------------------------------------------------------------------------- /docs/release_notes/4.0.6.rst: -------------------------------------------------------------------------------- 1 | - Fix a problem where sometimes multiple Ctrl-C where required to abort execution. :vunit_issue:`408` 2 | -------------------------------------------------------------------------------- /docs/release_notes/4.0.7.rst: -------------------------------------------------------------------------------- 1 | - Fix a problem parsing generics with string containing semi colon. :vunit_issue:`409` 2 | -------------------------------------------------------------------------------- /docs/release_notes/4.0.8.rst: -------------------------------------------------------------------------------- 1 | - Fix vivado submodule missing from release. :vunit_issue:`415` 2 | - Add support for checking AXI response in axi_lite_master 3 | - Fix bug with coverage flag not working with unique-sim in rivierapro 4 | - Support for Avalon-MM burst transfers 5 | - Unsure LICENSE_QUEUE environment variable is in effect for RivieraPRO 6 | -------------------------------------------------------------------------------- /docs/release_notes/4.1.0.rst: -------------------------------------------------------------------------------- 1 | - Enhancements to Stream VCI and AXI Stream VCs. (:vunit_issue:`420`, :vunit_issue:`422`, :vunit_issue:`429`, :vunit_issue:`483`) 2 | - Add option 'overwrite' to set_sim_option. (:vunit_issue:`471`) 3 | - ActiveHDL: add code coverage support. (:vunit_issue:`461`) 4 | - GtkWave: add sim option 'ghdl.init_file.gui'. (:vunit_issue:`459`) 5 | - GHDL: add boolean option ghdl.elab_e, to execute 'ghdl -e' only. (:vunit_issue:`467`) 6 | - GHDL: with VHDL 2008 nonzero return values produce a fail. (:vunit_issue:`469`) 7 | - Add experimental VHDL 2019 support. (:vunit_issue:`549`) 8 | -------------------------------------------------------------------------------- /docs/release_notes/4.2.0.rst: -------------------------------------------------------------------------------- 1 | - Add ``-m/--minimal`` flag to only compile what is necessary for selected tests. 2 | - Fix axi_stream VC for 0-length tid/tdest/tuser. 3 | - Fix work reference for non-lower case library names. :vunit_issue:`556` 4 | - Add ``init_files.before_run`` hook to RivieraPRO and ModelSim. 5 | - Do not add extra quotes when invoking a gtkwave subprocess. :vunit_issue:`563` 6 | -------------------------------------------------------------------------------- /docs/release_notes/4.3.0.rst: -------------------------------------------------------------------------------- 1 | - Fix broken ``vhdl_standard`` setting in some situations. :vunit_issue:`594` 2 | - Add 'external modes' (VHPIDIRECT) to ``string_ptr`` and ``integer_vector_ptr``; add ``byte_vector_prt`` too. :vunit_issue:`507` :vunit_issue:`476` 3 | - Add report data to ``Results`` object/class. :vunit_issue:`586` 4 | - Use a Python formatter: `psf/black `_. :vunit_issue:`554` 5 | - Refactor ``vunit/ui``, ``vunit/sim_if``, ``vunit/test`` and ``tests``. :vunit_issue:`572` :vunit_issue:`582` 6 | - Deprecate ``array_pkg``. It will be removed in future releases. Use :ref:`integer_array_pkg` instead. :vunit_issue:`593` 7 | - Python 3.4 reached End-of-life in 2019-03-18 and it is no longer tested. Support is expected to break in future releases. 8 | - Add support for Python 3.8. 9 | - Deprecate Python 2.7. This is the last release supporting Python 2 and Python 3. Upcoming releases will be for Python 3 only. 10 | -------------------------------------------------------------------------------- /docs/release_notes/5.0.0.dev2.rst: -------------------------------------------------------------------------------- 1 | 2 | Breaking Changes 3 | ~~~~~~~~~~~~~~~~ 4 | 5 | - Changed default values for unconnected tkeep and tstrb inputs for AXI stream VCs to match the standard: 6 | 7 | - tkeep changed from all zeros to all ones 8 | - tstrb changed from all zeros to value of tkeep 9 | 10 | May affect existing code if these values are verified by the testbench despite being unconnected. (:vunit_issue:`1049`) 11 | 12 | 13 | Bug Fixes 14 | ~~~~~~~~~ 15 | 16 | - Changed AXI stream slave to only verify tdata if both of tkeep and tstrb are set. Removed potential race condition an AXI stream master. (:vunit_issue:`1049`) 17 | -------------------------------------------------------------------------------- /docs/release_notes/5.0.0.dev3.rst: -------------------------------------------------------------------------------- 1 | 2 | Features 3 | ~~~~~~~~ 4 | 5 | - Added option to configure the logging simulation time format (unit and number of decimals). (:vunit_issue:`1044`) 6 | - Added support for setting ``run_all_in_same_sim`` and ``fail_on_warning attributes`` from Python. (:vunit_issue:`1053`) 7 | -------------------------------------------------------------------------------- /docs/release_notes/5.0.0.dev5.rst: -------------------------------------------------------------------------------- 1 | 2 | Bug Fixes 3 | ~~~~~~~~~ 4 | 5 | - Added workarounds for Visualizer restart and stability issues. (:vunit_issue:`899`) 6 | - Fixed array_axis_vcs example. (:vunit_issue:`1082`) 7 | 8 | 9 | Deprecations 10 | ~~~~~~~~~~~~ 11 | 12 | - Dropped support for Python 3.7 which reached end-of-life mid 2023. (:vunit_issue:`1091`) 13 | 14 | 15 | Features 16 | ~~~~~~~~ 17 | 18 | - Provided a unique base seed to every simulation. From that base seed any number of unique seed can derived 19 | to initialize the random number generators in the testbench. Unique seeds increase the test coverage for 20 | randomized tests over time as they are executed repeatedly by the user and the CI. The seed can be overrideen 21 | from the command line with the --seed option in order to reproduce failing tests. (:vunit_issue:`1089`) 22 | 23 | 24 | Miscellaneous 25 | ~~~~~~~~~~~~~ 26 | 27 | - Added shebang to setup.py. (:vunit_issue:`1078`) 28 | - Updated the setup GHDL action used in the GitHub CI. (:vunit_issue:`1092`) 29 | -------------------------------------------------------------------------------- /docs/run/img/get_seed_and_runner_cfg.html: -------------------------------------------------------------------------------- 1 |
constant global_seed : string := get_seed(runner_cfg, "Optional salt");
2 | 
3 | -------------------------------------------------------------------------------- /docs/run/img/get_seed_wo_runner_cfg.html: -------------------------------------------------------------------------------- 1 |
randomizing_process : process is
2 |   variable local_seed : string_seed_t; -- string_seed_t = string(1 to 16)
3 | begin
4 |   get_seed(local_seed, salt => randomizing_process'path_name);
5 | 
6 | -------------------------------------------------------------------------------- /docs/run/img/get_uniform_seed.html: -------------------------------------------------------------------------------- 1 |
get_uniform_seed(seed1, seed2, "Optional salt");
2 | 
3 | uniform(seed1, seed2, a_random_value);
4 | uniform(seed1, seed2, another_random_value);
5 | 
6 | -------------------------------------------------------------------------------- /docs/run/img/seed_option.html: -------------------------------------------------------------------------------- 1 |
> python run.py "lib.tb_seed.Test that fails" --seed fb19f3cca859d69c
2 | -------------------------------------------------------------------------------- /docs/run/img/tb_minimal_stdout.html: -------------------------------------------------------------------------------- 1 |
> python run.py
 2 | Starting lib.tb_minimal.all
 3 | Output file: C:\github\vunit\docs\run\src\vunit_out\test_output\lib.tb_minimal.all_42aa262c7c96c708ab3f3960f033f2328c642136\output.txt
 4 | pass (P=1 S=0 F=0 T=1) lib.tb_minimal.all (0.6 s)
 5 | 
 6 | ==== Summary ==============================
 7 | pass lib.tb_minimal.all (0.6 s)
 8 | ===========================================
 9 | pass 1 of 1
10 | ===========================================
11 | Total time was 0.6 s
12 | Elapsed time was 0.6 s
13 | ===========================================
14 | All passed!
15 | 
16 | -------------------------------------------------------------------------------- /docs/run/src/tb_magic_paths.vhd: -------------------------------------------------------------------------------- 1 | -- This Source Code Form is subject to the terms of the Mozilla Public 2 | -- License, v. 2.0. If a copy of the MPL was not distributed with this file, 3 | -- You can obtain one at http://mozilla.org/MPL/2.0/. 4 | -- 5 | -- Copyright (c) 2014-2025, Lars Asplund lars.anders.asplund@gmail.com 6 | 7 | -- start_snippet tb_magic_paths 8 | library vunit_lib; 9 | context vunit_lib.vunit_context; 10 | 11 | entity tb_magic_paths is 12 | generic (runner_cfg : string); 13 | end entity; 14 | 15 | architecture tb of tb_magic_paths is 16 | begin 17 | test_runner : process 18 | begin 19 | test_runner_setup(runner, runner_cfg); 20 | info("Directory containing testbench: " & tb_path(runner_cfg)); 21 | info("Test output directory: " & output_path(runner_cfg)); 22 | test_runner_cleanup(runner); 23 | end process; 24 | end architecture; 25 | -- end_snippet tb_magic_paths 26 | -------------------------------------------------------------------------------- /docs/run/src/tb_minimal.vhd: -------------------------------------------------------------------------------- 1 | -- This Source Code Form is subject to the terms of the Mozilla Public 2 | -- License, v. 2.0. If a copy of the MPL was not distributed with this file, 3 | -- You can obtain one at http://mozilla.org/MPL/2.0/. 4 | -- 5 | -- Copyright (c) 2014-2025, Lars Asplund lars.anders.asplund@gmail.com 6 | 7 | -- start_snippet tb_minimal 8 | library vunit_lib; 9 | context vunit_lib.vunit_context; 10 | 11 | entity tb_minimal is 12 | generic (runner_cfg : string); 13 | end entity; 14 | 15 | architecture tb of tb_minimal is 16 | begin 17 | test_runner : process 18 | begin 19 | test_runner_setup(runner, runner_cfg); 20 | check_equal(to_string(17), "17"); 21 | test_runner_cleanup(runner); 22 | end process; 23 | end architecture; 24 | -- end_snippet tb_minimal 25 | -------------------------------------------------------------------------------- /docs/run/src/tb_stop_level.vhd: -------------------------------------------------------------------------------- 1 | -- This Source Code Form is subject to the terms of the Mozilla Public 2 | -- License, v. 2.0. If a copy of the MPL was not distributed with this file, 3 | -- You can obtain one at http://mozilla.org/MPL/2.0/. 4 | -- 5 | -- Copyright (c) 2014-2025, Lars Asplund lars.anders.asplund@gmail.com 6 | 7 | library vunit_lib; 8 | context vunit_lib.vunit_context; 9 | 10 | entity tb_stop_level is 11 | generic(runner_cfg : string); 12 | end entity; 13 | 14 | architecture tb of tb_stop_level is 15 | begin 16 | -- start_snippet tb_stop_level 17 | test_runner : process 18 | begin 19 | test_runner_setup(runner, runner_cfg); 20 | set_stop_level(failure); 21 | 22 | while test_suite loop 23 | if run("Test that fails multiple times but doesn't stop") then 24 | check_equal(17, 18); 25 | check_equal(17, 19); 26 | end if; 27 | end loop; 28 | 29 | test_runner_cleanup(runner); 30 | end process; 31 | -- end_snippet tb_stop_level 32 | end; 33 | -------------------------------------------------------------------------------- /docs/run/src/tb_with_lower_level_control.vhd: -------------------------------------------------------------------------------- 1 | -- This Source Code Form is subject to the terms of the Mozilla Public 2 | -- License, v. 2.0. If a copy of the MPL was not distributed with this file, 3 | -- You can obtain one at http://mozilla.org/MPL/2.0/. 4 | -- 5 | -- Copyright (c) 2014-2025, Lars Asplund lars.anders.asplund@gmail.com 6 | 7 | -- start_snippet tb_with_lower_level_control 8 | library vunit_lib; 9 | context vunit_lib.vunit_context; 10 | 11 | entity tb_with_lower_level_control is 12 | generic (runner_cfg : string); 13 | end entity; 14 | 15 | architecture tb of tb_with_lower_level_control is 16 | begin 17 | 18 | test_control: entity work.test_control 19 | generic map ( 20 | nested_runner_cfg => runner_cfg); 21 | 22 | end architecture; 23 | -- end_snippet tb_with_lower_level_control 24 | -------------------------------------------------------------------------------- /docs/run/src/test_control.vhd: -------------------------------------------------------------------------------- 1 | -- This Source Code Form is subject to the terms of the Mozilla Public 2 | -- License, v. 2.0. If a copy of the MPL was not distributed with this file, 3 | -- You can obtain one at http://mozilla.org/MPL/2.0/. 4 | -- 5 | -- Copyright (c) 2014-2025, Lars Asplund lars.anders.asplund@gmail.com 6 | 7 | -- start_snippet test_control 8 | library vunit_lib; 9 | context vunit_lib.vunit_context; 10 | 11 | entity test_control is 12 | generic ( 13 | nested_runner_cfg : string); 14 | end entity test_control; 15 | 16 | architecture tb of test_control is 17 | begin 18 | test_runner : process 19 | begin 20 | test_runner_setup(runner, nested_runner_cfg); 21 | 22 | while test_suite loop 23 | if run("Test something") then 24 | info("Testing something"); 25 | elsif run("Test something else") then 26 | info("Testing something else"); 27 | end if; 28 | end loop; 29 | 30 | test_runner_cleanup(runner); 31 | end process; 32 | end architecture tb; 33 | -- end_snippet test_control 34 | -------------------------------------------------------------------------------- /docs/testimonials/airhdl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VUnit/vunit/4e30fa124ea84609af0f957dbc55b82adaed1d76/docs/testimonials/airhdl.png -------------------------------------------------------------------------------- /docs/testimonials/autoliv.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VUnit/vunit/4e30fa124ea84609af0f957dbc55b82adaed1d76/docs/testimonials/autoliv.png -------------------------------------------------------------------------------- /docs/testimonials/ci_csn_khai_edu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VUnit/vunit/4e30fa124ea84609af0f957dbc55b82adaed1d76/docs/testimonials/ci_csn_khai_edu.png -------------------------------------------------------------------------------- /docs/testimonials/effective_coding.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VUnit/vunit/4e30fa124ea84609af0f957dbc55b82adaed1d76/docs/testimonials/effective_coding.png -------------------------------------------------------------------------------- /docs/testimonials/pluralsight.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VUnit/vunit/4e30fa124ea84609af0f957dbc55b82adaed1d76/docs/testimonials/pluralsight.png -------------------------------------------------------------------------------- /docs/testimonials/sigasi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VUnit/vunit/4e30fa124ea84609af0f957dbc55b82adaed1d76/docs/testimonials/sigasi.png -------------------------------------------------------------------------------- /docs/testimonials/synective_labs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VUnit/vunit/4e30fa124ea84609af0f957dbc55b82adaed1d76/docs/testimonials/synective_labs.png -------------------------------------------------------------------------------- /docs/testimonials/vhdl-2017.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VUnit/vunit/4e30fa124ea84609af0f957dbc55b82adaed1d76/docs/testimonials/vhdl-2017.png -------------------------------------------------------------------------------- /docs/verification_components/vci.rst: -------------------------------------------------------------------------------- 1 | .. _bus_master_vci: 2 | 3 | Bus Master VCI 4 | ============== 5 | 6 | .. literalinclude:: ../../vunit/vhdl/verification_components/src/bus_master_pkg.vhd 7 | :caption: Bus master verification component interface 8 | :language: vhdl 9 | :lines: 7- 10 | 11 | .. _stream_vci: 12 | 13 | Stream Master VCI 14 | ================= 15 | 16 | .. literalinclude:: ../../vunit/vhdl/verification_components/src/stream_master_pkg.vhd 17 | :caption: Stream master verification component interface 18 | :language: vhdl 19 | :lines: 7- 20 | 21 | Stream Slave VCI 22 | ================ 23 | 24 | .. literalinclude:: ../../vunit/vhdl/verification_components/src/stream_slave_pkg.vhd 25 | :caption: Stream slave verification component interface 26 | :language: vhdl 27 | :lines: 7- 28 | 29 | .. _sync_vci: 30 | 31 | Synchronization VCI 32 | =================== 33 | 34 | .. literalinclude:: ../../vunit/vhdl/verification_components/src/sync_pkg.vhd 35 | :caption: Synchronization verification component interface 36 | :language: vhdl 37 | :lines: 7- 38 | -------------------------------------------------------------------------------- /examples/verilog/uart/run.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | # This Source Code Form is subject to the terms of the Mozilla Public 4 | # License, v. 2.0. If a copy of the MPL was not distributed with this file, 5 | # You can obtain one at http://mozilla.org/MPL/2.0/. 6 | # 7 | # Copyright (c) 2014-2025, Lars Asplund lars.anders.asplund@gmail.com 8 | 9 | """ 10 | SystemVerilog UART 11 | ------------------ 12 | 13 | A more realistic test bench of an UART to show VUnit SystemVerilog 14 | usage on a typical module. 15 | """ 16 | 17 | from pathlib import Path 18 | from vunit import VUnit 19 | 20 | SRC_PATH = Path(__file__).parent / "src" 21 | 22 | VU = VUnit.from_argv() 23 | VU.add_verilog_builtins() 24 | 25 | VU.add_library("uart_lib").add_source_files(SRC_PATH / "*.sv") 26 | VU.add_library("tb_uart_lib").add_source_files(SRC_PATH / "test" / "*.sv") 27 | 28 | VU.main() 29 | -------------------------------------------------------------------------------- /examples/verilog/user_guide/run.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | # This Source Code Form is subject to the terms of the Mozilla Public 4 | # License, v. 2.0. If a copy of the MPL was not distributed with this file, 5 | # You can obtain one at http://mozilla.org/MPL/2.0/. 6 | # 7 | # Copyright (c) 2014-2025, Lars Asplund lars.anders.asplund@gmail.com 8 | 9 | """ 10 | SystemVerilog User Guide 11 | ------------------------ 12 | 13 | The most minimal VUnit SystemVerilog project covering the basics of 14 | the :ref:`User Guide `. 15 | """ 16 | 17 | from pathlib import Path 18 | from vunit import VUnit 19 | 20 | ROOT = Path(__file__).parent 21 | 22 | VU = VUnit.from_argv() 23 | VU.add_verilog_builtins() 24 | 25 | VU.add_library("lib").add_source_files(ROOT / "*.sv") 26 | 27 | VU.main() 28 | -------------------------------------------------------------------------------- /examples/verilog/user_guide/tb_example_basic.sv: -------------------------------------------------------------------------------- 1 | // This Source Code Form is subject to the terms of the Mozilla Public 2 | // License, v. 2.0. If a copy of the MPL was not distributed with this file, 3 | // You can obtain one at http://mozilla.org/MPL/2.0/. 4 | // 5 | // Copyright (c) 2014-2025, Lars Asplund lars.anders.asplund@gmail.com 6 | 7 | // You do not need to worry about adding vunit_defines.svh to your 8 | // include path, VUnit will automatically do that for you if VUnit is 9 | // correctly installed (and your python run-script is correct). 10 | `include "vunit_defines.svh" 11 | 12 | module tb_example_basic; 13 | `TEST_SUITE begin 14 | // It is possible to create a basic test bench without any test cases 15 | $display("Hello world"); 16 | end; 17 | 18 | endmodule 19 | -------------------------------------------------------------------------------- /examples/verilog/verilog_ams/dut.vams: -------------------------------------------------------------------------------- 1 | module dut(vout); 2 | output wreal vout; 3 | assign vout = 3.0; 4 | endmodule 5 | -------------------------------------------------------------------------------- /examples/verilog/verilog_ams/run.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | # This Source Code Form is subject to the terms of the Mozilla Public 4 | # License, v. 2.0. If a copy of the MPL was not distributed with this file, 5 | # You can obtain one at http://mozilla.org/MPL/2.0/. 6 | # 7 | # Copyright (c) 2014-2025, Lars Asplund lars.anders.asplund@gmail.com 8 | 9 | from pathlib import Path 10 | from vunit import VUnit 11 | 12 | ROOT = Path(__file__).parent 13 | 14 | VU = VUnit.from_argv() 15 | VU.add_verilog_builtins() 16 | 17 | LIB = VU.add_library("lib") 18 | LIB.add_source_files(ROOT / "*.sv") 19 | LIB.add_source_files(ROOT / "*.vams").set_compile_option("modelsim.vlog_flags", ["-ams"]) 20 | 21 | VU.main() 22 | -------------------------------------------------------------------------------- /examples/verilog/verilog_ams/tb_dut.sv: -------------------------------------------------------------------------------- 1 | // This Source Code Form is subject to the terms of the Mozilla Public 2 | // License, v. 2.0. If a copy of the MPL was not distributed with this file, 3 | // You can obtain one at http://mozilla.org/MPL/2.0/. 4 | // 5 | // Copyright (c) 2014-2025, Lars Asplund lars.anders.asplund@gmail.com 6 | 7 | `include "vunit_defines.svh" 8 | 9 | module tb_dut; 10 | var real vout; 11 | 12 | `TEST_SUITE begin 13 | `TEST_CASE("Test that pass") begin 14 | @(vout); 15 | `CHECK_EQUAL(vout, 3.0); 16 | end 17 | 18 | `TEST_CASE("Test that fail") begin 19 | @(vout); 20 | `CHECK_EQUAL(vout, 2.0); 21 | end 22 | end; 23 | 24 | dut dut_inst(.vout(vout)); 25 | 26 | `WATCHDOG(1ms); 27 | endmodule 28 | -------------------------------------------------------------------------------- /examples/vhdl/array/run.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | # This Source Code Form is subject to the terms of the Mozilla Public 4 | # License, v. 2.0. If a copy of the MPL was not distributed with this file, 5 | # You can obtain one at http://mozilla.org/MPL/2.0/. 6 | # 7 | # Copyright (c) 2014-2025, Lars Asplund lars.anders.asplund@gmail.com 8 | 9 | """ 10 | Array 11 | ----- 12 | 13 | Demonstrates the ``integer_array_t`` data type, which can be used to 14 | handle dynamically sized 1D, 2D and 3D data as well as storing and 15 | loading it from csv and raw files. 16 | """ 17 | 18 | from pathlib import Path 19 | from vunit import VUnit 20 | 21 | VU = VUnit.from_argv() 22 | VU.add_vhdl_builtins() 23 | VU.add_osvvm() 24 | 25 | SRC_PATH = Path(__file__).parent / "src" 26 | 27 | VU.add_library("lib").add_source_files([SRC_PATH / "*.vhd", SRC_PATH / "test" / "*.vhd"]) 28 | 29 | VU.set_compile_option("ghdl.a_flags", ["-frelaxed"]) 30 | VU.set_sim_option("ghdl.elab_flags", ["-frelaxed"]) 31 | 32 | VU.set_compile_option("nvc.a_flags", ["--relaxed"]) 33 | 34 | VU.main() 35 | -------------------------------------------------------------------------------- /examples/vhdl/array/src/test/input.csv: -------------------------------------------------------------------------------- 1 | 1, 2, 3, 4, 5, 6 2 | 1, 1, 5, 5, 1, 1 3 | -------------------------------------------------------------------------------- /examples/vhdl/array/src/test/output.csv: -------------------------------------------------------------------------------- 1 | 1, 2, 2, 2, 2, 1 2 | 0, 4, 4, -4, -4, 0 -------------------------------------------------------------------------------- /examples/vhdl/array_axis_vcs/runall_addwave.do: -------------------------------------------------------------------------------- 1 | echo "Running DO File" 2 | foreach v "uut_vc/vunit_axism uut_vc/vunit_axiss uut_vc/uut uut_vc/uut/fifo" { 3 | add wave -group "$v" -position insertpoint sim:/tb_axis_loop/$v/* 4 | } 5 | run -all; 6 | -------------------------------------------------------------------------------- /examples/vhdl/array_axis_vcs/src/test/data/in.csv: -------------------------------------------------------------------------------- 1 | 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19 2 | 256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275 3 | 512,513,514,515,516,517,518,519,520,521,522,523,524,525,526,527,528,529,530,531 4 | 768,769,770,771,772,773,774,775,776,777,778,779,780,781,782,783,784,785,786,787 5 | 1024,1025,1026,1027,1028,1029,1030,1031,1032,1033,1034,1035,1036,1037,1038,1039,1040,1041,1042,1043 6 | 1280,1281,1282,1283,1284,1285,1286,1287,1288,1289,1290,1291,1292,1293,1294,1295,1296,1297,1298,1299 7 | 1536,1537,1538,1539,1540,1541,1542,1543,1544,1545,1546,1547,1548,1549,1550,1551,1552,1553,1554,1555 8 | 1792,1793,1794,1795,1796,1797,1798,1799,1800,1801,1802,1803,1804,1805,1806,1807,1808,1809,1810,1811 9 | 2048,2049,2050,2051,2052,2053,2054,2055,2056,2057,2058,2059,2060,2061,2062,2063,2064,2065,2066,2067 10 | 2304,2305,2306,2307,2308,2309,2310,2311,2312,2313,2314,2315,2316,2317,2318,2319,2320,2321,2322,2323 11 | -------------------------------------------------------------------------------- /examples/vhdl/axi_dma/run.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | # This Source Code Form is subject to the terms of the Mozilla Public 4 | # License, v. 2.0. If a copy of the MPL was not distributed with this file, 5 | # You can obtain one at http://mozilla.org/MPL/2.0/. 6 | # 7 | # Copyright (c) 2014-2025, Lars Asplund lars.anders.asplund@gmail.com 8 | 9 | """ 10 | AXI DMA 11 | ------- 12 | 13 | Demonstrates the AXI read and write slave verification components as 14 | well as the AXI-lite master verification component. An AXI DMA is 15 | verified which uses an AXI master port to read and write data from 16 | external memory. The AXI DMA also has a control register interface 17 | via AXI-lite. 18 | """ 19 | 20 | from pathlib import Path 21 | from vunit import VUnit 22 | 23 | VU = VUnit.from_argv() 24 | VU.add_vhdl_builtins() 25 | VU.add_osvvm() 26 | VU.add_verification_components() 27 | 28 | SRC_PATH = Path(__file__).parent / "src" 29 | 30 | VU.add_library("axi_dma_lib").add_source_files([SRC_PATH / "*.vhd", SRC_PATH / "test" / "*.vhd"]) 31 | 32 | VU.main() 33 | -------------------------------------------------------------------------------- /examples/vhdl/com/run.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | # This Source Code Form is subject to the terms of the Mozilla Public 4 | # License, v. 2.0. If a copy of the MPL was not distributed with this file, 5 | # You can obtain one at http://mozilla.org/MPL/2.0/. 6 | # 7 | # Copyright (c) 2014-2025, Lars Asplund lars.anders.asplund@gmail.com 8 | 9 | """ 10 | Communication library 11 | --------------------- 12 | 13 | Demonstrates the ``com`` message passing package which can be used 14 | to communicate arbitrary objects between processes. Further reading 15 | can be found in the :ref:`com user guide `. 16 | """ 17 | 18 | from pathlib import Path 19 | from vunit import VUnit 20 | 21 | VU = VUnit.from_argv() 22 | VU.add_vhdl_builtins() 23 | VU.add_com() 24 | VU.add_verification_components() 25 | VU.add_osvvm() 26 | 27 | ROOT = Path(__file__).parent 28 | 29 | VU.add_library("lib").add_source_files(ROOT / "src" / "*.vhd") 30 | VU.add_library("tb_lib").add_source_files(ROOT / "test" / "*.vhd") 31 | 32 | VU.main() 33 | -------------------------------------------------------------------------------- /examples/vhdl/com/src/adder.vhd: -------------------------------------------------------------------------------- 1 | -- This Source Code Form is subject to the terms of the Mozilla Public 2 | -- License, v. 2.0. If a copy of the MPL was not distributed with this file, 3 | -- You can obtain one at http://mozilla.org/MPL/2.0/. 4 | -- 5 | -- Copyright (c) 2014-2025, Lars Asplund lars.anders.asplund@gmail.com 6 | 7 | library ieee; 8 | use ieee.std_logic_1164.all; 9 | use ieee.numeric_std.all; 10 | 11 | entity adder is 12 | port( 13 | clk : in std_logic; 14 | op_a : in unsigned(7 downto 0); 15 | op_b : in unsigned(7 downto 0); 16 | dv_in : in std_logic; 17 | sum : out unsigned(8 downto 0); 18 | dv_out : out std_logic 19 | ); 20 | end entity adder; 21 | 22 | architecture a of adder is 23 | begin 24 | main : process is 25 | begin 26 | wait until rising_edge(clk); 27 | sum <= resize(op_a, sum) + resize(op_b, sum); 28 | dv_out <= dv_in; 29 | end process main; 30 | end architecture a; 31 | -------------------------------------------------------------------------------- /examples/vhdl/coverage/tb_coverage.vhd: -------------------------------------------------------------------------------- 1 | -- This Source Code Form is subject to the terms of the Mozilla Public 2 | -- License, v. 2.0. If a copy of the MPL was not distributed with this file, 3 | -- You can obtain one at http://mozilla.org/MPL/2.0/. 4 | -- 5 | -- Copyright (c) 2014-2025, Lars Asplund lars.anders.asplund@gmail.com 6 | 7 | package pkg is 8 | attribute attr : string; 9 | end package; 10 | 11 | library vunit_lib; 12 | context vunit_lib.vunit_context; 13 | 14 | 15 | use work.pkg.attr; 16 | 17 | entity tb_coverage is 18 | generic (runner_cfg : string); 19 | end entity; 20 | 21 | architecture tb of tb_coverage is 22 | begin 23 | main : process 24 | begin 25 | test_runner_setup(runner, runner_cfg); 26 | if false then 27 | report "Never reached"; 28 | end if; 29 | 30 | if true then 31 | report "Hello"; 32 | end if; 33 | test_runner_cleanup(runner); -- Simulation ends here 34 | end process; 35 | end architecture; 36 | -------------------------------------------------------------------------------- /examples/vhdl/docker_runall.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | cd $(dirname "$0") 4 | 5 | docker run --rm -t \ 6 | -v /$(pwd)/../..://work \ 7 | -w //work/examples/vhdl \ 8 | -e PYTHONPATH=//work \ 9 | ghdl/vunit:llvm-master sh -c ' \ 10 | VUNIT_SIMULATOR=ghdl; \ 11 | for f in `find ./ -name run.py`; do \ 12 | if [ -d "vunit_out" ]; then rm -rf vunit_out; fi; \ 13 | python3 $f; \ 14 | done \ 15 | ' 16 | -------------------------------------------------------------------------------- /examples/vhdl/json4vhdl/src/test/data/data.json: -------------------------------------------------------------------------------- 1 | { 2 | "Image": [640, 480], 3 | "Platform": { 4 | "ML505": { 5 | "FPGA": "XC5VLX50T-1FF1136" 6 | }, 7 | "KC705": { 8 | "FPGA": "XC7K325T-2FFG900C", 9 | "IIC": [{ 10 | "Type": "Switch", 11 | "Adr": "0x85", 12 | "Devices": [{ 13 | "Name": "Si570", 14 | "Address": "0x3A" 15 | }] 16 | }] 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /examples/vhdl/logging/run.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | # This Source Code Form is subject to the terms of the Mozilla Public 4 | # License, v. 2.0. If a copy of the MPL was not distributed with this file, 5 | # You can obtain one at http://mozilla.org/MPL/2.0/. 6 | # 7 | # Copyright (c) 2014-2025, Lars Asplund lars.anders.asplund@gmail.com 8 | 9 | """ 10 | Logging 11 | ------- 12 | 13 | Demonstrates VUnit's support for logging. 14 | """ 15 | 16 | from pathlib import Path 17 | from vunit import VUnit 18 | 19 | VU = VUnit.from_argv() 20 | VU.add_vhdl_builtins() 21 | 22 | VU.add_library("lib").add_source_files(Path(__file__).parent / "*.vhd") 23 | 24 | VU.main() 25 | -------------------------------------------------------------------------------- /examples/vhdl/run/run.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | # This Source Code Form is subject to the terms of the Mozilla Public 4 | # License, v. 2.0. If a copy of the MPL was not distributed with this file, 5 | # You can obtain one at http://mozilla.org/MPL/2.0/. 6 | # 7 | # Copyright (c) 2014-2025, Lars Asplund lars.anders.asplund@gmail.com 8 | 9 | """ 10 | Run 11 | --- 12 | 13 | Demonstrates the VUnit run library. 14 | """ 15 | 16 | from pathlib import Path 17 | from vunit import VUnit 18 | 19 | root = Path(__file__).parent 20 | 21 | vu = VUnit.from_argv() 22 | vu.add_vhdl_builtins() 23 | 24 | lib = vu.add_library("lib") 25 | lib.add_source_files(root / "*.vhd") 26 | lib.test_bench("tb_with_lower_level_control").scan_tests_from_file(root / "test_control.vhd") 27 | 28 | vu.main() 29 | -------------------------------------------------------------------------------- /examples/vhdl/run/tb_counting_errors.vhd: -------------------------------------------------------------------------------- 1 | -- This Source Code Form is subject to the terms of the Mozilla Public 2 | -- License, v. 2.0. If a copy of the MPL was not distributed with this file, 3 | -- You can obtain one at http://mozilla.org/MPL/2.0/. 4 | -- 5 | -- Copyright (c) 2014-2025, Lars Asplund lars.anders.asplund@gmail.com 6 | 7 | library vunit_lib; 8 | context vunit_lib.vunit_context; 9 | 10 | entity tb_counting_errors is 11 | generic (runner_cfg : string := runner_cfg_default); 12 | end entity; 13 | 14 | architecture tb of tb_counting_errors is 15 | begin 16 | test_runner : process 17 | begin 18 | test_runner_setup(runner, runner_cfg); 19 | set_stop_level(failure); 20 | 21 | while test_suite loop 22 | if run("Test that fails multiple times but doesn't stop") then 23 | check_equal(17, 18); 24 | check_equal(17, 19); 25 | end if; 26 | end loop; 27 | 28 | test_runner_cleanup(runner); 29 | end process; 30 | end architecture; 31 | -------------------------------------------------------------------------------- /examples/vhdl/run/tb_magic_paths.vhd: -------------------------------------------------------------------------------- 1 | -- This Source Code Form is subject to the terms of the Mozilla Public 2 | -- License, v. 2.0. If a copy of the MPL was not distributed with this file, 3 | -- You can obtain one at http://mozilla.org/MPL/2.0/. 4 | -- 5 | -- Copyright (c) 2014-2025, Lars Asplund lars.anders.asplund@gmail.com 6 | 7 | library vunit_lib; 8 | context vunit_lib.vunit_context; 9 | 10 | entity tb_magic_paths is 11 | generic (runner_cfg : string); 12 | end entity; 13 | 14 | architecture tb of tb_magic_paths is 15 | begin 16 | test_runner : process 17 | begin 18 | test_runner_setup(runner, runner_cfg); 19 | info("Directory containing testbench: " & tb_path(runner_cfg)); 20 | info("Test output directory: " & output_path(runner_cfg)); 21 | test_runner_cleanup(runner); 22 | end process; 23 | end architecture; 24 | -------------------------------------------------------------------------------- /examples/vhdl/run/tb_minimal.vhd: -------------------------------------------------------------------------------- 1 | -- This Source Code Form is subject to the terms of the Mozilla Public 2 | -- License, v. 2.0. If a copy of the MPL was not distributed with this file, 3 | -- You can obtain one at http://mozilla.org/MPL/2.0/. 4 | -- 5 | -- Copyright (c) 2014-2025, Lars Asplund lars.anders.asplund@gmail.com 6 | 7 | library vunit_lib; 8 | context vunit_lib.vunit_context; 9 | 10 | entity tb_minimal is 11 | generic (runner_cfg : string := runner_cfg_default); 12 | end entity; 13 | 14 | architecture tb of tb_minimal is 15 | begin 16 | test_runner : process 17 | begin 18 | test_runner_setup(runner, runner_cfg); 19 | check_equal(to_string(17), "17"); 20 | test_runner_cleanup(runner); 21 | end process; 22 | end architecture; 23 | -------------------------------------------------------------------------------- /examples/vhdl/run/tb_standalone.vhd: -------------------------------------------------------------------------------- 1 | -- This Source Code Form is subject to the terms of the Mozilla Public 2 | -- License, v. 2.0. If a copy of the MPL was not distributed with this file, 3 | -- You can obtain one at http://mozilla.org/MPL/2.0/. 4 | -- 5 | -- Copyright (c) 2014-2025, Lars Asplund lars.anders.asplund@gmail.com 6 | 7 | library vunit_lib; 8 | context vunit_lib.vunit_context; 9 | 10 | entity tb_standalone is 11 | generic (runner_cfg : string := runner_cfg_default); 12 | end entity; 13 | 14 | architecture tb of tb_standalone is 15 | begin 16 | test_runner : process 17 | begin 18 | test_runner_setup(runner, runner_cfg); 19 | 20 | while test_suite loop 21 | if run("Test that fails on VUnit check procedure") then 22 | check_equal(17, 18); 23 | elsif run("Test to_string for boolean") then 24 | check_equal(to_string(true), "true"); 25 | end if; 26 | end loop; 27 | 28 | info("===Summary===" & LF & to_string(get_checker_stat)); 29 | 30 | test_runner_cleanup(runner); 31 | end process; 32 | end architecture; 33 | -------------------------------------------------------------------------------- /examples/vhdl/run/tb_with_lower_level_control.vhd: -------------------------------------------------------------------------------- 1 | -- This Source Code Form is subject to the terms of the Mozilla Public 2 | -- License, v. 2.0. If a copy of the MPL was not distributed with this file, 3 | -- You can obtain one at http://mozilla.org/MPL/2.0/. 4 | -- 5 | -- Copyright (c) 2014-2025, Lars Asplund lars.anders.asplund@gmail.com 6 | 7 | library vunit_lib; 8 | context vunit_lib.vunit_context; 9 | 10 | entity tb_with_lower_level_control is 11 | generic (runner_cfg : string := runner_cfg_default); 12 | end entity; 13 | 14 | architecture tb of tb_with_lower_level_control is 15 | signal start_stimuli, stimuli_done : boolean := false; 16 | begin 17 | 18 | test_control: entity work.test_control 19 | generic map ( 20 | nested_runner_cfg => runner_cfg); 21 | 22 | end architecture; 23 | -------------------------------------------------------------------------------- /examples/vhdl/run/test_control.vhd: -------------------------------------------------------------------------------- 1 | -- This Source Code Form is subject to the terms of the Mozilla Public 2 | -- License, v. 2.0. If a copy of the MPL was not distributed with this file, 3 | -- You can obtain one at http://mozilla.org/MPL/2.0/. 4 | -- 5 | -- Copyright (c) 2014-2025, Lars Asplund lars.anders.asplund@gmail.com 6 | 7 | library vunit_lib; 8 | context vunit_lib.vunit_context; 9 | 10 | entity test_control is 11 | generic ( 12 | nested_runner_cfg : string); 13 | end entity test_control; 14 | 15 | architecture tb of test_control is 16 | begin 17 | test_runner : process 18 | begin 19 | test_runner_setup(runner, nested_runner_cfg); 20 | 21 | while test_suite loop 22 | if run("Test something") then 23 | info("Testing something"); 24 | elsif run("Test something else") then 25 | info("Testing something else"); 26 | end if; 27 | end loop; 28 | 29 | test_runner_cleanup(runner); 30 | end process; 31 | end architecture tb; 32 | -------------------------------------------------------------------------------- /examples/vhdl/third_party_integration/run.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | # This Source Code Form is subject to the terms of the Mozilla Public 4 | # License, v. 2.0. If a copy of the MPL was not distributed with this file, 5 | # You can obtain one at http://mozilla.org/MPL/2.0/. 6 | # 7 | # Copyright (c) 2014-2025, Lars Asplund lars.anders.asplund@gmail.com 8 | 9 | from pathlib import Path 10 | from vunit import VUnit 11 | 12 | VU = VUnit.from_argv() 13 | VU.add_vhdl_builtins() 14 | 15 | VU.add_library("lib").add_source_files(Path(__file__).parent / "test" / "*.vhd") 16 | 17 | VU.main() 18 | -------------------------------------------------------------------------------- /examples/vhdl/uart/run.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | # This Source Code Form is subject to the terms of the Mozilla Public 4 | # License, v. 2.0. If a copy of the MPL was not distributed with this file, 5 | # You can obtain one at http://mozilla.org/MPL/2.0/. 6 | # 7 | # Copyright (c) 2014-2025, Lars Asplund lars.anders.asplund@gmail.com 8 | 9 | """ 10 | VHDL UART 11 | --------- 12 | 13 | A more realistic test bench of an UART to show VUnit VHDL usage on a 14 | typical module. 15 | """ 16 | 17 | from pathlib import Path 18 | from vunit import VUnit 19 | 20 | VU = VUnit.from_argv() 21 | VU.add_vhdl_builtins() 22 | VU.add_osvvm() 23 | VU.add_verification_components() 24 | 25 | SRC_PATH = Path(__file__).parent / "src" 26 | 27 | VU.add_library("uart_lib").add_source_files(SRC_PATH / "*.vhd") 28 | VU.add_library("tb_uart_lib").add_source_files(SRC_PATH / "test" / "*.vhd") 29 | 30 | VU.main() 31 | -------------------------------------------------------------------------------- /examples/vhdl/user_guide/run.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | # This Source Code Form is subject to the terms of the Mozilla Public 4 | # License, v. 2.0. If a copy of the MPL was not distributed with this file, 5 | # You can obtain one at http://mozilla.org/MPL/2.0/. 6 | # 7 | # Copyright (c) 2014-2025, Lars Asplund lars.anders.asplund@gmail.com 8 | 9 | """ 10 | VHDL User Guide 11 | --------------- 12 | 13 | The most minimal VUnit VHDL project covering the basics of the 14 | :ref:`User Guide `. 15 | """ 16 | 17 | from pathlib import Path 18 | from vunit import VUnit 19 | 20 | VU = VUnit.from_argv() 21 | VU.add_vhdl_builtins() 22 | 23 | VU.add_library("lib").add_source_files(Path(__file__).parent / "*.vhd") 24 | 25 | VU.main() 26 | -------------------------------------------------------------------------------- /examples/vhdl/user_guide/tb_example.vhd: -------------------------------------------------------------------------------- 1 | -- This Source Code Form is subject to the terms of the Mozilla Public 2 | -- License, v. 2.0. If a copy of the MPL was not distributed with this file, 3 | -- You can obtain one at http://mozilla.org/MPL/2.0/. 4 | -- 5 | -- Copyright (c) 2014-2025, Lars Asplund lars.anders.asplund@gmail.com 6 | 7 | library vunit_lib; 8 | context vunit_lib.vunit_context; 9 | 10 | entity tb_example is 11 | generic (runner_cfg : string); 12 | end entity; 13 | 14 | architecture tb of tb_example is 15 | begin 16 | main : process 17 | begin 18 | test_runner_setup(runner, runner_cfg); 19 | report "Hello world!"; 20 | test_runner_cleanup(runner); -- Simulation ends here 21 | end process; 22 | end architecture; 23 | -------------------------------------------------------------------------------- /examples/vhdl/user_guide/tb_example_many.vhd: -------------------------------------------------------------------------------- 1 | -- This Source Code Form is subject to the terms of the Mozilla Public 2 | -- License, v. 2.0. If a copy of the MPL was not distributed with this file, 3 | -- You can obtain one at http://mozilla.org/MPL/2.0/. 4 | -- 5 | -- Copyright (c) 2014-2025, Lars Asplund lars.anders.asplund@gmail.com 6 | 7 | library vunit_lib; 8 | context vunit_lib.vunit_context; 9 | 10 | entity tb_example_many is 11 | generic (runner_cfg : string); 12 | end entity; 13 | 14 | architecture tb of tb_example_many is 15 | begin 16 | main : process 17 | begin 18 | test_runner_setup(runner, runner_cfg); 19 | 20 | while test_suite loop 21 | 22 | if run("test_pass") then 23 | report "This will pass"; 24 | 25 | elsif run("test_fail") then 26 | assert false report "It fails"; 27 | 28 | end if; 29 | end loop; 30 | 31 | test_runner_cleanup(runner); 32 | end process; 33 | end architecture; 34 | -------------------------------------------------------------------------------- /examples/vhdl/user_guide/vhdl1993/run.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | # This Source Code Form is subject to the terms of the Mozilla Public 4 | # License, v. 2.0. If a copy of the MPL was not distributed with this file, 5 | # You can obtain one at http://mozilla.org/MPL/2.0/. 6 | # 7 | # Copyright (c) 2014-2025, Lars Asplund lars.anders.asplund@gmail.com 8 | 9 | """ 10 | VHDL User Guide 11 | --------------- 12 | 13 | The most minimal VUnit VHDL project covering the basics of the :ref:`User Guide `, 14 | adapted to be used with simulators that don't support VHDL 2008. 15 | """ 16 | 17 | from pathlib import Path 18 | from vunit import VUnit 19 | 20 | VU = VUnit.from_argv(vhdl_standard="93") 21 | VU.add_vhdl_builtins() 22 | 23 | VU.add_library("lib").add_source_files(Path(__file__).parent / "*.vhd") 24 | 25 | VU.main() 26 | -------------------------------------------------------------------------------- /examples/vhdl/user_guide/vhdl1993/tb_example.vhd: -------------------------------------------------------------------------------- 1 | -- This Source Code Form is subject to the terms of the Mozilla Public 2 | -- License, v. 2.0. If a copy of the MPL was not distributed with this file, 3 | -- You can obtain one at http://mozilla.org/MPL/2.0/. 4 | -- 5 | -- Copyright (c) 2014-2025, Lars Asplund lars.anders.asplund@gmail.com 6 | 7 | library vunit_lib; 8 | use vunit_lib.run_pkg.all; 9 | 10 | entity tb_example is 11 | generic (runner_cfg : string); 12 | end entity; 13 | 14 | architecture tb of tb_example is 15 | begin 16 | main : process 17 | begin 18 | test_runner_setup(runner, runner_cfg); 19 | report "Hello world!"; 20 | test_runner_cleanup(runner); -- Simulation ends here 21 | end process; 22 | end architecture; 23 | -------------------------------------------------------------------------------- /examples/vhdl/user_guide/vhdl1993/tb_example_many.vhd: -------------------------------------------------------------------------------- 1 | -- This Source Code Form is subject to the terms of the Mozilla Public 2 | -- License, v. 2.0. If a copy of the MPL was not distributed with this file, 3 | -- You can obtain one at http://mozilla.org/MPL/2.0/. 4 | -- 5 | -- Copyright (c) 2014-2025, Lars Asplund lars.anders.asplund@gmail.com 6 | 7 | library vunit_lib; 8 | use vunit_lib.run_pkg.all; 9 | 10 | entity tb_example_many is 11 | generic (runner_cfg : string); 12 | end entity; 13 | 14 | architecture tb of tb_example_many is 15 | begin 16 | main : process 17 | begin 18 | test_runner_setup(runner, runner_cfg); 19 | 20 | while test_suite loop 21 | 22 | if run("test_pass") then 23 | report "This will pass"; 24 | 25 | elsif run("test_fail") then 26 | assert false report "It fails"; 27 | 28 | end if; 29 | end loop; 30 | 31 | test_runner_cleanup(runner); 32 | end process; 33 | end architecture; 34 | -------------------------------------------------------------------------------- /examples/vhdl/vhdl_configuration/test_reset.vhd: -------------------------------------------------------------------------------- 1 | -- This Source Code Form is subject to the terms of the Mozilla Public 2 | -- License, v. 2.0. If a copy of the MPL was not distributed with this file, 3 | -- You can obtain one at http://mozilla.org/MPL/2.0/. 4 | -- 5 | -- Copyright (c) 2014-2025, Lars Asplund lars.anders.asplund@gmail.com 6 | 7 | library vunit_lib; 8 | context vunit_lib.vunit_context; 9 | 10 | library ieee; 11 | use ieee.std_logic_1164.all; 12 | 13 | architecture test_reset_a of test_runner is 14 | begin 15 | main : process 16 | begin 17 | test_runner_setup(runner, nested_runner_cfg); 18 | 19 | d <= (others => '1'); 20 | reset <= '1'; 21 | wait until rising_edge(clk); 22 | wait for 0 ns; 23 | check_equal(q, 0); 24 | 25 | test_runner_cleanup(runner); 26 | end process; 27 | 28 | test_runner_watchdog(runner, 10 * clk_period); 29 | end; 30 | -------------------------------------------------------------------------------- /examples/vhdl/vhdl_configuration/test_reset_behavioral.vhd: -------------------------------------------------------------------------------- 1 | -- This Source Code Form is subject to the terms of the Mozilla Public 2 | -- License, v. 2.0. If a copy of the MPL was not distributed with this file, 3 | -- You can obtain one at http://mozilla.org/MPL/2.0/. 4 | -- 5 | -- Copyright (c) 2014-2025, Lars Asplund lars.anders.asplund@gmail.com 6 | 7 | configuration test_reset_behavioral of tb_selecting_test_runner_with_vhdl_configuration is 8 | for tb 9 | for test_runner_inst : test_runner 10 | use entity work.test_runner(test_reset_a); 11 | end for; 12 | 13 | for test_fixture 14 | for dut : dff 15 | use entity work.dff(behavioral); 16 | end for; 17 | end for; 18 | end for; 19 | end; 20 | -------------------------------------------------------------------------------- /examples/vhdl/vhdl_configuration/test_reset_rtl.vhd: -------------------------------------------------------------------------------- 1 | -- This Source Code Form is subject to the terms of the Mozilla Public 2 | -- License, v. 2.0. If a copy of the MPL was not distributed with this file, 3 | -- You can obtain one at http://mozilla.org/MPL/2.0/. 4 | -- 5 | -- Copyright (c) 2014-2025, Lars Asplund lars.anders.asplund@gmail.com 6 | 7 | configuration test_reset_rtl of tb_selecting_test_runner_with_vhdl_configuration is 8 | for tb 9 | for test_runner_inst : test_runner 10 | use entity work.test_runner(test_reset_a); 11 | end for; 12 | 13 | for test_fixture 14 | for dut : dff 15 | use entity work.dff(rtl); 16 | end for; 17 | end for; 18 | end for; 19 | end; 20 | -------------------------------------------------------------------------------- /examples/vhdl/vhdl_configuration/test_runner.vhd: -------------------------------------------------------------------------------- 1 | -- This Source Code Form is subject to the terms of the Mozilla Public 2 | -- License, v. 2.0. If a copy of the MPL was not distributed with this file, 3 | -- You can obtain one at http://mozilla.org/MPL/2.0/. 4 | -- 5 | -- Copyright (c) 2014-2025, Lars Asplund lars.anders.asplund@gmail.com 6 | 7 | library ieee; 8 | use ieee.std_logic_1164.all; 9 | 10 | entity test_runner is 11 | generic( 12 | clk_period : time; 13 | width : positive; 14 | nested_runner_cfg : string 15 | ); 16 | port( 17 | reset : out std_logic; 18 | clk : in std_logic; 19 | d : out std_logic_vector(width - 1 downto 0); 20 | q : in std_logic_vector(width - 1 downto 0) 21 | ); 22 | end entity; 23 | -------------------------------------------------------------------------------- /examples/vhdl/vhdl_configuration/test_state_change.vhd: -------------------------------------------------------------------------------- 1 | -- This Source Code Form is subject to the terms of the Mozilla Public 2 | -- License, v. 2.0. If a copy of the MPL was not distributed with this file, 3 | -- You can obtain one at http://mozilla.org/MPL/2.0/. 4 | -- 5 | -- Copyright (c) 2014-2025, Lars Asplund lars.anders.asplund@gmail.com 6 | 7 | library vunit_lib; 8 | context vunit_lib.vunit_context; 9 | 10 | library ieee; 11 | use ieee.std_logic_1164.all; 12 | 13 | architecture test_state_change_a of test_runner is 14 | begin 15 | main : process 16 | begin 17 | test_runner_setup(runner, nested_runner_cfg); 18 | 19 | reset <= '0'; 20 | 21 | d <= (others => '1'); 22 | wait until rising_edge(clk); 23 | wait for 0 ns; 24 | check_equal(q, std_logic_vector'(q'range => '1')); 25 | 26 | d <= (others => '0'); 27 | wait until rising_edge(clk); 28 | wait for 0 ns; 29 | check_equal(q, 0); 30 | 31 | test_runner_cleanup(runner); 32 | end process; 33 | 34 | test_runner_watchdog(runner, 10 * clk_period); 35 | end; 36 | -------------------------------------------------------------------------------- /examples/vhdl/vhdl_configuration/test_state_change_behavioral.vhd: -------------------------------------------------------------------------------- 1 | -- This Source Code Form is subject to the terms of the Mozilla Public 2 | -- License, v. 2.0. If a copy of the MPL was not distributed with this file, 3 | -- You can obtain one at http://mozilla.org/MPL/2.0/. 4 | -- 5 | -- Copyright (c) 2014-2025, Lars Asplund lars.anders.asplund@gmail.com 6 | 7 | configuration test_state_change_behavioral of tb_selecting_test_runner_with_vhdl_configuration is 8 | for tb 9 | for test_runner_inst : test_runner 10 | use entity work.test_runner(test_state_change_a); 11 | end for; 12 | 13 | for test_fixture 14 | for dut : dff 15 | use entity work.dff(behavioral); 16 | end for; 17 | end for; 18 | end for; 19 | end; 20 | -------------------------------------------------------------------------------- /examples/vhdl/vhdl_configuration/test_state_change_rtl.vhd: -------------------------------------------------------------------------------- 1 | -- This Source Code Form is subject to the terms of the Mozilla Public 2 | -- License, v. 2.0. If a copy of the MPL was not distributed with this file, 3 | -- You can obtain one at http://mozilla.org/MPL/2.0/. 4 | -- 5 | -- Copyright (c) 2014-2025, Lars Asplund lars.anders.asplund@gmail.com 6 | 7 | configuration test_state_change_rtl of tb_selecting_test_runner_with_vhdl_configuration is 8 | for tb 9 | for test_runner_inst : test_runner 10 | use entity work.test_runner(test_state_change_a); 11 | end for; 12 | 13 | for test_fixture 14 | for dut : dff 15 | use entity work.dff(rtl); 16 | end for; 17 | end for; 18 | end for; 19 | end; 20 | -------------------------------------------------------------------------------- /examples/vhdl/vivado/generate_vivado_project.py: -------------------------------------------------------------------------------- 1 | # This Source Code Form is subject to the terms of the Mozilla Public 2 | # License, v. 2.0. If a copy of the MPL was not distributed with this file, 3 | # You can obtain one at http://mozilla.org/MPL/2.0/. 4 | # 5 | # Copyright (c) 2014-2025, Lars Asplund lars.anders.asplund@gmail.com 6 | 7 | from pathlib import Path 8 | from shutil import rmtree 9 | from vunit.vivado import run_vivado 10 | 11 | 12 | def main(): 13 | root = Path(__file__).parent.resolve() 14 | project_name = "myproject" 15 | if (root / project_name).exists(): 16 | rmtree(root / project_name) 17 | run_vivado(root / "tcl" / "generate_project.tcl", tcl_args=[root, "myproject"]) 18 | 19 | 20 | if __name__ == "__main__": 21 | main() 22 | -------------------------------------------------------------------------------- /examples/vhdl/vivado/run.py: -------------------------------------------------------------------------------- 1 | # This Source Code Form is subject to the terms of the Mozilla Public 2 | # License, v. 2.0. If a copy of the MPL was not distributed with this file, 3 | # You can obtain one at http://mozilla.org/MPL/2.0/. 4 | # 5 | # Copyright (c) 2014-2025, Lars Asplund lars.anders.asplund@gmail.com 6 | 7 | """ 8 | Vivado IP 9 | --------- 10 | 11 | Demonstrates compiling and performing behavioral simulation of 12 | Vivado IPs with VUnit. 13 | """ 14 | 15 | from pathlib import Path 16 | from vunit import VUnit 17 | from vivado_util import add_vivado_ip 18 | 19 | ROOT = Path(__file__).parent 20 | SRC_PATH = ROOT / "src" 21 | 22 | VU = VUnit.from_argv() 23 | VU.add_vhdl_builtins() 24 | 25 | VU.add_library("lib").add_source_files(SRC_PATH / "*.vhd") 26 | VU.add_library("tb_lib").add_source_files(SRC_PATH / "test" / "*.vhd") 27 | 28 | add_vivado_ip( 29 | VU, 30 | output_path=ROOT / "vivado_libs", 31 | project_file=ROOT / "myproject" / "myproject.xpr", 32 | ) 33 | 34 | VU.main() 35 | -------------------------------------------------------------------------------- /examples/vhdl/vivado/tcl/compile_standard_libs.tcl: -------------------------------------------------------------------------------- 1 | set simulator_name [lindex $argv 0] 2 | set simulator_exec_path [lindex $argv 1] 3 | set output_path [lindex $argv 2] 4 | 5 | puts "simulator_name=${simulator_name}" 6 | puts "simulator_exec_path=${simulator_exec_path}" 7 | puts "output_path=${output_path}" 8 | 9 | set_param general.maxThreads 8 10 | 11 | # If you do not have System Verilog Assert license 12 | config_compile_simlib -reset 13 | config_compile_simlib -cfgopt {riviera.verilog.xpm:-sv2k12 -na sva} 14 | 15 | compile_simlib -force \ 16 | -language all \ 17 | -simulator ${simulator_name} \ 18 | -32bit \ 19 | -verbose \ 20 | -library unisim \ 21 | -library simprim \ 22 | -library xpm \ 23 | -family all \ 24 | -no_ip_compile \ 25 | -simulator_exec_path ${simulator_exec_path} \ 26 | -directory ${output_path} 27 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | colorama 2 | -------------------------------------------------------------------------------- /tests/__init__.py: -------------------------------------------------------------------------------- 1 | # This Source Code Form is subject to the terms of the Mozilla Public 2 | # License, v. 2.0. If a copy of the MPL was not distributed with this file, 3 | # You can obtain one at http://mozilla.org/MPL/2.0/. 4 | # 5 | # Copyright (c) 2014-2025, Lars Asplund lars.anders.asplund@gmail.com 6 | -------------------------------------------------------------------------------- /tests/acceptance/__init__.py: -------------------------------------------------------------------------------- 1 | # This Source Code Form is subject to the terms of the Mozilla Public 2 | # License, v. 2.0. If a copy of the MPL was not distributed with this file, 3 | # You can obtain one at http://mozilla.org/MPL/2.0/. 4 | # 5 | # Copyright (c) 2014-2025, Lars Asplund lars.anders.asplund@gmail.com 6 | -------------------------------------------------------------------------------- /tests/acceptance/artificial/verilog/other_file_tests.sv: -------------------------------------------------------------------------------- 1 | // This Source Code Form is subject to the terms of the Mozilla Public 2 | // License, v. 2.0. If a copy of the MPL was not distributed with this file, 3 | // You can obtain one at http://mozilla.org/MPL/2.0/. 4 | // 5 | // Copyright (c) 2014-2025, Lars Asplund lars.anders.asplund@gmail.com 6 | 7 | 8 | `include "vunit_defines.svh" 9 | 10 | module other_file_tests; 11 | `NESTED_TEST_SUITE begin 12 | 13 | `TEST_CASE("pass") begin 14 | $info("pass"); 15 | end 16 | 17 | `TEST_CASE("fail") begin 18 | $error("fail"); 19 | end 20 | end; 21 | 22 | `WATCHDOG(1ns); 23 | endmodule 24 | -------------------------------------------------------------------------------- /tests/acceptance/artificial/verilog/tb_fail_on_fatal_and_early_finish.sv: -------------------------------------------------------------------------------- 1 | // This Source Code Form is subject to the terms of the Mozilla Public 2 | // License, v. 2.0. If a copy of the MPL was not distributed with this file, 3 | // You can obtain one at http://mozilla.org/MPL/2.0/. 4 | // 5 | // Copyright (c) 2014-2025, Lars Asplund lars.anders.asplund@gmail.com 6 | 7 | 8 | `include "vunit_defines.svh" 9 | 10 | module tb_fail_on_fatal_and_early_finish; 11 | `TEST_SUITE begin 12 | `TEST_CASE("fatal0") begin 13 | $fatal(0, "fatal0"); 14 | end 15 | 16 | `TEST_CASE("fatal1") begin 17 | $fatal(1, "fatal1"); 18 | end 19 | 20 | `TEST_CASE("finish0") begin 21 | $finish(0); 22 | end 23 | 24 | `TEST_CASE("finish1") begin 25 | $finish(1); 26 | end 27 | end; 28 | endmodule 29 | -------------------------------------------------------------------------------- /tests/acceptance/artificial/verilog/tb_fail_on_warning.sv: -------------------------------------------------------------------------------- 1 | // This Source Code Form is subject to the terms of the Mozilla Public 2 | // License, v. 2.0. If a copy of the MPL was not distributed with this file, 3 | // You can obtain one at http://mozilla.org/MPL/2.0/. 4 | // 5 | // Copyright (c) 2014-2025, Lars Asplund lars.anders.asplund@gmail.com 6 | 7 | // vunit: fail_on_warning 8 | 9 | `include "vunit_defines.svh" 10 | 11 | module tb_fail_on_warning; 12 | `TEST_SUITE begin 13 | `TEST_CASE("fail") begin 14 | $warning("A warning"); 15 | end 16 | end; 17 | endmodule 18 | -------------------------------------------------------------------------------- /tests/acceptance/artificial/verilog/tb_fail_on_warning_from_python.sv: -------------------------------------------------------------------------------- 1 | // This Source Code Form is subject to the terms of the Mozilla Public 2 | // License, v. 2.0. If a copy of the MPL was not distributed with this file, 3 | // You can obtain one at http://mozilla.org/MPL/2.0/. 4 | // 5 | // Copyright (c) 2014-2025, Lars Asplund lars.anders.asplund@gmail.com 6 | 7 | `include "vunit_defines.svh" 8 | 9 | module tb_fail_on_warning_from_python; 10 | `TEST_SUITE begin 11 | `TEST_CASE("fail") begin 12 | $warning("A warning"); 13 | end 14 | end; 15 | endmodule 16 | -------------------------------------------------------------------------------- /tests/acceptance/artificial/verilog/tb_magic_paths.sv: -------------------------------------------------------------------------------- 1 | // This Source Code Form is subject to the terms of the Mozilla Public 2 | // License, v. 2.0. If a copy of the MPL was not distributed with this file, 3 | // You can obtain one at http://mozilla.org/MPL/2.0/. 4 | // 5 | // Copyright (c) 2014-2025, Lars Asplund lars.anders.asplund@gmail.com 6 | 7 | 8 | `include "vunit_defines.svh" 9 | 10 | module tb_magic_paths; 11 | parameter string tb_path = ""; 12 | parameter string output_path = ""; 13 | 14 | function void check_equal(string got, string expected); 15 | assert (got == expected) else $error("Mismatch got %s expected %s", got, expected); 16 | endfunction; 17 | 18 | function void check_has_suffix(string value, string suffix); 19 | check_equal(value.substr(value.len()-suffix.len(), value.len()-1), suffix); 20 | endfunction; 21 | 22 | `TEST_SUITE begin 23 | `TEST_CASE("Test magic paths are correct") begin 24 | check_has_suffix(tb_path, "acceptance/artificial/verilog/"); 25 | end 26 | end; 27 | 28 | `WATCHDOG(1ns); 29 | endmodule 30 | -------------------------------------------------------------------------------- /tests/acceptance/artificial/verilog/tb_other_file_tests.sv: -------------------------------------------------------------------------------- 1 | // This Source Code Form is subject to the terms of the Mozilla Public 2 | // License, v. 2.0. If a copy of the MPL was not distributed with this file, 3 | // You can obtain one at http://mozilla.org/MPL/2.0/. 4 | // 5 | // Copyright (c) 2014-2025, Lars Asplund lars.anders.asplund@gmail.com 6 | 7 | module tb_other_file_tests; 8 | parameter string runner_cfg = ""; 9 | other_file_tests #(.nested_runner_cfg(runner_cfg)) other_file_tests_inst(); 10 | endmodule 11 | -------------------------------------------------------------------------------- /tests/acceptance/artificial/verilog/tb_same_sim_from_python_some_fail.sv: -------------------------------------------------------------------------------- 1 | // This Source Code Form is subject to the terms of the Mozilla Public 2 | // License, v. 2.0. If a copy of the MPL was not distributed with this file, 3 | // You can obtain one at http://mozilla.org/MPL/2.0/. 4 | // 5 | // Copyright (c) 2014-2025, Lars Asplund lars.anders.asplund@gmail.com 6 | 7 | `include "vunit_defines.svh" 8 | 9 | module tb_same_sim_from_python_some_fail; 10 | 11 | `TEST_SUITE begin 12 | 13 | `TEST_CASE("Test 1") begin 14 | $info("Test 1"); 15 | end 16 | 17 | `TEST_CASE("Test 2") begin 18 | $info("Test 2"); 19 | $error(""); 20 | end 21 | 22 | `TEST_CASE("Test 3") begin 23 | $info("Test 3"); 24 | end 25 | end; 26 | 27 | `WATCHDOG(1ns); 28 | endmodule 29 | -------------------------------------------------------------------------------- /tests/acceptance/artificial/verilog/tb_same_sim_some_fail.sv: -------------------------------------------------------------------------------- 1 | // This Source Code Form is subject to the terms of the Mozilla Public 2 | // License, v. 2.0. If a copy of the MPL was not distributed with this file, 3 | // You can obtain one at http://mozilla.org/MPL/2.0/. 4 | // 5 | // Copyright (c) 2014-2025, Lars Asplund lars.anders.asplund@gmail.com 6 | 7 | // vunit: run_all_in_same_sim 8 | 9 | `include "vunit_defines.svh" 10 | 11 | module tb_same_sim_some_fail; 12 | 13 | `TEST_SUITE begin 14 | 15 | `TEST_CASE("Test 1") begin 16 | $info("Test 1"); 17 | end 18 | 19 | `TEST_CASE("Test 2") begin 20 | $info("Test 2"); 21 | $error(""); 22 | end 23 | 24 | `TEST_CASE("Test 3") begin 25 | $info("Test 3"); 26 | end 27 | end; 28 | 29 | `WATCHDOG(1ns); 30 | endmodule 31 | -------------------------------------------------------------------------------- /tests/acceptance/artificial/verilog/tb_with_define.sv: -------------------------------------------------------------------------------- 1 | // This Source Code Form is subject to the terms of the Mozilla Public 2 | // License, v. 2.0. If a copy of the MPL was not distributed with this file, 3 | // You can obtain one at http://mozilla.org/MPL/2.0/. 4 | // 5 | // Copyright (c) 2014-2025, Lars Asplund lars.anders.asplund@gmail.com 6 | 7 | 8 | `include "vunit_defines.svh" 9 | 10 | module tb_with_define; 11 | `TEST_SUITE begin 12 | 13 | `TEST_CASE("test 1") begin 14 | `ifndef DEFINE_FROM_RUN_PY 15 | `CHECK_EQUAL(0, 1); 16 | `endif 17 | end 18 | end; 19 | 20 | `WATCHDOG(1ns); 21 | endmodule 22 | -------------------------------------------------------------------------------- /tests/acceptance/artificial/verilog/tb_with_runner.sv: -------------------------------------------------------------------------------- 1 | // This Source Code Form is subject to the terms of the Mozilla Public 2 | // License, v. 2.0. If a copy of the MPL was not distributed with this file, 3 | // You can obtain one at http://mozilla.org/MPL/2.0/. 4 | // 5 | // Copyright (c) 2014-2025, Lars Asplund lars.anders.asplund@gmail.com 6 | 7 | 8 | `include "vunit_defines.svh" 9 | 10 | module tb_with_runner; 11 | `TEST_SUITE begin 12 | 13 | `TEST_CASE("pass") begin 14 | $info("pass"); 15 | end 16 | 17 | `TEST_CASE("fail") begin 18 | $error("fail"); 19 | end 20 | end; 21 | 22 | `WATCHDOG(1ns); 23 | endmodule 24 | -------------------------------------------------------------------------------- /tests/acceptance/artificial/vhdl/bool_driver.vhd: -------------------------------------------------------------------------------- 1 | -- This Source Code Form is subject to the terms of the Mozilla Public 2 | -- License, v. 2.0. If a copy of the MPL was not distributed with this file, 3 | -- You can obtain one at http://mozilla.org/MPL/2.0/. 4 | -- 5 | -- Copyright (c) 2014-2025, Lars Asplund lars.anders.asplund@gmail.com 6 | 7 | -- From Issue 71. Generic overridden on all hiearchy levels. 8 | 9 | entity bool_driver is 10 | generic ( 11 | g_val : boolean := true); 12 | port ( 13 | outp : out boolean); 14 | end entity; 15 | 16 | architecture rtl of bool_driver is 17 | begin 18 | outp <= g_val; 19 | end architecture; 20 | -------------------------------------------------------------------------------- /tests/acceptance/artificial/vhdl/cfg1.vhd: -------------------------------------------------------------------------------- 1 | -- This Source Code Form is subject to the terms of the Mozilla Public 2 | -- License, v. 2.0. If a copy of the MPL was not distributed with this file, 3 | -- You can obtain one at http://mozilla.org/MPL/2.0/. 4 | -- 5 | -- Copyright (c) 2014-2025, Lars Asplund lars.anders.asplund@gmail.com 6 | 7 | configuration cfg1 of tb_with_vhdl_configuration is 8 | for tb 9 | for ent_inst : ent 10 | use entity work.ent(arch1); 11 | end for; 12 | end for; 13 | end; 14 | -------------------------------------------------------------------------------- /tests/acceptance/artificial/vhdl/cfg2.vhd: -------------------------------------------------------------------------------- 1 | -- This Source Code Form is subject to the terms of the Mozilla Public 2 | -- License, v. 2.0. If a copy of the MPL was not distributed with this file, 3 | -- You can obtain one at http://mozilla.org/MPL/2.0/. 4 | -- 5 | -- Copyright (c) 2014-2025, Lars Asplund lars.anders.asplund@gmail.com 6 | 7 | configuration cfg2 of tb_with_vhdl_configuration is 8 | for tb 9 | for ent_inst : ent 10 | use entity work.ent(arch2); 11 | end for; 12 | end for; 13 | end; 14 | -------------------------------------------------------------------------------- /tests/acceptance/artificial/vhdl/cfg3.vhd: -------------------------------------------------------------------------------- 1 | -- This Source Code Form is subject to the terms of the Mozilla Public 2 | -- License, v. 2.0. If a copy of the MPL was not distributed with this file, 3 | -- You can obtain one at http://mozilla.org/MPL/2.0/. 4 | -- 5 | -- Copyright (c) 2014-2025, Lars Asplund lars.anders.asplund@gmail.com 6 | 7 | configuration cfg3 of tb_with_vhdl_configuration is 8 | for tb 9 | for ent_inst : ent 10 | use entity work.ent(arch3); 11 | end for; 12 | end for; 13 | end; 14 | -------------------------------------------------------------------------------- /tests/acceptance/artificial/vhdl/ent.vhd: -------------------------------------------------------------------------------- 1 | -- This Source Code Form is subject to the terms of the Mozilla Public 2 | -- License, v. 2.0. If a copy of the MPL was not distributed with this file, 3 | -- You can obtain one at http://mozilla.org/MPL/2.0/. 4 | -- 5 | -- Copyright (c) 2014-2025, Lars Asplund lars.anders.asplund@gmail.com 6 | 7 | entity ent is 8 | port(arch : out string(1 to 5)); 9 | end; -------------------------------------------------------------------------------- /tests/acceptance/artificial/vhdl/ent_arch1.vhd: -------------------------------------------------------------------------------- 1 | -- This Source Code Form is subject to the terms of the Mozilla Public 2 | -- License, v. 2.0. If a copy of the MPL was not distributed with this file, 3 | -- You can obtain one at http://mozilla.org/MPL/2.0/. 4 | -- 5 | -- Copyright (c) 2014-2025, Lars Asplund lars.anders.asplund@gmail.com 6 | 7 | architecture arch1 of ent is 8 | begin 9 | arch <= "arch1"; 10 | end; 11 | -------------------------------------------------------------------------------- /tests/acceptance/artificial/vhdl/ent_arch2.vhd: -------------------------------------------------------------------------------- 1 | -- This Source Code Form is subject to the terms of the Mozilla Public 2 | -- License, v. 2.0. If a copy of the MPL was not distributed with this file, 3 | -- You can obtain one at http://mozilla.org/MPL/2.0/. 4 | -- 5 | -- Copyright (c) 2014-2025, Lars Asplund lars.anders.asplund@gmail.com 6 | 7 | architecture arch2 of ent is 8 | begin 9 | arch <= "arch2"; 10 | end; 11 | -------------------------------------------------------------------------------- /tests/acceptance/artificial/vhdl/ent_arch3.vhd: -------------------------------------------------------------------------------- 1 | -- This Source Code Form is subject to the terms of the Mozilla Public 2 | -- License, v. 2.0. If a copy of the MPL was not distributed with this file, 3 | -- You can obtain one at http://mozilla.org/MPL/2.0/. 4 | -- 5 | -- Copyright (c) 2014-2025, Lars Asplund lars.anders.asplund@gmail.com 6 | 7 | architecture arch3 of ent is 8 | begin 9 | arch <= "arch3"; 10 | end; 11 | -------------------------------------------------------------------------------- /tests/acceptance/artificial/vhdl/other_file_tests.vhd: -------------------------------------------------------------------------------- 1 | -- This Source Code Form is subject to the terms of the Mozilla Public 2 | -- License, v. 2.0. If a copy of the MPL was not distributed with this file, 3 | -- You can obtain one at http://mozilla.org/MPL/2.0/. 4 | -- 5 | -- Copyright (c) 2014-2025, Lars Asplund lars.anders.asplund@gmail.com 6 | 7 | library vunit_lib; 8 | context vunit_lib.vunit_context; 9 | 10 | entity other_file_tests is 11 | generic ( 12 | nested_runner_cfg : runner_cfg_t); 13 | end entity; 14 | 15 | architecture vunit_test_bench of other_file_tests is 16 | begin 17 | test_runner : process 18 | begin 19 | test_runner_setup(runner, nested_runner_cfg); 20 | while test_suite loop 21 | if run("pass") then 22 | report "Test pass"; 23 | elsif run("fail") then 24 | report "Test fail"; 25 | assert false; 26 | end if; 27 | end loop; 28 | test_runner_cleanup(runner); 29 | wait; 30 | end process; 31 | end architecture; 32 | -------------------------------------------------------------------------------- /tests/acceptance/artificial/vhdl/reference_test_history/0: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VUnit/vunit/4e30fa124ea84609af0f957dbc55b82adaed1d76/tests/acceptance/artificial/vhdl/reference_test_history/0 -------------------------------------------------------------------------------- /tests/acceptance/artificial/vhdl/reference_test_history/1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VUnit/vunit/4e30fa124ea84609af0f957dbc55b82adaed1d76/tests/acceptance/artificial/vhdl/reference_test_history/1 -------------------------------------------------------------------------------- /tests/acceptance/artificial/vhdl/tb_elab_fail.vhd: -------------------------------------------------------------------------------- 1 | -- This Source Code Form is subject to the terms of the Mozilla Public 2 | -- License, v. 2.0. If a copy of the MPL was not distributed with this file, 3 | -- You can obtain one at http://mozilla.org/MPL/2.0/. 4 | -- 5 | -- Copyright (c) 2014-2025, Lars Asplund lars.anders.asplund@gmail.com 6 | 7 | library vunit_lib; 8 | context vunit_lib.vunit_context; 9 | 10 | entity tb_elab_fail is 11 | generic (runner_cfg : string; 12 | generic_without_default : string); 13 | end entity; 14 | 15 | architecture vunit_test_bench of tb_elab_fail is 16 | begin 17 | test_runner : process 18 | begin 19 | test_runner_setup(runner, runner_cfg); 20 | test_runner_cleanup(runner); 21 | wait; 22 | end process; 23 | end architecture; 24 | -------------------------------------------------------------------------------- /tests/acceptance/artificial/vhdl/tb_fail.vhd: -------------------------------------------------------------------------------- 1 | -- This Source Code Form is subject to the terms of the Mozilla Public 2 | -- License, v. 2.0. If a copy of the MPL was not distributed with this file, 3 | -- You can obtain one at http://mozilla.org/MPL/2.0/. 4 | -- 5 | -- Copyright (c) 2014-2025, Lars Asplund lars.anders.asplund@gmail.com 6 | 7 | library vunit_lib; 8 | context vunit_lib.vunit_context; 9 | 10 | entity tb_fail is 11 | generic (runner_cfg : string); 12 | end entity; 13 | 14 | architecture vunit_test_bench of tb_fail is 15 | begin 16 | test_runner : process 17 | begin 18 | test_runner_setup(runner, runner_cfg); 19 | assert false; 20 | test_runner_cleanup(runner); 21 | wait; 22 | end process; 23 | end architecture; 24 | -------------------------------------------------------------------------------- /tests/acceptance/artificial/vhdl/tb_fail_on_warning.vhd: -------------------------------------------------------------------------------- 1 | -- This Source Code Form is subject to the terms of the Mozilla Public 2 | -- License, v. 2.0. If a copy of the MPL was not distributed with this file, 3 | -- You can obtain one at http://mozilla.org/MPL/2.0/. 4 | -- 5 | -- Copyright (c) 2014-2025, Lars Asplund lars.anders.asplund@gmail.com 6 | 7 | -- vunit: fail_on_warning 8 | 9 | library vunit_lib; 10 | context vunit_lib.vunit_context; 11 | 12 | entity tb_fail_on_warning is 13 | generic (runner_cfg : string); 14 | end entity; 15 | 16 | architecture vunit_test_bench of tb_fail_on_warning is 17 | begin 18 | test_runner : process 19 | begin 20 | test_runner_setup(runner, runner_cfg); 21 | report "A warning" severity warning; 22 | test_runner_cleanup(runner); 23 | wait; 24 | end process; 25 | end architecture; 26 | -------------------------------------------------------------------------------- /tests/acceptance/artificial/vhdl/tb_fail_on_warning_from_python.vhd: -------------------------------------------------------------------------------- 1 | -- This Source Code Form is subject to the terms of the Mozilla Public 2 | -- License, v. 2.0. If a copy of the MPL was not distributed with this file, 3 | -- You can obtain one at http://mozilla.org/MPL/2.0/. 4 | -- 5 | -- Copyright (c) 2014-2025, Lars Asplund lars.anders.asplund@gmail.com 6 | 7 | library vunit_lib; 8 | context vunit_lib.vunit_context; 9 | 10 | entity tb_fail_on_warning_from_python is 11 | generic (runner_cfg : string); 12 | end entity; 13 | 14 | architecture vunit_test_bench of tb_fail_on_warning_from_python is 15 | begin 16 | test_runner : process 17 | begin 18 | test_runner_setup(runner, runner_cfg); 19 | report "A warning" severity warning; 20 | test_runner_cleanup(runner); 21 | wait; 22 | end process; 23 | end architecture; 24 | -------------------------------------------------------------------------------- /tests/acceptance/artificial/vhdl/tb_infinite_events.vhd: -------------------------------------------------------------------------------- 1 | -- This Source Code Form is subject to the terms of the Mozilla Public 2 | -- License, v. 2.0. If a copy of the MPL was not distributed with this file, 3 | -- You can obtain one at http://mozilla.org/MPL/2.0/. 4 | -- 5 | -- Copyright (c) 2014-2025, Lars Asplund lars.anders.asplund@gmail.com 6 | 7 | library vunit_lib; 8 | context vunit_lib.vunit_context; 9 | 10 | entity tb_infinite_events is 11 | generic (runner_cfg : string); 12 | end entity; 13 | 14 | architecture vunit_test_bench of tb_infinite_events is 15 | signal toggle : boolean := false; 16 | begin 17 | -- Trigger infinite simulation events 18 | -- to prove that simulation still ends at test_runner_cleanup 19 | -- When not events the simulation will finish anyway 20 | toggle <= not toggle after 1 ns; 21 | 22 | test_runner : process 23 | begin 24 | test_runner_setup(runner, runner_cfg); 25 | wait for 10 ns; 26 | test_runner_cleanup(runner); 27 | wait; 28 | end process; 29 | 30 | end architecture; 31 | -------------------------------------------------------------------------------- /tests/acceptance/artificial/vhdl/tb_no_fail_after_cleanup.vhd: -------------------------------------------------------------------------------- 1 | -- This Source Code Form is subject to the terms of the Mozilla Public 2 | -- License, v. 2.0. If a copy of the MPL was not distributed with this file, 3 | -- You can obtain one at http://mozilla.org/MPL/2.0/. 4 | -- 5 | -- Copyright (c) 2014-2025, Lars Asplund lars.anders.asplund@gmail.com 6 | 7 | library vunit_lib; 8 | context vunit_lib.vunit_context; 9 | 10 | entity tb_no_fail_after_cleanup is 11 | generic (runner_cfg : string); 12 | end entity; 13 | 14 | architecture vunit_test_bench of tb_no_fail_after_cleanup is 15 | begin 16 | test_runner : process 17 | begin 18 | test_runner_setup(runner, runner_cfg); 19 | test_runner_cleanup(runner); 20 | assert false; 21 | wait; 22 | end process; 23 | end architecture; 24 | -------------------------------------------------------------------------------- /tests/acceptance/artificial/vhdl/tb_no_fail_on_warning.vhd: -------------------------------------------------------------------------------- 1 | -- This Source Code Form is subject to the terms of the Mozilla Public 2 | -- License, v. 2.0. If a copy of the MPL was not distributed with this file, 3 | -- You can obtain one at http://mozilla.org/MPL/2.0/. 4 | -- 5 | -- Copyright (c) 2014-2025, Lars Asplund lars.anders.asplund@gmail.com 6 | 7 | library vunit_lib; 8 | context vunit_lib.vunit_context; 9 | 10 | entity tb_no_fail_on_warning is 11 | generic (runner_cfg : string); 12 | end entity; 13 | 14 | architecture vunit_test_bench of tb_no_fail_on_warning is 15 | begin 16 | test_runner : process 17 | begin 18 | test_runner_setup(runner, runner_cfg); 19 | report "A warning" severity warning; 20 | test_runner_cleanup(runner); 21 | wait; 22 | end process; 23 | end architecture; 24 | -------------------------------------------------------------------------------- /tests/acceptance/artificial/vhdl/tb_no_generic_override.vhd: -------------------------------------------------------------------------------- 1 | -- This Source Code Form is subject to the terms of the Mozilla Public 2 | -- License, v. 2.0. If a copy of the MPL was not distributed with this file, 3 | -- You can obtain one at http://mozilla.org/MPL/2.0/. 4 | -- 5 | -- Copyright (c) 2014-2025, Lars Asplund lars.anders.asplund@gmail.com 6 | 7 | -- From Issue 71. Generic overridden on all hiearchy levels. 8 | 9 | library vunit_lib; 10 | context vunit_lib.vunit_context; 11 | 12 | entity tb_no_generic_override is 13 | generic ( 14 | runner_cfg : string; 15 | g_val : boolean); 16 | end entity; 17 | 18 | architecture tb of tb_no_generic_override is 19 | signal s_outp : boolean; 20 | begin 21 | main : process 22 | begin 23 | test_runner_setup(runner, runner_cfg); 24 | assert not g_val; 25 | assert s_outp; 26 | test_runner_cleanup(runner); 27 | end process; 28 | 29 | dut : entity work.bool_driver 30 | port map ( outp => s_outp ); 31 | end architecture; 32 | -------------------------------------------------------------------------------- /tests/acceptance/artificial/vhdl/tb_other_file_tests.vhd: -------------------------------------------------------------------------------- 1 | -- This Source Code Form is subject to the terms of the Mozilla Public 2 | -- License, v. 2.0. If a copy of the MPL was not distributed with this file, 3 | -- You can obtain one at http://mozilla.org/MPL/2.0/. 4 | -- 5 | -- Copyright (c) 2014-2025, Lars Asplund lars.anders.asplund@gmail.com 6 | 7 | library vunit_lib; 8 | context vunit_lib.vunit_context; 9 | 10 | entity tb_other_file_tests is 11 | generic ( 12 | runner_cfg : string); 13 | end entity; 14 | 15 | architecture vunit_test_bench of tb_other_file_tests is 16 | begin 17 | tests : entity work.other_file_tests 18 | generic map ( 19 | nested_runner_cfg => runner_cfg); 20 | end architecture; 21 | -------------------------------------------------------------------------------- /tests/acceptance/artificial/vhdl/tb_pass.vhd: -------------------------------------------------------------------------------- 1 | -- This Source Code Form is subject to the terms of the Mozilla Public 2 | -- License, v. 2.0. If a copy of the MPL was not distributed with this file, 3 | -- You can obtain one at http://mozilla.org/MPL/2.0/. 4 | -- 5 | -- Copyright (c) 2014-2025, Lars Asplund lars.anders.asplund@gmail.com 6 | 7 | library vunit_lib; 8 | context vunit_lib.vunit_context; 9 | 10 | entity tb_pass is 11 | generic (runner_cfg : string); 12 | end entity; 13 | 14 | architecture vunit_test_bench of tb_pass is 15 | begin 16 | test_runner : process 17 | begin 18 | test_runner_setup(runner, runner_cfg); 19 | test_runner_cleanup(runner); 20 | wait; 21 | end process; 22 | end architecture; 23 | -------------------------------------------------------------------------------- /tests/acceptance/artificial/vhdl/tb_test_prio_1.vhd: -------------------------------------------------------------------------------- 1 | -- This Source Code Form is subject to the terms of the Mozilla Public 2 | -- License, v. 2.0. If a copy of the MPL was not distributed with this file, 3 | -- You can obtain one at http://mozilla.org/MPL/2.0/. 4 | -- 5 | -- Copyright (c) 2014-2025, Lars Asplund lars.anders.asplund@gmail.com 6 | 7 | -- This attribute should be ignored when VHDL assert stop level is used 8 | -- vunit: fail_on_warning 9 | 10 | library vunit_lib; 11 | context vunit_lib.vunit_context; 12 | 13 | entity tb_test_prio_1 is 14 | generic (runner_cfg : string); 15 | end entity; 16 | 17 | architecture tb of tb_test_prio_1 is 18 | begin 19 | test_runner : process 20 | begin 21 | test_runner_setup(runner, runner_cfg); 22 | 23 | test_runner_cleanup(runner); 24 | end process; 25 | end architecture; 26 | -------------------------------------------------------------------------------- /tests/acceptance/artificial/vhdl/tb_test_prio_2.vhd: -------------------------------------------------------------------------------- 1 | -- This Source Code Form is subject to the terms of the Mozilla Public 2 | -- License, v. 2.0. If a copy of the MPL was not distributed with this file, 3 | -- You can obtain one at http://mozilla.org/MPL/2.0/. 4 | -- 5 | -- Copyright (c) 2014-2025, Lars Asplund lars.anders.asplund@gmail.com 6 | 7 | -- This attribute should be ignored when VHDL assert stop level is used 8 | -- vunit: fail_on_warning 9 | -- 10 | library vunit_lib; 11 | context vunit_lib.vunit_context; 12 | 13 | entity tb_test_prio_2 is 14 | generic (runner_cfg : string); 15 | end entity; 16 | 17 | architecture tb of tb_test_prio_2 is 18 | begin 19 | test_runner : process 20 | begin 21 | test_runner_setup(runner, runner_cfg); 22 | 23 | test_runner_cleanup(runner); 24 | end process; 25 | end architecture; 26 | -------------------------------------------------------------------------------- /tests/acceptance/dependencies/pkg.vhd: -------------------------------------------------------------------------------- 1 | -- This Source Code Form is subject to the terms of the Mozilla Public 2 | -- License, v. 2.0. If a copy of the MPL was not distributed with this file, 3 | -- You can obtain one at http://mozilla.org/MPL/2.0/. 4 | -- 5 | -- Copyright (c) 2014-2025, Lars Asplund lars.anders.asplund@gmail.com 6 | 7 | package pkg is 8 | procedure proc(value : integer); 9 | end package; 10 | -------------------------------------------------------------------------------- /tests/acceptance/dependencies/pkg_body1.vhd: -------------------------------------------------------------------------------- 1 | -- This Source Code Form is subject to the terms of the Mozilla Public 2 | -- License, v. 2.0. If a copy of the MPL was not distributed with this file, 3 | -- You can obtain one at http://mozilla.org/MPL/2.0/. 4 | -- 5 | -- Copyright (c) 2014-2025, Lars Asplund lars.anders.asplund@gmail.com 6 | 7 | package body pkg is 8 | procedure proc(value : integer) is 9 | begin 10 | assert value = 1; 11 | end procedure; 12 | end package body; 13 | -------------------------------------------------------------------------------- /tests/acceptance/dependencies/pkg_body2.vhd: -------------------------------------------------------------------------------- 1 | -- This Source Code Form is subject to the terms of the Mozilla Public 2 | -- License, v. 2.0. If a copy of the MPL was not distributed with this file, 3 | -- You can obtain one at http://mozilla.org/MPL/2.0/. 4 | -- 5 | -- Copyright (c) 2014-2025, Lars Asplund lars.anders.asplund@gmail.com 6 | 7 | package body pkg is 8 | procedure proc(value : integer) is 9 | begin 10 | assert value = 2; 11 | end procedure; 12 | end package body; 13 | -------------------------------------------------------------------------------- /tests/acceptance/dependencies/tb_pkg.vhd: -------------------------------------------------------------------------------- 1 | -- This Source Code Form is subject to the terms of the Mozilla Public 2 | -- License, v. 2.0. If a copy of the MPL was not distributed with this file, 3 | -- You can obtain one at http://mozilla.org/MPL/2.0/. 4 | -- 5 | -- Copyright (c) 2014-2025, Lars Asplund lars.anders.asplund@gmail.com 6 | 7 | library vunit_lib; 8 | context vunit_lib.vunit_context; 9 | 10 | use work.pkg.all; 11 | 12 | entity tb_pkg is 13 | generic ( 14 | runner_cfg : string; 15 | value : integer); 16 | end entity; 17 | 18 | architecture a of tb_pkg is 19 | begin 20 | main : process 21 | begin 22 | test_runner_setup(runner, runner_cfg); 23 | report integer'image(value); 24 | proc(value); 25 | test_runner_cleanup(runner); 26 | end process; 27 | end architecture; 28 | -------------------------------------------------------------------------------- /tests/lint/__init__.py: -------------------------------------------------------------------------------- 1 | # This Source Code Form is subject to the terms of the Mozilla Public 2 | # License, v. 2.0. If a copy of the MPL was not distributed with this file, 3 | # You can obtain one at http://mozilla.org/MPL/2.0/. 4 | # 5 | # Copyright (c) 2014-2025, Lars Asplund lars.anders.asplund@gmail.com 6 | -------------------------------------------------------------------------------- /tests/lint/test_mypy.py: -------------------------------------------------------------------------------- 1 | # This Source Code Form is subject to the terms of the Mozilla Public 2 | # License, v. 2.0. If a copy of the MPL was not distributed with this file, 3 | # You can obtain one at http://mozilla.org/MPL/2.0/. 4 | # 5 | # Copyright (c) 2014-2025, Lars Asplund lars.anders.asplund@gmail.com 6 | 7 | """ 8 | MyPy check 9 | """ 10 | 11 | import unittest 12 | import sys 13 | from subprocess import check_call 14 | 15 | 16 | class TestMyPy(unittest.TestCase): 17 | """ 18 | Run MyPy static type analysis 19 | """ 20 | 21 | @staticmethod 22 | def test_mypy(): 23 | check_call([sys.executable, "-m", "mypy", "--namespace-packages", "vunit"]) 24 | -------------------------------------------------------------------------------- /tests/lint/test_pylint.py: -------------------------------------------------------------------------------- 1 | # This Source Code Form is subject to the terms of the Mozilla Public 2 | # License, v. 2.0. If a copy of the MPL was not distributed with this file, 3 | # You can obtain one at http://mozilla.org/MPL/2.0/. 4 | # 5 | # Copyright (c) 2014-2025, Lars Asplund lars.anders.asplund@gmail.com 6 | 7 | """ 8 | Pylint check 9 | """ 10 | 11 | 12 | import unittest 13 | from subprocess import check_call 14 | from pathlib import Path 15 | import sys 16 | from tests.lint.test_pycodestyle import get_files_and_folders 17 | 18 | 19 | class TestPylint(unittest.TestCase): 20 | """ 21 | Check that there are no pylint errors or warnings 22 | """ 23 | 24 | @staticmethod 25 | def test_pylint(): 26 | check_call( 27 | [ 28 | sys.executable, 29 | "-m", 30 | "pylint", 31 | "--rcfile=" + str(Path(__file__).parent / "pylintrc"), 32 | ] 33 | + get_files_and_folders() 34 | ) 35 | -------------------------------------------------------------------------------- /tests/unit/__init__.py: -------------------------------------------------------------------------------- 1 | # This Source Code Form is subject to the terms of the Mozilla Public 2 | # License, v. 2.0. If a copy of the MPL was not distributed with this file, 3 | # You can obtain one at http://mozilla.org/MPL/2.0/. 4 | # 5 | # Copyright (c) 2014-2025, Lars Asplund lars.anders.asplund@gmail.com 6 | -------------------------------------------------------------------------------- /tests/unit/non_utf8_printer.py: -------------------------------------------------------------------------------- 1 | # This Source Code Form is subject to the terms of the Mozilla Public 2 | # License, v. 2.0. If a copy of the MPL was not distributed with this file, 3 | # You can obtain one at http://mozilla.org/MPL/2.0/. 4 | # 5 | # Copyright (c) 2014-2025, Lars Asplund lars.anders.asplund@gmail.com 6 | 7 | # pylint: skip-file 8 | from sys import stdout 9 | 10 | stdout.buffer.write(b"a" + b"\x87" + b"c") 11 | stdout.write("\n") 12 | -------------------------------------------------------------------------------- /tools/build_docs.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | # This Source Code Form is subject to the terms of the Mozilla Public 4 | # License, v. 2.0. If a copy of the MPL was not distributed with this file, 5 | # You can obtain one at http://mozilla.org/MPL/2.0/. 6 | # 7 | # Copyright (c) 2014-2025, Lars Asplund lars.anders.asplund@gmail.com 8 | 9 | """ 10 | Command line utility to build documentation/website 11 | """ 12 | 13 | from subprocess import check_call 14 | from pathlib import Path 15 | from sys import argv, executable 16 | 17 | 18 | ROOT = Path(__file__).parent.parent 19 | 20 | 21 | def main(): 22 | """ 23 | Build documentation/website 24 | """ 25 | check_call( 26 | [ 27 | executable, 28 | "-m", 29 | "sphinx" 30 | ] + ([] if len(argv) < 2 else argv[2:]) + [ 31 | "-TEWanb", 32 | "html", 33 | Path(__file__).parent.parent / "docs", 34 | argv[1], 35 | ] 36 | ) 37 | 38 | 39 | if __name__ == "__main__": 40 | main() 41 | -------------------------------------------------------------------------------- /vunit/__init__.py: -------------------------------------------------------------------------------- 1 | # This Source Code Form is subject to the terms of the Mozilla Public 2 | # License, v. 2.0. If a copy of the MPL was not distributed with this file, 3 | # You can obtain one at http://mozilla.org/MPL/2.0/. 4 | # 5 | # Copyright (c) 2014-2025, Lars Asplund lars.anders.asplund@gmail.com 6 | 7 | """ 8 | Public VUnit interface 9 | """ 10 | 11 | from pathlib import Path 12 | import vunit.version_check 13 | from vunit.ui import VUnit 14 | from vunit.vunit_cli import VUnitCLI 15 | from vunit.about import version, doc 16 | 17 | # Repository root 18 | ROOT = str(Path(__file__).parent.parent.resolve()) 19 | 20 | __version__ = version() 21 | __doc__ = doc() # pylint: disable=redefined-builtin 22 | -------------------------------------------------------------------------------- /vunit/com/__init__.py: -------------------------------------------------------------------------------- 1 | # This Source Code Form is subject to the terms of the Mozilla Public 2 | # License, v. 2.0. If a copy of the MPL was not distributed with this file, 3 | # You can obtain one at http://mozilla.org/MPL/2.0/. 4 | # 5 | # Copyright (c) 2014-2025, Lars Asplund lars.anders.asplund@gmail.com 6 | -------------------------------------------------------------------------------- /vunit/exceptions.py: -------------------------------------------------------------------------------- 1 | # This Source Code Form is subject to the terms of the Mozilla Public 2 | # License, v. 2.0. If a copy of the MPL was not distributed with this file, 3 | # You can obtain one at http://mozilla.org/MPL/2.0/. 4 | # 5 | # Copyright (c) 2014-2025, Lars Asplund lars.anders.asplund@gmail.com 6 | 7 | """ 8 | Contains exceptions which are globally known 9 | """ 10 | 11 | 12 | class CompileError(Exception): 13 | """ 14 | An error occured when compiling a HDL file 15 | """ 16 | -------------------------------------------------------------------------------- /vunit/hashing.py: -------------------------------------------------------------------------------- 1 | # This Source Code Form is subject to the terms of the Mozilla Public 2 | # License, v. 2.0. If a copy of the MPL was not distributed with this file, 3 | # You can obtain one at http://mozilla.org/MPL/2.0/. 4 | # 5 | # Copyright (c) 2014-2025, Lars Asplund lars.anders.asplund@gmail.com 6 | 7 | """ 8 | Wrapper arround selected hash method 9 | """ 10 | 11 | import hashlib 12 | 13 | 14 | def hash_string(string): 15 | """ 16 | returns hash of bytes 17 | """ 18 | return hashlib.sha1(string.encode(encoding="utf-8")).hexdigest() 19 | -------------------------------------------------------------------------------- /vunit/parsing/__init__.py: -------------------------------------------------------------------------------- 1 | # This Source Code Form is subject to the terms of the Mozilla Public 2 | # License, v. 2.0. If a copy of the MPL was not distributed with this file, 3 | # You can obtain one at http://mozilla.org/MPL/2.0/. 4 | # 5 | # Copyright (c) 2014-2025, Lars Asplund lars.anders.asplund@gmail.com 6 | -------------------------------------------------------------------------------- /vunit/parsing/encodings.py: -------------------------------------------------------------------------------- 1 | # This Source Code Form is subject to the terms of the Mozilla Public 2 | # License, v. 2.0. If a copy of the MPL was not distributed with this file, 3 | # You can obtain one at http://mozilla.org/MPL/2.0/. 4 | # 5 | # Copyright (c) 2014-2025, Lars Asplund lars.anders.asplund@gmail.com 6 | 7 | """ 8 | Define common encodings 9 | """ 10 | 11 | 12 | # Both VHDL and Verilog standardize on ISO-8859-1 which is latin-1 13 | HDL_FILE_ENCODING = "latin-1" 14 | -------------------------------------------------------------------------------- /vunit/parsing/verilog/__init__.py: -------------------------------------------------------------------------------- 1 | # This Source Code Form is subject to the terms of the Mozilla Public 2 | # License, v. 2.0. If a copy of the MPL was not distributed with this file, 3 | # You can obtain one at http://mozilla.org/MPL/2.0/. 4 | # 5 | # Copyright (c) 2014-2025, Lars Asplund lars.anders.asplund@gmail.com 6 | -------------------------------------------------------------------------------- /vunit/py.typed: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VUnit/vunit/4e30fa124ea84609af0f957dbc55b82adaed1d76/vunit/py.typed -------------------------------------------------------------------------------- /vunit/sim_if/common.py: -------------------------------------------------------------------------------- 1 | # This Source Code Form is subject to the terms of the Mozilla Public 2 | # License, v. 2.0. If a copy of the MPL was not distributed with this file, 3 | # You can obtain one at http://mozilla.org/MPL/2.0/. 4 | # 5 | # Copyright (c) 2014-2025, Lars Asplund lars.anders.asplund@gmail.com 6 | 7 | """ 8 | Common functions 9 | """ 10 | 11 | from .factory import SIMULATOR_FACTORY 12 | 13 | 14 | def has_simulator(): 15 | return SIMULATOR_FACTORY.has_simulator 16 | 17 | 18 | def simulator_is(*names): 19 | """ 20 | Check that current simulator is any of names 21 | """ 22 | supported_names = [sim.name for sim in SIMULATOR_FACTORY.supported_simulators()] 23 | for name in names: 24 | assert name in supported_names 25 | return SIMULATOR_FACTORY.select_simulator().name in names 26 | 27 | 28 | def simulator_check(func): 29 | """ 30 | Check some method of the selected simulator 31 | """ 32 | simif = SIMULATOR_FACTORY.select_simulator() 33 | if simif is None: 34 | return False 35 | return func(simif) 36 | -------------------------------------------------------------------------------- /vunit/sim_if/tcl_read_eval_loop.tcl: -------------------------------------------------------------------------------- 1 | # This Source Code Form is subject to the terms of the Mozilla Public 2 | # License, v. 2.0. If a copy of the MPL was not distributed with this file, 3 | # You can obtain one at http://mozilla.org/MPL/2.0/. 4 | # 5 | # Copyright (c) 2014-2024, Lars Asplund lars.anders.asplund@gmail.com 6 | 7 | while {1} { 8 | set line [gets stdin] 9 | if {[catch {eval $line} error_msg]} { 10 | puts "$line - $error_msg" 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /vunit/test/__init__.py: -------------------------------------------------------------------------------- 1 | # This Source Code Form is subject to the terms of the Mozilla Public 2 | # License, v. 2.0. If a copy of the MPL was not distributed with this file, 3 | # You can obtain one at http://mozilla.org/MPL/2.0/. 4 | # 5 | # Copyright (c) 2014-2025, Lars Asplund lars.anders.asplund@gmail.com 6 | 7 | """ 8 | Test bench, runner, etc. 9 | """ 10 | -------------------------------------------------------------------------------- /vunit/test/unit/test_report_output.txt: -------------------------------------------------------------------------------- 1 | Output file contents 2 | &13!--"<\xml> -------------------------------------------------------------------------------- /vunit/verilog/check/run.py: -------------------------------------------------------------------------------- 1 | # This Source Code Form is subject to the terms of the Mozilla Public 2 | # License, v. 2.0. If a copy of the MPL was not distributed with this file, 3 | # You can obtain one at http://mozilla.org/MPL/2.0/. 4 | # 5 | # Copyright (c) 2014-2025, Lars Asplund lars.anders.asplund@gmail.com 6 | 7 | from pathlib import Path 8 | from vunit import VUnit 9 | 10 | 11 | ROOT = Path(__file__).parent 12 | 13 | VU = VUnit.from_argv() 14 | VU.add_verilog_builtins() 15 | 16 | VU.add_library("lib").add_source_files(ROOT / "test" / "*.sv") 17 | VU.set_sim_option("modelsim.vsim_flags.gui", ["-novopt"]) 18 | 19 | VU.main() 20 | -------------------------------------------------------------------------------- /vunit/version_check.py: -------------------------------------------------------------------------------- 1 | # This Source Code Form is subject to the terms of the Mozilla Public 2 | # License, v. 2.0. If a copy of the MPL was not distributed with this file, 3 | # You can obtain one at http://mozilla.org/MPL/2.0/. 4 | # 5 | # Copyright (c) 2014-2025, Lars Asplund lars.anders.asplund@gmail.com 6 | 7 | """ 8 | Check that the Python version used is supported by VUnit 9 | """ 10 | 11 | import sys 12 | 13 | MAJOR = 3 14 | MINOR = 6 15 | 16 | 17 | def version_is_ok(): 18 | """ 19 | Returns true if version is high enough 20 | """ 21 | version = (sys.version_info[0], sys.version_info[1]) 22 | return version >= (MAJOR, MINOR) 23 | 24 | 25 | if not version_is_ok(): 26 | print( 27 | f"Your Python version ({sys.version_info[0]}.{sys.version_info[1]}) is too old for VUnit. " 28 | "Please consider upgrading." 29 | ) 30 | print("VUnit supports versions:") 31 | print(f" - Python {MAJOR}.{MINOR} or higher") 32 | sys.exit(1) 33 | -------------------------------------------------------------------------------- /vunit/vhdl/com/run.py: -------------------------------------------------------------------------------- 1 | # This Source Code Form is subject to the terms of the Mozilla Public 2 | # License, v. 2.0. If a copy of the MPL was not distributed with this file, 3 | # You can obtain one at http://mozilla.org/MPL/2.0/. 4 | # 5 | # Copyright (c) 2014-2025, Lars Asplund lars.anders.asplund@gmail.com 6 | 7 | from pathlib import Path 8 | from vunit import VUnit 9 | 10 | ROOT = Path(__file__).parent 11 | 12 | UI = VUnit.from_argv() 13 | UI.add_vhdl_builtins() 14 | UI.add_com() 15 | 16 | TB_COM_LIB = UI.add_library("tb_com_lib") 17 | TB_COM_LIB.add_source_files(ROOT / "test" / "*.vhd") 18 | TB_COM_LIB.package("custom_types_pkg").generate_codecs( 19 | codec_package_name="custom_codec_pkg", 20 | used_packages=[ 21 | "ieee.std_logic_1164", 22 | "constants_pkg", 23 | "tb_com_lib.more_constants_pkg", 24 | ], 25 | ) 26 | 27 | UI.main() 28 | -------------------------------------------------------------------------------- /vunit/vhdl/com/src/com_context.vhd: -------------------------------------------------------------------------------- 1 | -- This Source Code Form is subject to the terms of the Mozilla Public 2 | -- License, v. 2.0. If a copy of the MPL was not distributed with this file, 3 | -- You can obtain one at http://mozilla.org/MPL/2.0/. 4 | -- 5 | -- Copyright (c) 2014-2025, Lars Asplund lars.anders.asplund@gmail.com 6 | 7 | context com_context is 8 | library vunit_lib; 9 | use vunit_lib.com_pkg.all; 10 | use vunit_lib.com_types_pkg.all; 11 | use vunit_lib.codec_pkg.all; 12 | use vunit_lib.codec_2008p_pkg.all; 13 | use vunit_lib.com_string_pkg.all; 14 | use vunit_lib.codec_builder_pkg.all; 15 | use vunit_lib.codec_builder_2008p_pkg.all; 16 | use vunit_lib.com_debug_codec_builder_pkg.all; 17 | use vunit_lib.com_deprecated_pkg.all; 18 | use vunit_lib.com_common_pkg.all; 19 | end context; 20 | -------------------------------------------------------------------------------- /vunit/vhdl/com/test/constants.vhd: -------------------------------------------------------------------------------- 1 | -- Test suite for com codec package 2 | -- 3 | -- This Source Code Form is subject to the terms of the Mozilla Public 4 | -- License, v. 2.0. If a copy of the MPL was not distributed with this file, 5 | -- You can obtain one at http://mozilla.org/MPL/2.0/. 6 | -- 7 | -- Copyright (c) 2014-2025, Lars Asplund lars.anders.asplund@gmail.com 8 | 9 | package constants_pkg is 10 | constant byte_msb : natural := 7; 11 | end package constants_pkg; 12 | -------------------------------------------------------------------------------- /vunit/vhdl/com/test/more_constants.vhd: -------------------------------------------------------------------------------- 1 | -- Test suite for com codec package 2 | -- 3 | -- This Source Code Form is subject to the terms of the Mozilla Public 4 | -- License, v. 2.0. If a copy of the MPL was not distributed with this file, 5 | -- You can obtain one at http://mozilla.org/MPL/2.0/. 6 | -- 7 | -- Copyright (c) 2014-2025, Lars Asplund lars.anders.asplund@gmail.com 8 | 9 | package more_constants_pkg is 10 | constant byte_lsb : natural := 0; 11 | end package more_constants_pkg; 12 | -------------------------------------------------------------------------------- /vunit/vhdl/compile_vunit_lib.py: -------------------------------------------------------------------------------- 1 | # This Source Code Form is subject to the terms of the Mozilla Public 2 | # License, v. 2.0. If a copy of the MPL was not distributed with this file, 3 | # You can obtain one at http://mozilla.org/MPL/2.0/. 4 | # 5 | # Copyright (c) 2014-2025, Lars Asplund lars.anders.asplund@gmail.com 6 | 7 | from vunit import VUnit 8 | 9 | ui = VUnit.from_argv() 10 | ui.main() 11 | -------------------------------------------------------------------------------- /vunit/vhdl/core/src/stop_body_2008p.vhd: -------------------------------------------------------------------------------- 1 | -- This Source Code Form is subject to the terms of the Mozilla Public 2 | -- License, v. 2.0. If a copy of the MPL was not distributed with this file, 3 | -- You can obtain one at http://mozilla.org/MPL/2.0/. 4 | -- 5 | -- Copyright (c) 2014-2025, Lars Asplund lars.anders.asplund@gmail.com 6 | 7 | package body stop_pkg is 8 | procedure stop(status : integer) is 9 | begin 10 | if status /= 0 then 11 | report "Stopping simulation with status " & integer'image(status) severity failure; 12 | end if; 13 | std.env.stop(status); 14 | end procedure; 15 | end package body; 16 | -------------------------------------------------------------------------------- /vunit/vhdl/core/src/stop_body_93-2002.vhd: -------------------------------------------------------------------------------- 1 | -- This Source Code Form is subject to the terms of the Mozilla Public 2 | -- License, v. 2.0. If a copy of the MPL was not distributed with this file, 3 | -- You can obtain one at http://mozilla.org/MPL/2.0/. 4 | -- 5 | -- Copyright (c) 2014-2025, Lars Asplund lars.anders.asplund@gmail.com 6 | 7 | package body stop_pkg is 8 | procedure stop(status : integer) is 9 | begin 10 | report "Stopping simulation with status " & integer'image(status) severity failure; 11 | end procedure; 12 | end package body; 13 | -------------------------------------------------------------------------------- /vunit/vhdl/core/src/stop_pkg.vhd: -------------------------------------------------------------------------------- 1 | -- This Source Code Form is subject to the terms of the Mozilla Public 2 | -- License, v. 2.0. If a copy of the MPL was not distributed with this file, 3 | -- You can obtain one at http://mozilla.org/MPL/2.0/. 4 | -- 5 | -- Copyright (c) 2014-2025, Lars Asplund lars.anders.asplund@gmail.com 6 | 7 | package stop_pkg is 8 | procedure stop(status : integer); 9 | end package; 10 | -------------------------------------------------------------------------------- /vunit/vhdl/data_types/run.py: -------------------------------------------------------------------------------- 1 | # This Source Code Form is subject to the terms of the Mozilla Public 2 | # License, v. 2.0. If a copy of the MPL was not distributed with this file, 3 | # You can obtain one at http://mozilla.org/MPL/2.0/. 4 | # 5 | # Copyright (c) 2014-2025, Lars Asplund lars.anders.asplund@gmail.com 6 | 7 | from pathlib import Path 8 | from glob import glob 9 | from vunit import VUnit 10 | 11 | ROOT = Path(__file__).parent 12 | 13 | VU = VUnit.from_argv() 14 | VU.add_vhdl_builtins() 15 | 16 | LIB = VU.library("vunit_lib") 17 | LIB.add_source_files(ROOT / ".." / "logging" / "test" / "test_support_pkg.vhd") 18 | for fname in glob(str(ROOT / "test" / "*.vhd")): 19 | if Path(fname).name.endswith("2008p.vhd") and VU.vhdl_standard not in [ 20 | "2008", 21 | "2019", 22 | ]: 23 | continue 24 | LIB.add_source_file(fname) 25 | 26 | VU.set_sim_option("nvc.heap_size", "256m") 27 | 28 | VU.main() 29 | -------------------------------------------------------------------------------- /vunit/vhdl/data_types/src/data_types_context.vhd: -------------------------------------------------------------------------------- 1 | -- This Source Code Form is subject to the terms of the Mozilla Public 2 | -- License, v. 2.0. If a copy of the MPL was not distributed with this file, 3 | -- You can obtain one at http://mozilla.org/MPL/2.0/. 4 | -- 5 | -- Copyright (c) 2014-2025, Lars Asplund lars.anders.asplund@gmail.com 6 | 7 | context data_types_context is 8 | library vunit_lib; 9 | use vunit_lib.types_pkg.all; 10 | use vunit_lib.integer_vector_ptr_pkg.all; 11 | use vunit_lib.integer_vector_ptr_pool_pkg.all; 12 | use vunit_lib.integer_array_pkg.all; 13 | use vunit_lib.queue_pkg.all; 14 | use vunit_lib.queue_pool_pkg.all; 15 | use vunit_lib.string_ptr_pkg.all; 16 | use vunit_lib.string_ptr_pool_pkg.all; 17 | use vunit_lib.byte_vector_ptr_pkg.all; 18 | use vunit_lib.dict_pkg.all; 19 | end context; 20 | -------------------------------------------------------------------------------- /vunit/vhdl/dictionary/run.py: -------------------------------------------------------------------------------- 1 | # This Source Code Form is subject to the terms of the Mozilla Public 2 | # License, v. 2.0. If a copy of the MPL was not distributed with this file, 3 | # You can obtain one at http://mozilla.org/MPL/2.0/. 4 | # 5 | # Copyright (c) 2014-2025, Lars Asplund lars.anders.asplund@gmail.com 6 | 7 | from pathlib import Path 8 | from vunit import VUnit 9 | 10 | ROOT = Path(__file__).parent 11 | 12 | UI = VUnit.from_argv() 13 | UI.add_vhdl_builtins() 14 | 15 | UI.add_library("lib").add_source_files(ROOT / "test" / "*.vhd") 16 | 17 | UI.main() 18 | -------------------------------------------------------------------------------- /vunit/vhdl/logging/src/location_pkg-body-2008m.vhd: -------------------------------------------------------------------------------- 1 | -- This Source Code Form is subject to the terms of the Mozilla Public 2 | -- License, v. 2.0. If a copy of the MPL was not distributed with this file, 3 | -- You can obtain one at http://mozilla.org/MPL/2.0/. 4 | -- 5 | -- Copyright (c) 2014-2025, Lars Asplund lars.anders.asplund@gmail.com 6 | 7 | package body location_pkg is 8 | impure function get_location(path_offset, line_num : natural; file_name : string) return location_t is 9 | variable result : location_t := (file_name => null, line_num => 0); 10 | begin 11 | write(result.file_name, file_name); 12 | result.line_num := line_num; 13 | 14 | return result; 15 | end; 16 | 17 | procedure deallocate(variable location : inout location_t) is 18 | begin 19 | deallocate(location.file_name); 20 | end; 21 | end package body; 22 | -------------------------------------------------------------------------------- /vunit/vhdl/logging/src/location_pkg.vhd: -------------------------------------------------------------------------------- 1 | -- This Source Code Form is subject to the terms of the Mozilla Public 2 | -- License, v. 2.0. If a copy of the MPL was not distributed with this file, 3 | -- You can obtain one at http://mozilla.org/MPL/2.0/. 4 | -- 5 | -- Copyright (c) 2014-2025, Lars Asplund lars.anders.asplund@gmail.com 6 | use std.textio.all; 7 | 8 | package location_pkg is 9 | type location_t is record 10 | file_name : line; 11 | line_num : natural; 12 | end record; 13 | 14 | impure function get_location(path_offset, line_num : natural; file_name : string) return location_t; 15 | procedure deallocate(variable location : inout location_t); 16 | end package; 17 | -------------------------------------------------------------------------------- /vunit/vhdl/logging/src/print_pkg.vhd: -------------------------------------------------------------------------------- 1 | -- This Source Code Form is subject to the terms of the Mozilla Public 2 | -- License, v. 2.0. If a copy of the MPL was not distributed with this file, 3 | -- You can obtain one at http://mozilla.org/MPL/2.0/. 4 | -- 5 | -- Copyright (c) 2014-2025, Lars Asplund lars.anders.asplund@gmail.com 6 | 7 | use std.textio.all; 8 | 9 | use work.log_handler_pkg.stdout_file_name; 10 | 11 | package print_pkg is 12 | 13 | -- Print to an open file object. No internal flushing. 14 | procedure print(constant str : in string; file f : text); 15 | 16 | -- Print to stdout 17 | procedure print(str : string); 18 | 19 | -- Print to named file 20 | procedure print(str : string; 21 | file_name : string; 22 | mode : file_open_kind range write_mode to append_mode := append_mode); 23 | 24 | end package print_pkg; 25 | -------------------------------------------------------------------------------- /vunit/vhdl/path/run.py: -------------------------------------------------------------------------------- 1 | # This Source Code Form is subject to the terms of the Mozilla Public 2 | # License, v. 2.0. If a copy of the MPL was not distributed with this file, 3 | # You can obtain one at http://mozilla.org/MPL/2.0/. 4 | # 5 | # Copyright (c) 2014-2025, Lars Asplund lars.anders.asplund@gmail.com 6 | 7 | from pathlib import Path 8 | from vunit import VUnit 9 | 10 | ROOT = Path(__file__).parent 11 | 12 | UI = VUnit.from_argv() 13 | UI.add_vhdl_builtins() 14 | 15 | UI.add_library("lib").add_source_files(ROOT / "test" / "*.vhd") 16 | 17 | UI.main() 18 | -------------------------------------------------------------------------------- /vunit/vhdl/random/run.py: -------------------------------------------------------------------------------- 1 | # This Source Code Form is subject to the terms of the Mozilla Public 2 | # License, v. 2.0. If a copy of the MPL was not distributed with this file, 3 | # You can obtain one at http://mozilla.org/MPL/2.0/. 4 | # 5 | # Copyright (c) 2014-2025, Lars Asplund lars.anders.asplund@gmail.com 6 | 7 | from pathlib import Path 8 | from vunit import VUnit 9 | 10 | ROOT = Path(__file__).parent 11 | 12 | UI = VUnit.from_argv() 13 | UI.add_vhdl_builtins() 14 | UI.add_random() 15 | 16 | UI.library("vunit_lib").add_source_files(ROOT / "test" / "*.vhd") 17 | 18 | UI.main() 19 | -------------------------------------------------------------------------------- /vunit/vhdl/run/run.py: -------------------------------------------------------------------------------- 1 | # This Source Code Form is subject to the terms of the Mozilla Public 2 | # License, v. 2.0. If a copy of the MPL was not distributed with this file, 3 | # You can obtain one at http://mozilla.org/MPL/2.0/. 4 | # 5 | # Copyright (c) 2014-2025, Lars Asplund lars.anders.asplund@gmail.com 6 | 7 | from pathlib import Path 8 | from vunit import VUnit 9 | 10 | ROOT = Path(__file__).parent 11 | 12 | UI = VUnit.from_argv() 13 | UI.add_vhdl_builtins() 14 | 15 | UI.add_library("tb_run_lib").add_source_files(ROOT / "test" / "*.vhd") 16 | 17 | UI.main() 18 | -------------------------------------------------------------------------------- /vunit/vhdl/run/test/tb_run.vhd: -------------------------------------------------------------------------------- 1 | -- This test suite verifies the VHDL test runner functionality 2 | -- 3 | -- This Source Code Form is subject to the terms of the Mozilla Public 4 | -- License, v. 2.0. If a copy of the MPL was not distributed with this file, 5 | -- You can obtain one at http://mozilla.org/MPL/2.0/. 6 | -- 7 | -- Copyright (c) 2014-2025, Lars Asplund lars.anders.asplund@gmail.com 8 | 9 | entity tb_run is 10 | generic ( 11 | runner_cfg : string; 12 | output_path : string); 13 | end entity tb_run; 14 | 15 | architecture tb of tb_run is 16 | begin 17 | -- Instantiates tests in submodule to avoid unwanted scanning of if run("") 18 | -- This is since we are actually testing those functions themselves here not 19 | -- using them to test other things. 20 | tests : entity work.run_tests 21 | generic map ( 22 | output_path => output_path); 23 | end architecture; 24 | -------------------------------------------------------------------------------- /vunit/vhdl/string_ops/run.py: -------------------------------------------------------------------------------- 1 | # This Source Code Form is subject to the terms of the Mozilla Public 2 | # License, v. 2.0. If a copy of the MPL was not distributed with this file, 3 | # You can obtain one at http://mozilla.org/MPL/2.0/. 4 | # 5 | # Copyright (c) 2014-2025, Lars Asplund lars.anders.asplund@gmail.com 6 | 7 | from pathlib import Path 8 | from vunit import VUnit 9 | 10 | ROOT = Path(__file__).parent 11 | 12 | UI = VUnit.from_argv() 13 | UI.add_vhdl_builtins() 14 | 15 | UI.add_library("lib").add_source_files(ROOT / "test" / "*.vhd") 16 | 17 | UI.main() 18 | -------------------------------------------------------------------------------- /vunit/vhdl/verification_components/src/vc_context.vhd: -------------------------------------------------------------------------------- 1 | -- This Source Code Form is subject to the terms of the Mozilla Public 2 | -- License, v. 2.0. If a copy of the MPL was not distributed with this file, 3 | -- You can obtain one at http://mozilla.org/MPL/2.0/. 4 | -- 5 | -- Copyright (c) 2014-2025, Lars Asplund lars.anders.asplund@gmail.com 6 | 7 | context vc_context is 8 | library vunit_lib; 9 | use vunit_lib.avalon_pkg.all; 10 | use vunit_lib.avalon_stream_pkg.all; 11 | use vunit_lib.bus_master_pkg.all; 12 | use vunit_lib.axi_pkg.all; 13 | use vunit_lib.axi_slave_pkg.all; 14 | use vunit_lib.axi_statistics_pkg.all; 15 | use vunit_lib.axi_stream_pkg.all; 16 | use vunit_lib.memory_pkg.all; 17 | use vunit_lib.memory_utils_pkg.all; 18 | use vunit_lib.stream_master_pkg.all; 19 | use vunit_lib.stream_slave_pkg.all; 20 | use vunit_lib.sync_pkg.all; 21 | use vunit_lib.uart_pkg.all; 22 | use vunit_lib.vc_pkg.all; 23 | use vunit_lib.wishbone_pkg.all; 24 | context vunit_lib.com_context; 25 | end context; 26 | -------------------------------------------------------------------------------- /vunit/vhdl/vunit_context.vhd: -------------------------------------------------------------------------------- 1 | -- This Source Code Form is subject to the terms of the Mozilla Public 2 | -- License, v. 2.0. If a copy of the MPL was not distributed with this file, 3 | -- You can obtain one at http://mozilla.org/MPL/2.0/. 4 | -- 5 | -- Copyright (c) 2014-2025, Lars Asplund lars.anders.asplund@gmail.com 6 | 7 | context vunit_context is 8 | library vunit_lib; 9 | context vunit_lib.data_types_context; 10 | 11 | use vunit_lib.string_ops.all; 12 | use vunit_lib.dictionary.all; 13 | use vunit_lib.path.all; 14 | use vunit_lib.print_pkg.all; 15 | use vunit_lib.log_levels_pkg.all; 16 | use vunit_lib.logger_pkg.all; 17 | use vunit_lib.log_handler_pkg.all; 18 | use vunit_lib.id_pkg.all; 19 | use vunit_lib.ansi_pkg.all; 20 | use vunit_lib.checker_pkg.all; 21 | use vunit_lib.check_pkg.all; 22 | use vunit_lib.run_types_pkg.all; 23 | use vunit_lib.run_pkg.all; 24 | use vunit_lib.runner_pkg.key_t; 25 | use vunit_lib.event_common_pkg.all; 26 | use vunit_lib.event_pkg.all; 27 | end context; 28 | -------------------------------------------------------------------------------- /vunit/vhdl/vunit_run_context.vhd: -------------------------------------------------------------------------------- 1 | -- This Source Code Form is subject to the terms of the Mozilla Public 2 | -- License, v. 2.0. If a copy of the MPL was not distributed with this file, 3 | -- You can obtain one at http://mozilla.org/MPL/2.0/. 4 | -- 5 | -- Copyright (c) 2014-2025, Lars Asplund lars.anders.asplund@gmail.com 6 | 7 | context vunit_run_context is 8 | library vunit_lib; 9 | use vunit_lib.dictionary.all; 10 | use vunit_lib.path.all; 11 | use vunit_lib.checker_pkg.checker_stat_t; 12 | use vunit_lib.run_types_pkg.all; 13 | use vunit_lib.run_pkg.all; 14 | use vunit_lib.runner_pkg.key_t; 15 | end context; 16 | -------------------------------------------------------------------------------- /vunit/vivado/__init__.py: -------------------------------------------------------------------------------- 1 | # This Source Code Form is subject to the terms of the Mozilla Public 2 | # License, v. 2.0. If a copy of the MPL was not distributed with this file, 3 | # You can obtain one at http://mozilla.org/MPL/2.0/. 4 | # 5 | # Copyright (c) 2014-2025, Lars Asplund lars.anders.asplund@gmail.com 6 | 7 | """ 8 | Utilities for integrating with Vivado 9 | """ 10 | 11 | from vunit.vivado.vivado import ( 12 | run_vivado, 13 | add_from_compile_order_file, 14 | create_compile_order_file, 15 | ) 16 | -------------------------------------------------------------------------------- /vunit/vivado/tcl/extract_compile_order.tcl: -------------------------------------------------------------------------------- 1 | set project_file [lindex $argv 0] 2 | set output_file [lindex $argv 1] 3 | 4 | open_project ${project_file} 5 | 6 | set file_out [open ${output_file} w] 7 | foreach ip [get_ips -filter {SCOPE == ""}] { 8 | generate_target {simulation synthesis} ${ip} 9 | foreach src_file [get_files -used_in simulation -compile_order sources -of_objects ${ip}] { 10 | set library [get_property LIBRARY ${src_file}] 11 | set file_type [get_property FILE_TYPE ${src_file}] 12 | puts ${file_out} "${library},${file_type},${src_file}" 13 | } 14 | } 15 | close ${file_out} 16 | --------------------------------------------------------------------------------