Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
I notice that
Here is a minimal example of code that runs on commercial simulators:
module mod(); integer value = 1; initial begin $display("value is %d", $root.mod.value); end endmodule
Here is the error I got when running the verilator with lint only option:
For a quick reference,
Although I never touched Verilator internal before, I'm very interested in helping implementing this feature. Please let me know if there is a place I should start looking at.
Great, would love to have the assistance to add this. I think the $root reference in the change log was just a way of saying there was two top conflicts not that $root itself worked.
The first step is to make a test_regress format test (see the internals doc), it would be good to make sure there is a e.g, "logic mod;" inside a function so that $root.mod is required to disambiguate which mod is needed.
To support this, add $root to verilog.l replacing the error you see. Add the token to verilog.l, there's comments where it properly goes. Add a new AstRoot in AstNodes.h, and in verilog.y make a AstRoot. Search for where AstDot is used; ultimately the code uses AstDot (the "." in a dotted id) to find the symbols in an AstSym; in the case of $root rather than starting the symbol search in the normal place, it needs to use the root symbol tree, then search down for each dotted component from there as normal.