Re: modelsim se error

Discussion in 'VHDL' started by Tim Hubberstey, Aug 22, 2003.

  1. Willem Oosthuizen wrote:
    >
    > I have some working code that contains:
    >
    > constant Wait4Fas0_State : std_logic_vector(Ts_Sync_State'range) :=
    > conv_std_logic_vector(0,Ts_Sync_State'length);
    >
    > and
    >
    > case Ts_Sync_State is
    > when Wait4Fas0_State => if Fas_Found_Unbound = '1' then
    >
    > This normally gives me a warning, but with Modelsim SE I get an Error:
    >
    > ** Error:
    > D:/mentor/Hds/hds_projects/my_project/my_project_lib/hdl/basic_e1_syncer_STA
    > TE_MAC.vhd(128): Case choice must be a locally static expression.
    >
    > Surely constants are locally static? Any way to set the tool up to change
    > the error to a warning? I have lots of code that uses
    > conv_std_logic_vector to generate constants. It is pain to rewrite the code.


    <rant on>

    Many things in VHDL *SHOULD* be locally static but aren't. I consider
    this a huge error on the part of the original language developers. The
    justification for this was to make it easier for the compiler! Talk
    about misplaced priorities. This is what happens when you let tool
    developers specify a language instead of the users.

    <rant off>

    ModelSim PE has the following switch in the modelsim.ini file:

    ; Keep silent about case statement static warnings.
    ; Default is to give a warning.
    NoCaseStaticError = 1

    I don't know if this is available in SE but it's worth looking into. I
    don't remember this switch in older versions of PE so it may be a
    relatively new addition. Is your SE version current?

    On a more philosophical note, you should avoid doing anything that
    violates the LRM, even if your tool allows it. At some point you may
    need to change tools, or the tool supplier may decide to correct the
    non-conformance, and then you'll be screwed (like now).
    --
    Tim Hubberstey, P.Eng. . . . . . Hardware/Software Consulting Engineer
    Marmot Engineering . . . . . . . VHDL, ASICs, FPGAs, embedded systems
    Vancouver, BC, Canada . . . . . . . . . . . http://www.marmot-eng.com
     
    Tim Hubberstey, Aug 22, 2003
    #1
    1. Advertising

  2. It is not a big deal to correct the error:

    signal Wait4Fas0_State_S : std_logic_vector(Ts_Sync_State'range);

    Wait4Fas0_State_S <= Wait4Fas0_State; -- outside any process

    case Ts_Sync_State_R is
    when Wait4Fas0_State => if Fas_Found_Unbound = '1' then

    It will work.

    Weng

    Tim Hubberstey <> wrote in message news:<>...
    > Willem Oosthuizen wrote:
    > >
    > > I have some working code that contains:
    > >
    > > constant Wait4Fas0_State : std_logic_vector(Ts_Sync_State'range) :=
    > > conv_std_logic_vector(0,Ts_Sync_State'length);
    > >
    > > and
    > >
    > > case Ts_Sync_State is
    > > when Wait4Fas0_State => if Fas_Found_Unbound = '1' then
    > >
    > > This normally gives me a warning, but with Modelsim SE I get an Error:
    > >
    > > ** Error:
    > > D:/mentor/Hds/hds_projects/my_project/my_project_lib/hdl/basic_e1_syncer_STA
    > > TE_MAC.vhd(128): Case choice must be a locally static expression.
    > >
    > > Surely constants are locally static? Any way to set the tool up to change
    > > the error to a warning? I have lots of code that uses
    > > conv_std_logic_vector to generate constants. It is pain to rewrite the code.

    >
    > <rant on>
    >
    > Many things in VHDL *SHOULD* be locally static but aren't. I consider
    > this a huge error on the part of the original language developers. The
    > justification for this was to make it easier for the compiler! Talk
    > about misplaced priorities. This is what happens when you let tool
    > developers specify a language instead of the users.
    >
    > <rant off>
    >
    > ModelSim PE has the following switch in the modelsim.ini file:
    >
    > ; Keep silent about case statement static warnings.
    > ; Default is to give a warning.
    > NoCaseStaticError = 1
    >
    > I don't know if this is available in SE but it's worth looking into. I
    > don't remember this switch in older versions of PE so it may be a
    > relatively new addition. Is your SE version current?
    >
    > On a more philosophical note, you should avoid doing anything that
    > violates the LRM, even if your tool allows it. At some point you may
    > need to change tools, or the tool supplier may decide to correct the
    > non-conformance, and then you'll be screwed (like now).
     
    Weng Tianxiang, Aug 26, 2003
    #2
    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. Yogi V.

    ModelSim Error Msg

    Yogi V., Jul 1, 2003, in forum: VHDL
    Replies:
    3
    Views:
    23,493
    John Moore
    Jul 3, 2003
  2. Vincent
    Replies:
    3
    Views:
    701
  3. Simone Winkler

    please help! modelsim error

    Simone Winkler, Oct 21, 2003, in forum: VHDL
    Replies:
    1
    Views:
    2,602
    Renaud Pacalet
    Oct 21, 2003
  4. Arnaud Douville

    please help! modelsim error

    Arnaud Douville, Oct 21, 2003, in forum: VHDL
    Replies:
    0
    Views:
    694
    Arnaud Douville
    Oct 21, 2003
  5. fpgaengineer
    Replies:
    7
    Views:
    3,917
    Mike Treseler
    Mar 12, 2007
Loading...

Share This Page