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
Internal error with nested virtual interfaces/bind statements #4767
Comments
Here's a slightly reformatted example that can be dropped into test_regress:
|
The issue seems to be V3Scope.cpp doesn't properly reconcile hierarchical references into locally bound objects. The VARREF that throws the error does appear properly linked though by earlier stages. |
I run into problem the similar (or same). Here is my simplified test showing the problem with the latest verilator directly: s.sv
And the Vtest_tb_990_final.tree is attached here. I tested the s.sv can be simulated in the vivado xsim. |
+1 Thanks @ganghuang for the simplified test case! |
I am compiling this code with
verilator -sv -cc --top-module test test.sv
and am getting the following:%Error: Internal Error: test.sv:17:38: ../V3Scope.cpp:74: Can't locate varref scope : ... note: In instance 'test.dut.top_if' 17 | virtual Sub_if sub_if = sub_mod1.sub_i
I believe that it is likely either an issue with the nested interfaces, or that it is an issue with the scoping when using the bind statement. This code does compile and run when using VCS.
What 'verilator --version' are you using? Did you try it with the git master version?
I am using the current stable branch of verilator, v5.018.
What OS and distribution are you using?
Linux Ubuntu 20.04
May we assist you in trying to fix this in Verilator yourself?
If the change is simple I could work on it with guidance, although I do not have a lot of compilers experience. I am mostly looking for a potential workaround in the meantime as this pattern appears many times in the testbench I am currently adapting to work with Verilator. Any help is appreciated, thank you in advance.
The text was updated successfully, but these errors were encountered: