I've been trying to set up TextPad to run ModelSim's Verilog compiler and take me to the source of errors (as the Help File says it should be able to).
The compiler is invoked from a makefile via Microsoft nmake; this works fine. The output is correctly captured and displayed in the command window.
Typical output looks like this:
Model Technology ModelSim SE/EE vlog 5.4a Compiler 2000.04 Apr 17 2000
-- Compiling module linecard
ERROR: ..\fpga1\linecard.v(588): near ",": expecting: ENDMODULE
NMAKE : fatal error U1077: 'vlog' : return code '0x1'
Stop.
However double clicking on an error produces the message
D:\....modelsim\ERROR: \fpga1\linecard.v contains an invalid path
II have 4 problems:
(1) I can't tell whether TextPad is complaining about the relative path, or whether it's silently adding the (588) to the file name and complaining about that. No matter what I've tried to keep numbers and brackets out of the file name, it complains with the same message, and is printing a leading '' in the file name (which it shouldn't), so I assume it's the relative path, so how do I fix that ?
(2) I can't see how to get at the line number, since it's part of the same token that the file name is being parsed out of.
(3) The help file doesn't explain how the "registers" are filled: I assume its something to do with the parentheses in the regular expression spec.
(4) I get the distinct impression that despite pressing 'OK' after changing the regular expression, TextPad only updates it after closing and restarting it, since I''ve put ridiculous expressions in and got no change in error message.
The last attempt I used was
^\(Error\:\|Warning\:\) \(.[^()0-9]\) \([0-9]+\):
Version TextPad 4.2.2 (fif that matters)
It would be really nice in trying to set this up, if when it printed an error message, it gave the values of the 3 'registers'. One could then see whether one's regular expression was doing the right thing or not.
Thanks to anyone who can help,
Derek Roberts
Using TextPad to run external Tool
Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard
Re: Using TextPad to run external Tool
No, it is not the number silently added. As it complains about
D:\....modelsim\ERROR: \fpga1\linecard.v
containing an illegal path. Of course it is right about that.
I would try:
^[^:]*: \([^(]*\)(\([0-9]*\):
with register 1 for file and register 2 for line.
But there still might be a problem because of the relative paths. I never had a case with relative paths in tool output so I really can't say.
But I could imagine that textpat can't know the base of the relative path.
Andreas
D:\....modelsim\ERROR: \fpga1\linecard.v
containing an illegal path. Of course it is right about that.
I would try:
^[^:]*: \([^(]*\)(\([0-9]*\):
with register 1 for file and register 2 for line.
But there still might be a problem because of the relative paths. I never had a case with relative paths in tool output so I really can't say.
But I could imagine that textpat can't know the base of the relative path.
Andreas
Re: Using TextPad to run external Tool
Thanks for the suggestion, Andreas.
Sadly your suggestion ^[^:]*: \([^(]*\)(\([0-9]*\): produces the error message
Unmatched ( or { (Note it doesn't say at what position, which is NOT helpful in a statement this complex). I think the problem might be here
^[^:]*: \([^(]*\)Not this bracet-(\([0-9]*\): but removing it just produces the textpad status line warning "Cannot jump to item under cursor". Not exactly informative.
I can also confirm after a bit more experimentation that my assertion in (4) of my original message is nearly true; that is if you change the preference setup for a tool, then those changes are not effective until you next run the tool; i.e. if you want to test changes to the regular expression then you need to keep re-running the tool [ATTN Textpad people: it would be nice to get this fixed
].
Also, I don't really see the problem with getting the relative path right, in that TextPad has provision to set the "Initial Folder" for the tool being run, and this, as far as the tool is concerned will be the base for any relative paths; consequently if TextPad checks the path parsed through its tool output regexp and finds that it starts with a '..' then it should just remove that and bolt on the contents of InitDir - and problem would be sorted.
Sadly your suggestion ^[^:]*: \([^(]*\)(\([0-9]*\): produces the error message
Unmatched ( or { (Note it doesn't say at what position, which is NOT helpful in a statement this complex). I think the problem might be here
^[^:]*: \([^(]*\)Not this bracet-(\([0-9]*\): but removing it just produces the textpad status line warning "Cannot jump to item under cursor". Not exactly informative.
I can also confirm after a bit more experimentation that my assertion in (4) of my original message is nearly true; that is if you change the preference setup for a tool, then those changes are not effective until you next run the tool; i.e. if you want to test changes to the regular expression then you need to keep re-running the tool [ATTN Textpad people: it would be nice to get this fixed

Also, I don't really see the problem with getting the relative path right, in that TextPad has provision to set the "Initial Folder" for the tool being run, and this, as far as the tool is concerned will be the base for any relative paths; consequently if TextPad checks the path parsed through its tool output regexp and finds that it starts with a '..' then it should just remove that and bolt on the contents of InitDir - and problem would be sorted.
Re: Using TextPad to run external Tool
Hi Derek,
use the following (definitely works for your example, I've tried it):
^\(ERROR\|WARNING\): \(.+\)(\([0-9]+\)):
with register 1 (the part that matches ".+") for the file name and register 2 (the part that matches "[0-9]+") for the line.
Andreas' suggestion is missing the parenthesis immediately before the last colon. Sadly, left and right parentheses (without backslash) must match even if default RE syntax is used (makes sense only for POSIX REs). The [^(] in Andreas' RE is not necessary. Relative paths do use the "initial folder" specified for the tool.
Your attempt
^\(Error\:\|Warning\:\) \(.[^()0-9]\) \([0-9]+\):
tells TextPad to look for "Error" or "Warning" (this goes to register 1), followed by (any character followed by any character except for parentheses and digits - this goes to register 2), followed by at least one digit (this goes to register 3), and ended by a colon. Notice that the second subexpression "\(.[^()0-9]\)" matches exactly two characters, because the "+" is missing.
HTH,
Jörg
use the following (definitely works for your example, I've tried it):
^\(ERROR\|WARNING\): \(.+\)(\([0-9]+\)):
with register 1 (the part that matches ".+") for the file name and register 2 (the part that matches "[0-9]+") for the line.
Andreas' suggestion is missing the parenthesis immediately before the last colon. Sadly, left and right parentheses (without backslash) must match even if default RE syntax is used (makes sense only for POSIX REs). The [^(] in Andreas' RE is not necessary. Relative paths do use the "initial folder" specified for the tool.
Your attempt
^\(Error\:\|Warning\:\) \(.[^()0-9]\) \([0-9]+\):
tells TextPad to look for "Error" or "Warning" (this goes to register 1), followed by (any character followed by any character except for parentheses and digits - this goes to register 2), followed by at least one digit (this goes to register 3), and ended by a colon. Notice that the second subexpression "\(.[^()0-9]\)" matches exactly two characters, because the "+" is missing.
HTH,
Jörg
Re: Using TextPad to run external Tool
Can anyone say if the version number is significant here ?
I've just pasted Jörg's suggestion into my preferences and find I still get the 'cannot jump to item under the cursor' message.
I restate my case that debugging output for setting this potentially very useful option up is essential.
I've just pasted Jörg's suggestion into my preferences and find I still get the 'cannot jump to item under the cursor' message.
I restate my case that debugging output for setting this potentially very useful option up is essential.