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
Import statement not recognized #1115
Comments
Original Redmine Comment SystemVerilog specification requires you to declare all packages before you use them. Either put common.v on the command line before microaddr_counter.v, or turn common.v into an include file with appropriate guards and `include it in microaddr_counter.v (and perhaps rename it .vh). FWIW the standard in my company is both - name it .vh, include it, and put it on the command line. |
Original Redmine Comment Well that's the thing -- I did originally put it on the command line (albeit accidentally) via *.v. I also tried:
When I checked the obj_dir directory, I found a lot of VCommon* files, but nothing else. I see nothing having to do with the microaddr_counter module. (In fact, by grepping the code for microaddr, it seems it is there, just not with a filename I expected). In addition, the wiki's arg summary shows this command line:
Which led me to believe that verilator wants all your top level files, but not any supporting files, and that it would find the supporting files from references in the top level files, via a search path. If that's not true, maybe the wiki needs to be updated :) I also found a syntax for files from this forum post: http://www.veripool.org/boards/2/topics/1906-Verilator-Meeded-to-understand-the-reason-for-fatal-warnings
I didn't see that in the wiki either. I suppose this bug has morphed to a plea to change the documentation? |
Original Redmine Comment I've updated the documentation in git. The name of the files in obj_dir will be based on the first file, but will properly implement the top module. Other flags can be used to change the name of the generated files if you desire. |
Author Name: Robert Baruch (@RobertBaruch)
Original Redmine Issue: 1115 from https://www.veripool.org
I'm using Verilator built from head (11/26/2016), and 1800-2012 SystemVerilog.
Command: verilator -Wall -I. --debug -cc microaddr_counter.v
Output:
It seems to me that Verilator needs to know that "common" is a package identifier and not a plain old identifier, but I'm not sure how to tell it. I thought that it would be able to figure it out since "common" comes right after the import keyword.
The text was updated successfully, but these errors were encountered: