Search code examples
vhdlverificationxunitmodelsimvunit

VUnit: ERROR - Cannot add library named work using `udp_ip_stack-master`


Wanted to try out VUnit, thus followed the Getting Started 1-2-3.

For blog 1, I installed Python ver. 3.6 and using ModelSim ver. 10.5a.

For blog 2, I downloaded example project udp_ip_stack-master.zip example project, but when I run:

python run.py --compile

the result is the error shown below:

C:\work\udp_ip_stack-master>python run.py --compile
  ERROR - Cannot add library named work. work is a reference to the current library. http://www.sigasi.com/content/work-not-vhdl-library
Traceback (most recent call last):
  File "C:\Python36\lib\site-packages\vunit\ui.py", line 728, in main
    all_ok = self._main()
  File "C:\Python36\lib\site-packages\vunit\ui.py", line 765, in _main
    return self._main_compile_only()
  File "C:\Python36\lib\site-packages\vunit\ui.py", line 820, in _main_compile_only
    self._compile(simulator_if)
  File "C:\Python36\lib\site-packages\vunit\ui.py", line 855, in _compile
    continue_on_error=self._keep_compiling)
  File "C:\Python36\lib\site-packages\vunit\simulator_interface.py", line 133, in compile_project
    self.setup_library_mapping(project)
  File "C:\Python36\lib\site-packages\vunit\modelsim_interface.py", line 143, in setup_library_mapping
    project.add_library(library_name, library_dir, is_external=True)
  File "C:\Python36\lib\site-packages\vunit\project.py", line 68, in add_library
    self._validate_library_name(logical_name)
  File "C:\Python36\lib\site-packages\vunit\project.py", line 60, in _validate_library_name
    raise RuntimeError("Illegal library name 'work'")
RuntimeError: Illegal library name 'work'

This project should not define any library named work, and as example project I would expect that it worked out of the box. What can be the problem?


Solution

  • The "modelsim.ini" file contained:

    work = work
    

    and this made VUnit break with the mentioned error.

    I suspect that quite a number of simulations uses work as an actually library name, doing for example vlib work in ModelSim, and this actually works fine, so maybe worth allowing this in VUnit, unless there is a substantial reason for not allowing this.