Skip to content

Erroneous cyclic dependency when using VHDL configurations #1183

@masubious

Description

@masubious

Hello,

we're using VHDL configurations in our Simulation Setup. With the current VUnit-5.0.0.dev10 this Setup fails with this error:

Re-compile not needed

Traceback (most recent call last):
  File "C:\Python311\Lib\site-packages\vunit\ui\__init__.py", line 737, in main
    all_ok = self._main(post_run)
             ^^^^^^^^^^^^^^^^^^^^
  File "C:\Python311\Lib\site-packages\vunit\ui\__init__.py", line 783, in _main
    all_ok = self._main_run(post_run)
             ^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python311\Lib\site-packages\vunit\ui\__init__.py", line 1055, in _main_run
    self._run_test(test_list, report, simulator_if)
  File "C:\Python311\Lib\site-packages\vunit\ui\__init__.py", line 1233, in _run_test
    latest_dependency_updates = self._get_latest_dependency_updates()
                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python311\Lib\site-packages\vunit\ui\__init__.py", line 890, in _get_latest_dependency_updates
    source_files_in_order = self._dependency_graph.toposort()
                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python311\Lib\site-packages\vunit\dependency_graph.py", line 35, in toposort
    self._visit(
  File "C:\Python311\Lib\site-packages\vunit\dependency_graph.py", line 103, in _visit
    visit(node)
  File "C:\Python311\Lib\site-packages\vunit\dependency_graph.py", line 90, in visit
    visit(other_node)
  File "C:\Python311\Lib\site-packages\vunit\dependency_graph.py", line 90, in visit
    visit(other_node)
  File "C:\Python311\Lib\site-packages\vunit\dependency_graph.py", line 90, in visit
    visit(other_node)
  [Previous line repeated 2 more times]
  File "C:\Python311\Lib\site-packages\vunit\dependency_graph.py", line 83, in visit
    raise CircularDependencyException(path_ordered[start:] + [node])
vunit.dependency_graph.CircularDependencyException

This circular dependency is caused by the following construct:
tb_top instantiates testcase_top via component instantiation. testcase_top is split in a file for the enitity and multiple files with different architectures. There is one architecture per file with individual names (the testcases themself). In the architecture file is the needed configuration for the testcase_top instantiation aswell. This is the cause of the apparently false circular dependency. tb_top -> testcase_top -> tb_top.

In the provided example vhdl_configuration -> tb_selecting_test_runner_with_vhdl_configuration.vhd this behaviour does not occur. In this example the configuration is in a separate file (test_reset_behavioral.vhd) and the circular dependency error does not occur.
Sadly this is a worse solution due to the need to edit two files when adding a testcase.

What is the intended behaviour?

I have attached a MVP project displaying the described behaviour.

tb_dff.zip

Thank you for your help and Kind Regards,
~ Raik

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions