vunit
vunit copied to clipboard
Support hierarchical library mapping in ModelSim
The library section of the modelsim.ini file allows to refer to a subordinate INI file using an "others" clause (subordinate files may also contain an "others" clause). The current implementation for collecting all mapped libraries ignores the "others" clause. With this change, all library mappings from all subordinate files are included.
@LarsAsplund this as been reviewed by Umarcor, I suggest to merge and close.
I think we should probably add a test for this.
You are right. I don't mind working on that but I do not understand how the tests work. I guess I need to modify the tests/unit/test_modelsim_interface.py but where are specified the content of the tested modelsim.ini ?
If anyone can explain me how the tests are working I would appreciate.
@dalex78 The tests create their own ini files. These doesn't have to be real and complete files but just enough to verify that VUnit handles the files as expected. For example, the test setup creates a file containing a single line: https://github.com/VUnit/vunit/blob/fbb46c60b3b6b150bfaeb6e4fb30afa8ccdaf5a1/tests/unit/test_modelsim_interface.py#L328
Some tests, i.e. https://github.com/VUnit/vunit/blob/fbb46c60b3b6b150bfaeb6e4fb30afa8ccdaf5a1/tests/unit/test_modelsim_interface.py#L257, don't even use valid ini files to verify behavior
In this case you would need to create ini files containing the others clause and verify that VUnit collects the information correctly.
As the author of this pull request, I felt obliged to submit a unit test. @dalex78 Thanks anyway for your offer to take on this "burden".
@LarsAsplund This one might be merged aswell