Skip to content
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

Enhancement: Improve cyclic dependency check to allow recursive instantiation #261

Open
Derisis13 opened this issue Feb 18, 2024 · 1 comment

Comments

@Derisis13
Copy link
Contributor

Hi,

I've started using this language server recently, and it's incredible how sophisticated it is compared to all I've previously tried.
However running the LSP on the codebase I work on, it has come to my attention, that the cyclic dependency resolver is way stricter than what's possible without infinite recursion.

One of my IP cores uses recursive self-instantiation, similar to the code in this stack overflow issue: https://stackoverflow.com/questions/38567544/recursive-self-instantiation-component-vhdl (except he uses configurations and I use if-else generate statements combined with entity instantiations)
I can simulate it with Modelsim and even synthesize it with Quartus, but rust_hdl flags it as an error. (and stops evaluating the instantiated IP)
As far as I know self-instantiation is not against the vhdl standard, so it should be allowed by rust_hdl too.

I don't want to ask the impossible: a quick read on the subject has made it clear that this is an example of the halting problem, and it's impossible to solve. I don't have a good idea of how to handle this structure, maybe there's none. But if nothing else, the cyclic dependency could be "demoted" to a warning and the recursed entity analyzed as a black box. This would allow analysis of the IPs that are instantiating the recursive entity.

@Schottkyc137
Copy link
Contributor

Could you provide a minimal reproducible example? The code in the answer doesn't cause an error for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants