Modelsim 6.2a EE crashes on recursive subroutine

H

Hubble

Guest
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.
 
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" <reiner@huober.de> wrote in message
news:1153308476.576682.300970@s13g2000cwa.googlegroups.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.
 
Sorry, I missed the note that it runs correctly with 6.0 but not with 6.2...
forget my previous post.

Simon


"Simon Heinzle" <sheinzle@inf.ethz.ch> wrote in message
news:44be2dba$1@news1.ethz.ch...
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" <reiner@huober.de> wrote in message
news:1153308476.576682.300970@s13g2000cwa.googlegroups.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.
 
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" <reiner@huober.de> wrote in message
news:1153308476.576682.300970@s13g2000cwa.googlegroups.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.
 
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" <reiner@huober.de> wrote in message
news:1153308476.576682.300970@s13g2000cwa.googlegroups.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
 

Welcome to EDABoard.com

Sponsor

Back
Top