Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
423 views
in Technique[技术] by (71.8m points)

vhdl - When must a signal be inserted into the sensitivity list of a process

I am confused about when a signal declared in an architecture must be inserted into the sensitivity list of a process.

Is there is a general law that can be followed in any situation?

I have real difficulties understanding when I have to include a signal in a process sensitivity list.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

The "general law" is that

anything that your process needs to know about changes of needs to be in the sensitivity list.


For a typical synthesisable register with a synchronous reset:

process (clk) is
begin
    if rising_edge(clk) then
        if reset = '1' then
             -- do reset things
        else
             -- read some signals, assign some outputs
        end if;
    end if;
end process;

Only the clock needs to be in the list, as everything else is only looked at when the clock changes (due to the if rising_edge(clk) statement.


If you need an asynchronous reset:

process (clk, reset) is
begin
    if reset = '1' then
        -- do reset things
    elsif rising_edge(clk) then
        -- read some signals, assign some outputs
    end if;
end process;

then the reset signal must also be in the sensitivity list, as your design needs to check the value of it every time it changes, irrespective of what the clock is doing.


For combinatorial logic, I avoid using processes completely because of the problems keeping the sensitivity list up-to-date, and the potential for simulation then behaving differently to the synthesised code. This has been eased by the all keyword in VHDL-2008, but I still haven't found myself wanting to write long complicated combinatorial logic such that a process would help.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...