vunit icon indicating copy to clipboard operation
vunit copied to clipboard

minimal compilation without test benches

Open nifx opened this issue 4 years ago • 1 comments

The VUnit library offers great methods of compiling a project and dealing with test benches. Currently, I'm looking for a solution to offer fast compilation feedback in merge/pull requests. I know that is is somehow out of scope of VUnit, but as far as I understand the documentation, it provides pretty much everything I need to solve it.

Purpose: A developer modifies a VHDL source file and opens a merge request (pull request). A CI pipeline starts to check for issues automatically. A merge is blocked until the pipeline has passed. It is too time consuming to compile the whole project and run all test benches. Fast feedback is required. Unfortunately, incremental compilation is not straight forward in my case.

Idea: Compile only modified sources and all dependencies without running test benches. VUnit offers '--minimal' to only compile files required for the (filtered) test benches. In my case, there are no filtered test benches. Probably, no test bench even exists for the modified module (I know, this should not be the case). Therefore, a modification is needed. I thought about something like:

add_source_file (class vunit.us.Vunit) -> add an additional parameter, e.g. minimal_compile_flag: Optional[bool] Then I can mark specific files which should be used during minimal compilation including all dependencies. If VUnit is used with --minimal command line flag, it compiles all files and dependencies with this new flag plus all files required for the (filtered) test benches

Do you think this makes sense? Do you have any other suggestions?

nifx avatar Feb 11 '21 05:02 nifx

I analyzed the dependency graph and the high level functions

  • get_compile_order
  • get_implementation_subset Probably I have a misunderstanding about the implementation. In my case, the dependency graph for a particular file does not list the files referencing the component instantiation. E.g. a.vhd uses a component implemented in b.vhd. I assumed that b.vhd should be listed somehow in the dependency of a.vhd.

If I use -m to compile only files necessary for a particular test bench, I run into the same issue (component not bound). Vunit does not compile the .vhd, it only compiles the test bench and some packages. If I do a complete compile, everything works as expected. I didn't find an open issue for this. Can anyone confirm that the '-m' argument does its job?

Note: I use the VUnit release 4.4.0, my OS is Win10

nifx avatar Mar 03 '21 13:03 nifx