Modelsim 6.2a EE crashes on recursive subroutine

Discussion in 'VHDL' started by Hubble, Jul 19, 2006.

  1. Hubble

    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.
     
    Hubble, Jul 19, 2006
    #1
    1. Advertising

  2. 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" <> wrote in message
    news:...
    > 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.
    >
     
    Simon Heinzle, Jul 19, 2006
    #2
    1. Advertising

  3. Sorry, I missed the note that it runs correctly with 6.0 but not with 6.2...
    forget my previous post.

    Simon


    "Simon Heinzle" <> wrote in message
    news:44be2dba$...
    > 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" <> wrote in message
    > news:...
    >> 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.
    >>

    >
    >
     
    Simon Heinzle, Jul 19, 2006
    #3
  4. Hubble

    Hans Guest

    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" <> wrote in message
    news:...
    > 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, Jul 19, 2006
    #4
  5. Hubble

    Hubble Guest

    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" <> wrote in message
    > news:...
    > > 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
     
    Hubble, Jul 20, 2006
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Casey
    Replies:
    3
    Views:
    855
    Casey
    Jan 30, 2004
  2. n00m
    Replies:
    12
    Views:
    1,115
  3. vamsi
    Replies:
    21
    Views:
    2,081
    Keith Thompson
    Mar 9, 2009
  4. florian
    Replies:
    9
    Views:
    117
    Michael Carman
    Apr 21, 2007
  5. king
    Replies:
    5
    Views:
    186
Loading...

Share This Page