+ Post New Thread
Results 1 to 13 of 13
  1. #1
    Advanced Member level 2
    Points: 3,910, Level: 14

    Join Date
    Apr 2011
    Posts
    540
    Helped
    24 / 24
    Points
    3,910
    Level
    14

    Can one force ModelSim to flag signals missing signals in sensitivity list?

    In VHDL we often use processes not trigerred by clock e.g next state process for FSM. In this case, there may be a long list of signals that must be put into the sensitivity list.

    I have noticed that if a signal is missing in sensitivity list, the code may still work when synthesized but will not work in simuation. This often leads to confusion and wasted time.

    Is there a way to detect signals that must be present in VHDL process sensitivity list but are missing when using ModelSim? It does not seem to flag up such things by default.

  2. #2
    Advanced Member level 5
    Points: 20,409, Level: 34
    barry's Avatar
    Join Date
    Mar 2005
    Location
    California, USA
    Posts
    3,934
    Helped
    849 / 849
    Points
    20,409
    Level
    34

    Re: Can one force ModelSim to flag signals missing signals in sensitivity list?

    If you use VHDL 2008 you can just use "all" in the sensitivity list .



  3. #3
    Advanced Member level 5
    Points: 35,892, Level: 46
    Achievements:
    7 years registered

    Join Date
    Jun 2010
    Posts
    6,567
    Helped
    1914 / 1914
    Points
    35,892
    Level
    46

    Re: Can one force ModelSim to flag signals missing signals in sensitivity list?

    Quote Originally Posted by matrixofdynamism View Post
    In VHDL we often use processes not trigerred by clock e.g next state process for FSM. In this case, there may be a long list of signals that must be put into the sensitivity list.

    I have noticed that if a signal is missing in sensitivity list, the code may still work when synthesized but will not work in simuation. This often leads to confusion and wasted time.

    Is there a way to detect signals that must be present in VHDL process sensitivity list but are missing when using ModelSim? It does not seem to flag up such things by default.
    Yes you can.
    the vcom command has a -check_synthesis switch :

    Quote Originally Posted by Modelsim Command Reference Manual
    -check_synthesis
    (optional) Turns on limited synthesis rule compliance checking. Specifically, it checks to
    see that signals read by a process are in the sensitivity list. The checks understand only
    combinational logic, not clocked logic. Edit the CheckSynthesis variable in the modelsim.ini
    file to set a permanent default.


    2 members found this post helpful.

    •   Alt29th December 2017, 10:43

      advertising

        
       

  4. #4
    Advanced Member level 3
    Points: 6,061, Level: 18
    Achievements:
    7 years registered

    Join Date
    Jul 2010
    Location
    Sweden
    Posts
    785
    Helped
    319 / 319
    Points
    6,061
    Level
    18

    Re: Can one force ModelSim to flag signals missing signals in sensitivity list?

    I never use a "next state" combinatorial process. I write state machines as one clocked process.
    With the tools we have today, I don't see any reason to use 2 processes for one state machine.



  5. #5
    Advanced Member level 5
    Points: 20,409, Level: 34
    barry's Avatar
    Join Date
    Mar 2005
    Location
    California, USA
    Posts
    3,934
    Helped
    849 / 849
    Points
    20,409
    Level
    34

    Re: Can one force ModelSim to flag signals missing signals in sensitivity list?

    Quote Originally Posted by std_match View Post
    I never use a "next state" combinatorial process. I write state machines as one clocked process.
    With the tools we have today, I don't see any reason to use 2 processes for one state machine.

    I agree. I never understood that whole separate "next state" nonsense.



  6. #6
    Advanced Member level 5
    Points: 35,892, Level: 46
    Achievements:
    7 years registered

    Join Date
    Jun 2010
    Posts
    6,567
    Helped
    1914 / 1914
    Points
    35,892
    Level
    46

    Re: Can one force ModelSim to flag signals missing signals in sensitivity list?

    Quote Originally Posted by barry View Post
    I agree. I never understood that whole separate "next state" nonsense.
    From my understanding, it comes from several places:

    1. Synthesis tools use to require separate processes for logic and registers.
    2. Some engineers (usually old timers) seem to understand separated logic/register processes better. These people also often also like using schematics.
    3. Because of 1/2, text books and tutorials taught separated logic/register styles.
    4. There are some that argue, that with a single process, it becomes "harder" to write unregistered outputs, as you then have to use the state machine directly in the combinatorial logic.

    Using a single process style, it can be easy to write a monster of a process (and I have been guity of it in the past) that becomes harder for others to follow, where separate processes would be better. But that is true of any style, though I think with single process style, it is easier to do.



    •   Alt1st January 2018, 09:37

      advertising

        
       

  7. #7
    Member level 3
    Points: 2,362, Level: 11

    Join Date
    Nov 2006
    Posts
    59
    Helped
    6 / 6
    Points
    2,362
    Level
    11

    Re: Can one force ModelSim to flag signals missing signals in sensitivity list?

    In the compile menu in modelsim, select "compile options". Under VHDL tab, under "Check for" enable the checkbox "synthesize". When you run the command "vcom" for vhdl files, you will find few warnings like missing signals from the sensitivity list.


    1 members found this post helpful.

  8. #8
    Advanced Member level 4
    Points: 5,810, Level: 18

    Join Date
    Apr 2016
    Posts
    1,223
    Helped
    218 / 218
    Points
    5,810
    Level
    18

    Re: Can one force ModelSim to flag signals missing signals in sensitivity list?

    Quote Originally Posted by barry View Post
    I agree. I never understood that whole separate "next state" nonsense.
    debugging is much much much easier. I am not talking about functional debugging, I am talking about timing issues. When you have to optimise that one critical path that is killing your entire performance, it becomes much easier if you can do it separately.
    Really, I am not Sam.


    1 members found this post helpful.

  9. #9
    Advanced Member level 2
    Points: 3,910, Level: 14

    Join Date
    Apr 2011
    Posts
    540
    Helped
    24 / 24
    Points
    3,910
    Level
    14

    Re: Can one force ModelSim to flag signals missing signals in sensitivity list?

    These answers are helpful. I learnt that the process to generate next state is combinatorial and thus should have its own process. It is a "good practice".



  10. #10
    Advanced Member level 5
    Points: 20,409, Level: 34
    barry's Avatar
    Join Date
    Mar 2005
    Location
    California, USA
    Posts
    3,934
    Helped
    849 / 849
    Points
    20,409
    Level
    34

    Re: Can one force ModelSim to flag signals missing signals in sensitivity list?

    Quote Originally Posted by matrixofdynamism View Post
    These answers are helpful. I learnt that the process to generate next state is combinatorial and thus should have its own process. It is a "good practice".
    I, and many others, would disagree that splitting the FSM into separate processes is "good practice". (An equal number would probably take the opposite view.) When you use a separate combinatorial process there is the danger of inadvertently creating latches. Furthermore, I, personally, wouldn't find debugging "much much easier" using separate processes. In fact, that complicates debugging as you now have to look in TWO processes for the problem rather than one.

    In the end, if you write your code properly either method should yield identical results and it comes down to a matter of preference and style.

    Another thing: I tend to make all of my outputs registers, so everything fits happily into my clocked process. You've got thousands and thousands of registers, you might as well use them.



    •   Alt11th January 2018, 23:17

      advertising

        
       

  11. #11
    Advanced Member level 5
    Points: 35,892, Level: 46
    Achievements:
    7 years registered

    Join Date
    Jun 2010
    Posts
    6,567
    Helped
    1914 / 1914
    Points
    35,892
    Level
    46

    Re: Can one force ModelSim to flag signals missing signals in sensitivity list?

    Quote Originally Posted by matrixofdynamism View Post
    These answers are helpful. I learnt that the process to generate next state is combinatorial and thus should have its own process. It is a "good practice".
    I dont know. I would recommend 1 process, as would many others.
    "Good Practice" is good code that works well and is useable and readible by others. Ive seen "good practice" code that is terrible, and "bad practice" code that is good.



  12. #12
    Advanced Member level 4
    Points: 7,334, Level: 20
    Achievements:
    7 years registered Created Blog entry
    dpaul's Avatar
    Join Date
    Jan 2008
    Location
    Germay
    Posts
    1,079
    Helped
    238 / 238
    Points
    7,334
    Level
    20
    Blog Entries
    1

    Re: Can one force ModelSim to flag signals missing signals in sensitivity list?

    I learnt that the process to generate next state is combinatorial and thus should have its own process. It is a "good practice"
    As pointed by many others it was a "good practice", but maybe 10 yrs ago. In the university when I was learning VHDL, I was writing state machines as two clocked process and had used Modelsim 6b or something like that.
    The modern "good practice" is a 1 clocked process, in my opinion and I have never run into problems.

    There are some white papers analyzing both practices and discussing their pros and cons. You can search, download and read them.
    In the end it is a matter of perspective.
    .....yes, I do this for fun!



  13. #13
    Advanced Member level 3
    Points: 5,112, Level: 16

    Join Date
    Feb 2015
    Posts
    851
    Helped
    244 / 244
    Points
    5,112
    Level
    16

    Re: Can one force ModelSim to flag signals missing signals in sensitivity list?

    In either case, you should be able to read/write either. You should also know the fundamental differences and common pitfalls of each.

    In many cases, a one-process FSM is fine from a design perspective. The exception is any time next_state is used for output logic that cannot tolerate the extra one cycle of delay. This can occur when interacting with another module. The one I see most frequently is the use of empty to generate a registered read signal. However it could happen in other situations.

    There are actually some interesting variations on the one/two process designs that mitigate a lot of the problems of either. One process has the issue that new devs still want to define logic as it occurs within a state vs as it occurs on transitions. two process has a lot of verbosity. There are language features that can solve these problems, especially in VHDL. I don't think anyone will use them, but they exist.



--[[ ]]--