Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > VHDL > Modelsim 6.2a EE crashes on recursive subroutine

Reply
Thread Tools

Modelsim 6.2a EE crashes on recursive subroutine

 
 
Hubble
Guest
Posts: n/a
 
      07-19-2006
Hi all,

I used Modelsim 6.0c for a testbench and am now supposed to switch to
Modelsim 6.2a. My testbench consides a file reader module, which is
able to include other files. For this, I am using a procedure "scan"
which has a string parameter.

The body of scan readas the scafile line by line. If a line contains
"INC filename", scan calls inc_command which calls scan recursively and
includes the file.

AFAIK, this is a common technique. However, on Modulsim 6.2a ("vcom
-93"), the compiler crashes saying "segmentation fault". It seems to
read everything, pauses before the end and then faults leaving a _lock
file. Modelsim 6.0c did run perfectly. I tried "-O0" with no luck.

The outline of the module is as follows:

Scanfile_P: process
procedure scan(filename: string) is

file scanfile: text is filename;
variable args: tbs_dynarray; -- argument list
...
procedure inc_command(...)
begin
...
scan(f); -- recursion
...
end;

begin
if (...) then
writecommand(...);
elsif (...) then
inc_command(...);
end if;
end;
begin
scan(G_SCANFILE); -- G_SCANFILE is a generic
end -- Scanfile_P;


Hubble.

 
Reply With Quote
 
 
 
 
Simon Heinzle
Guest
Posts: n/a
 
      07-19-2006
You probably set the break condition wrong and your subroutine is recursing
infinitely. (Therefore resulting in a stack overflow at some time)

I noticed similar problems with infinite loops like

while i < 10 loop
-- do something
-- but don't increment i
end loop;

where Modelsim just hangs.

Best,
Simon


"Hubble" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) oups.com...
> Hi all,
>
> I used Modelsim 6.0c for a testbench and am now supposed to switch to
> Modelsim 6.2a. My testbench consides a file reader module, which is
> able to include other files. For this, I am using a procedure "scan"
> which has a string parameter.
>
> The body of scan readas the scafile line by line. If a line contains
> "INC filename", scan calls inc_command which calls scan recursively and
> includes the file.
>
> AFAIK, this is a common technique. However, on Modulsim 6.2a ("vcom
> -93"), the compiler crashes saying "segmentation fault". It seems to
> read everything, pauses before the end and then faults leaving a _lock
> file. Modelsim 6.0c did run perfectly. I tried "-O0" with no luck.
>
> The outline of the module is as follows:
>
> Scanfile_P: process
> procedure scan(filename: string) is
>
> file scanfile: text is filename;
> variable args: tbs_dynarray; -- argument list
> ...
> procedure inc_command(...)
> begin
> ...
> scan(f); -- recursion
> ...
> end;
>
> begin
> if (...) then
> writecommand(...);
> elsif (...) then
> inc_command(...);
> end if;
> end;
> begin
> scan(G_SCANFILE); -- G_SCANFILE is a generic
> end -- Scanfile_P;
>
>
> Hubble.
>



 
Reply With Quote
 
 
 
 
Simon Heinzle
Guest
Posts: n/a
 
      07-19-2006
Sorry, I missed the note that it runs correctly with 6.0 but not with 6.2...
forget my previous post.

Simon


"Simon Heinzle" <(E-Mail Removed)> wrote in message
news:44be2dba$(E-Mail Removed)...
> You probably set the break condition wrong and your subroutine is
> recursing infinitely. (Therefore resulting in a stack overflow at some
> time)
>
> I noticed similar problems with infinite loops like
>
> while i < 10 loop
> -- do something
> -- but don't increment i
> end loop;
>
> where Modelsim just hangs.
>
> Best,
> Simon
>
>
> "Hubble" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed) oups.com...
>> Hi all,
>>
>> I used Modelsim 6.0c for a testbench and am now supposed to switch to
>> Modelsim 6.2a. My testbench consides a file reader module, which is
>> able to include other files. For this, I am using a procedure "scan"
>> which has a string parameter.
>>
>> The body of scan readas the scafile line by line. If a line contains
>> "INC filename", scan calls inc_command which calls scan recursively and
>> includes the file.
>>
>> AFAIK, this is a common technique. However, on Modulsim 6.2a ("vcom
>> -93"), the compiler crashes saying "segmentation fault". It seems to
>> read everything, pauses before the end and then faults leaving a _lock
>> file. Modelsim 6.0c did run perfectly. I tried "-O0" with no luck.
>>
>> The outline of the module is as follows:
>>
>> Scanfile_P: process
>> procedure scan(filename: string) is
>>
>> file scanfile: text is filename;
>> variable args: tbs_dynarray; -- argument list
>> ...
>> procedure inc_command(...)
>> begin
>> ...
>> scan(f); -- recursion
>> ...
>> end;
>>
>> begin
>> if (...) then
>> writecommand(...);
>> elsif (...) then
>> inc_command(...);
>> end if;
>> end;
>> begin
>> scan(G_SCANFILE); -- G_SCANFILE is a generic
>> end -- Scanfile_P;
>>
>>
>> Hubble.
>>

>
>



 
Reply With Quote
 
Hans
Guest
Posts: n/a
 
      07-19-2006
Hi Hubble,

IMHO Modelsim 6.2a is very flaky and I also had several crashes up to a
point that I re-installed 6.1f again. This might not be surprising given
that 6.2a is the first major upgrade and contains a lot of extra stuff.

One thing I did notice is that vopt seems to be the cause of a lot of issues
so try using -novopt (assuming you have this option in your EE version?),

Hans
www.ht-lab.com


"Hubble" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) oups.com...
> Hi all,
>
> I used Modelsim 6.0c for a testbench and am now supposed to switch to
> Modelsim 6.2a. My testbench consides a file reader module, which is
> able to include other files. For this, I am using a procedure "scan"
> which has a string parameter.
>
> The body of scan readas the scafile line by line. If a line contains
> "INC filename", scan calls inc_command which calls scan recursively and
> includes the file.
>
> AFAIK, this is a common technique. However, on Modulsim 6.2a ("vcom
> -93"), the compiler crashes saying "segmentation fault". It seems to
> read everything, pauses before the end and then faults leaving a _lock
> file. Modelsim 6.0c did run perfectly. I tried "-O0" with no luck.
>
> The outline of the module is as follows:
>
> Scanfile_P: process
> procedure scan(filename: string) is
>
> file scanfile: text is filename;
> variable args: tbs_dynarray; -- argument list
> ...
> procedure inc_command(...)
> begin
> ...
> scan(f); -- recursion
> ...
> end;
>
> begin
> if (...) then
> writecommand(...);
> elsif (...) then
> inc_command(...);
> end if;
> end;
> begin
> scan(G_SCANFILE); -- G_SCANFILE is a generic
> end -- Scanfile_P;
>
>
> Hubble.
>



 
Reply With Quote
 
Hubble
Guest
Posts: n/a
 
      07-20-2006

Hans schrieb:

> Hi Hubble,
>
> IMHO Modelsim 6.2a is very flaky and I also had several crashes up to a
> point that I re-installed 6.1f again. This might not be surprising given
> that 6.2a is the first major upgrade and contains a lot of extra stuff.
>
> One thing I did notice is that vopt seems to be the cause of a lot of issues
> so try using -novopt (assuming you have this option in your EE version?),
>
> Hans
> www.ht-lab.com
>
>
> "Hubble" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed) oups.com...
> > Hi all,
> >
> > I used Modelsim 6.0c for a testbench and am now supposed to switch to
> > Modelsim 6.2a. My testbench consides a file reader module, which is
> > able to include other files. For this, I am using a procedure "scan"
> > which has a string parameter.
> >
> > The body of scan readas the scafile line by line. If a line contains
> > "INC filename", scan calls inc_command which calls scan recursively and
> > includes the file.
> >
> > AFAIK, this is a common technique. However, on Modulsim 6.2a ("vcom
> > -93"), the compiler crashes saying "segmentation fault". It seems to
> > read everything, pauses before the end and then faults leaving a _lock
> > file. Modelsim 6.0c did run perfectly. I tried "-O0" with no luck.
> >
> > The outline of the module is as follows:
> >
> > Scanfile_P: process
> > procedure scan(filename: string) is
> >
> > file scanfile: text is filename;
> > variable args: tbs_dynarray; -- argument list
> > ...
> > procedure inc_command(...)
> > begin
> > ...
> > scan(f); -- recursion
> > ...
> > end;
> >
> > begin
> > if (...) then
> > writecommand(...);
> > elsif (...) then
> > inc_command(...);
> > end if;
> > end;
> > begin
> > scan(G_SCANFILE); -- G_SCANFILE is a generic
> > end -- Scanfile_P;
> >
> >
> > Hubble.
> >


Thanks Hans. However -novopt did not help.

Hubble

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
James Gosling the Creator of EMACS and JAVA - leaves ORACLE - Butthen reports started coming in of odd failures. Systems would crashstrangely. We'd get crashes in applications. All applications. Crashes in thekernel. small Pox C Programming 2 07-22-2010 10:07 PM
Recursive functions Vs Non-recursive functions - performance aspect vamsi C Programming 21 03-09-2009 10:53 PM
Two recursive calls inside of a recursive function n00m C++ 12 03-13-2008 03:18 PM
use one subroutine's variable value in another subroutine inside a module. king Perl Misc 5 04-29-2007 06:39 AM
Lexical reference to an anonymous recursive subroutine: impossible? florian Perl Misc 9 04-20-2007 11:39 PM



Advertisments