Process sensitivity list

Discussion in 'VHDL' started by ferrari, Jun 19, 2008.

  1. ferrari

    ferrari

    Joined:
    Jun 19, 2008
    Messages:
    6
    hi VHDL guys.
    I'm a bit confused regarding the process sensitivity list,

    as I've read in this book "McGraw Hill - VHDL Programming by Example - 4th Ed"
    they say that " This list enumerates exactly which signals cause the process
    statement to be executed. In this example, the list consists of a, b, c, d,
    s0,and s1. Only events on these signals cause the process statement to
    be executed."


    if that was right, then i guess this code:

    Code:
    entity test is
     port (	din:  in bit;
    		sel:  in bit_vector (1 downto 0);
    		dout: out bit_vector (3 downto 0));
    end test;
    
    architecture behave of test is
    begin
    	process (din)
    	begin
    	case sel is 
    			when "00" => dout<=('0','0','0',din);
    			when "01" => dout<=('0','0',din,'0');
    			when "10" => dout<=('0',din,'0','0');
    			when "11" => dout<=(din,'0','0','0');
    	end case;
    	end process;
    end behave;
    would not have produced those simulation results:

    [​IMG]

    and that is because as i understand, since din is constantly high, there are no events on "din" signal, thus the process would not be executed, not even if the signal "sel" changes, since it is not on the sensitivity list. is that right?
    the problem is, that this process is still executed, even though there are no events on "din". maybe you guys can help me undersand why is this happening. maybe i don't understand the concept of this sensitivity list?
    please help...
    ferrari, Jun 19, 2008
    #1
    1. Advertising

  2. ferrari

    jeppe

    Joined:
    Mar 10, 2008
    Messages:
    348
    Location:
    Denmark
    Your welcome
    Jeppe

    Code:
    entity test is
     port (	din:  in bit;
    		sel:  in bit_vector (1 downto 0);
    		dout: out bit_vector (3 downto 0));
    end test;
    
    architecture behave of test is
    begin
    	process (din, [B]sel[/B]) -- All inputs must appear in order to produce combinatorial LOGIC
    	begin
    	case sel is 
    			when "00" => dout<=('0','0','0',din);
    			when "01" => dout<=('0','0',din,'0');
    			when "10" => dout<=('0',din,'0','0');
    			when "11" => dout<=(din,'0','0','0');
    	end case;
    	end process;
    end behave;
    jeppe, Jun 19, 2008
    #2
    1. Advertising

  3. ferrari

    ferrari

    Joined:
    Jun 19, 2008
    Messages:
    6
    jeppe, i know that. and still the code without (sel) in the sensitivity list, executes the same thing. can you please explain to me why is that?

    when i compile the original code, there are no errors, it compiles fine and when i run simulation, i see the same thing as if sel was on the sensitivity list.
    ferrari, Jun 19, 2008
    #3
  4. ferrari

    jeppe

    Joined:
    Mar 10, 2008
    Messages:
    348
    Location:
    Denmark
    Ok - You must realize that theres a touch of "black magic" connected with a synthesize tool ;-)

    This my conclusion after several years with VHDL and "tools".

    Jeppe
    jeppe, Jun 19, 2008
    #4
  5. ferrari

    ferrari

    Joined:
    Jun 19, 2008
    Messages:
    6
    thanx, you see, i'm a student, and a question like that just appeared on my final VHDL exam, and i guess i gave the wrong answer because i thought it would act differently without the SEL signal in the sensitivity list.
    ferrari, Jun 20, 2008
    #5
  6. ferrari

    flintstone

    Joined:
    Jun 20, 2008
    Messages:
    3
    What simulator were you using to get these results? Maybe it's just a bug or the simulator adds signals that are read in the process to the sensitivity list automatically.
    flintstone, Jun 20, 2008
    #6
  7. ferrari

    ferrari

    Joined:
    Jun 19, 2008
    Messages:
    6
    it's a standard Altera Quartus II 8.0 Web Edition. and i think it really does automatically adds signals that are read inside the process into the sensitivity list. problem is there is nothing in the theory about this, and i guess they cannot require me to know the specific phenomenons of each simulator, can they? the couse i've taken was a "VHDL" course, not "Altera Quartus II 8.0 Web Edition" behaviour course... right?
    ferrari, Jun 20, 2008
    #7
  8. ferrari

    flintstone

    Joined:
    Jun 20, 2008
    Messages:
    3
    Yes but as jeppe already said there is always some "black magic" to these tools. We had a similar bug where an event on a signal that was in the sensitivity list did not trigger process execution in the Modelsim SE, which is, from my experience, the best VHDL simulator available. This was clearly a bug and we had to play around with the sensitivity list to get the correct behaviour.

    So this will happen to you again. Nevertheless you should try to get the free Modelsim-Altera or Modelsim-Xilinx editions, the Quartus Simulator surely is not the best available.
    flintstone, Jun 23, 2008
    #8
  9. ferrari

    ferrari

    Joined:
    Jun 19, 2008
    Messages:
    6
    thanx, i'll try to run this through modelsim and will post the results here.
    ferrari, Jun 24, 2008
    #9
    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. walala
    Replies:
    3
    Views:
    715
    Allan Herriman
    Sep 9, 2003
  2. Roger Dahl
    Replies:
    10
    Views:
    791
    Mike Treseler
    Oct 3, 2003
  3. antonio bergnoli
    Replies:
    5
    Views:
    4,407
    Mike Treseler
    Dec 18, 2005
  4. Steven Kauffmann
    Replies:
    21
    Views:
    2,580
    Ponceludon de Malavoy
    Jan 9, 2008
  5. neilmac
    Replies:
    2
    Views:
    632
    mcdjnaja
    Feb 7, 2008
Loading...

Share This Page