-
Notifications
You must be signed in to change notification settings - Fork 263
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
VHDL circular dependency when an architecture maps to another architecture using the same entity #532
Comments
I think there is a circular dependecy between files, indeed. File The expected structure is:
Any of these approaches should avoid the error. |
That might not true. There is no real circular dependency. The architecture of the instantiation is only evaluated during elaboration, I guess. |
You are correct, from a VHDL point of view. Precisely, none of the simulators fail. @rugebiker tested it with ModelSim and Vivado, and I tested it with GHDL (although I had to fix |
AFAIK vunit uses the dependency scanner to generate the compile order. In the presented case, the compile order can be solved.
|
See https://github.com/VUnit/vunit/blob/master/vunit/dependency_graph.py#L65-L71. I think that it raises an exception as soon as it visits a node twice, where a node is a file. |
Yes, the problematic code is also in here. I need to think about the implications of the problem on the code. Maybe the dependency graph has to be rewritten in such cases or the generation of the file list. |
Indeed. Maybe it is an idea to completely split the entities and architectures into different trees, but I can imagine it would be a lot of redesign. |
Is it really legal for entity_architecture1.vhd to reference architecture2 before it has been analyzed? |
I am not sure about what you mean with 'compile stage'. I'd say, correct me if not, that 'compile' is the term used by some vendors (e.g. Mentor's
Hence, Regarding GHDL, I believe you can analize sources in any order, and it will generate an internal index. Then, during elaboration, it will find and bind all the instances. |
Maybe we can remove this dependency. I just vaguely remember that we added the dependency due to a problem we found. Maybe it was when an architecture is referenced explicitly in a configuration. |
Hi,
I have an error of circular dependency when two architectures use the same entity, and one of them maps to the other one. Attached is a small example testbench where I get this error.
Description of files:
run.py : Simple, just adds files and launches the test
tb_circular_dependency : Empty test, just for example. Maps to entity(architecture1).
entity_architecture1.vhd : This file contains an entity and an architecture of that entity.
architecture2.vhd : This file contains a second architecture of the same entity provided in the previous mentioned file.
architecture1 (the one on the first file) contains a direct declaration of a component which is entity(architecture2).
The error I get is:
Expected behaviour: There is no real VHDL circular dependency here. Both ModelSim (standalone simulation) and Vivado (Simulation and Synthesis) work correctly.
Example project:
circular_dependency.tar.gz
just run:
python run.py
The text was updated successfully, but these errors were encountered: