Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide public API for finding dependent testbench #977

Open
javValverde opened this issue Nov 9, 2023 · 0 comments
Open

Provide public API for finding dependent testbench #977

javValverde opened this issue Nov 9, 2023 · 0 comments

Comments

@javValverde
Copy link

As discussed in gitter (sorry I don't know how to link the conversation), I want to know which testbenches depend on some desired VHDL/Verilog files.
This code does exactly that, but using private methods:

vu = VUnit.from_argv()

# Add source files to your project here

project = vu._project
dependency_graph = project.create_dependency_graph()
my_files = ["absolute/path/to/file1.vhd", ...]
source_files = [f for f in project.get_source_files_in_order() if f.name in my_files]
dependent_files = [f.name for f in project._get_affected_files(source_files, dependency_graph.get_dependent)]
testbench_files = [tb._test_bench.design_unit.source_file.name for lib in vu.get_libraries() for tb in lib.get_test_benches(allow_empty=True)]
dependent_testbench_files = [f for f in testbench_files if f in dependent_files]

It would be nice to have a public (and stable) API for this use case

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant