[logo] 
 
Home
News
Activity
About/Contact
Major Tools
  Dinotrace
  Verilator
  Verilog-mode
  Verilog-Perl
Other Tools
  BugVise
  CovVise
  Force-Gate-Sim
  Gspice
  IPC::Locker
  Rsvn
  Schedule::Load
  SVN::S4
  Synopsys-modes
  SystemPerl
  Verilog-Pli
  Voneline
  Vregs
General Info
  Papers

Verilator's error message format does not easily allow for standard tools to jump to the related source code file and line

Added by R. Diez 7 months ago

Hi all:

Verilator's warning/error message format does not match that of a C compiler like GCC. Here are some example messages:

%Warning-ASSIGNDLY: /home/blah/blah/adbg_or1k_status_reg.v:184: Unsupported: Ignoring delay on this assignment/primitive.
%Warning-DECLFILENAME: minsoc_tc_top.v:1336: Filename 'minsoc_tc_top' does not match MODULE name: tc_si_to_mt
%Warning-IMPLICIT: lint_top.v:287: Signal definition not found, creating implicitly: wb_rdm_cyc_o
%Error: lint_top.v:54: Pin not found: __pinNumber7

I am developing under emacs, and that means that I cannot click on a warning or error message and jump to the right location in the source code, because emacs does not correctly extract the filename in those messages. This issue is probably not specific to emacs, I'm sure other development environments will have a similar problem.

I know you can adjust some regular expression in emacs in order to decode those lines correctly, but I'm not very skilled at regex hacking. 8-)

This is how GCC's warnings look like:

some-file.cpp:123: warning: blah blah

I guess most tools will be happier with such a message format.

By the way, I have so many Verilog include paths in the Verilator invocation, that it would be ideal if the filenames in those error messages were given as absolute paths.

Regards, R. Diez


Replies (4)

RE: Verilator's error message format does not easily allow for standard tools to jump to the related source code file and line - Added by Wilson Snyder 7 months ago

I hate GCC format as while it's more 'standard' it's both harder to parse, and you can't definitively know what is an error, so I'm going to be stubborn on this, sorry.

Aren't you using verilog-mode? It understands this format out of the box; though if not working you may need to see

http://www.veripool.org/wiki/verilog-mode/Faq#Why-do-the-simulator-errors-not-highlight-or-goto-error-correctly

As for relative vs absolute paths it uses whatever it is given plus the current directory; chdir to an empty directory and use -I{full-path} and all names will be absolute.

RE: Verilator's error message format does not easily allow for standard tools to jump to the related source code file and line - Added by R. Diez 7 months ago

Is there another error message format which you do not hate and which works with the standard emacs rules?

Why is it an issue that GCC's format is harder to parse or recognise? emacs is the one doing the parsing. Is Verilator's perl wrapper parsing the messages? If so, it could spit them out with GCC's format for the next tool in the chain.

I tried the "add-hook" method described in the FAQ under 'The solution is to disable the "gnu" rule.', and that didn't work for me, Verilator's warning and error messages are not recognised at all. I'm using emacs 23.2.1 with the verilator-mode that came with it, and I'm calling routine 'compile' from a Lisp function I wrote.

Even if the solution in the FAQ worked, the mentioned solution has its issues too:

1) Verilator requires special treatment here, I need to edit my emacs config files. I spend half of my time overcoming special glitches in EDA tools!

2) You must open a .v file before compiling, otherwise that hook function will not trigger and you will be left wondering.

3) I have an emacs function that compiles the Verilog files with Verilator and then Verilator's C++ output with GCC. Using that method means that GCC warning and error messages from my DPI modules will no longer be recognised by emacs.

About the absolute file names, your suggestion to chdir to an empty directory is yet again another special treatment. A --full-path-in-compilation-messages flag would be cleaner, especially for the next maintainer of the build scripts. Or maybe full paths should be the default.

RE: Verilator's error message format does not easily allow for standard tools to jump to the related source code file and line - Added by Wilson Snyder 7 months ago

I'll see what other messages formats are supported by Emacs out of the box.

You must open a .v file before compiling, otherwise that hook function will not trigger and you will be left wondering.

Unfortunately true. In your .emacs I think it's enough to call

(require `verilog-mode)

have an emacs function that compiles the Verilog files with Verilator and then Verilator's C++ output with GCC

That should work I do that too, the mess is that the GCC regexps have to go AFTER the other ones, this is what the verilog-error-regexp-add-emacs function does, as the GCC rule is simply "(word):(number):" which is very broad. If it doesn't work please file a bug on verilog-mode, as this same hack is needed for nearly all other verilog tools too (part of your point :)

As to absolute names, the problem with making them absolute is that that isn't often what others can use; for example in several of my environments we resolve only until we get to a common high level symlink (project/foo/bar); that's important in large groups so that ccache or scons will detect hits across multiple people compiling the same source code in different working directories. Perhaps the real problem is Verilator's implicit adding of the current directory? How about I add an option to suppress that, then you add "-I`pwd`"? That makes Verilator match what GCC does, which seems good, especially if you want to get your gcc compiles to also be absolute paths.

(1-4/4)