Hi Jim,
Jim Lewis said:
Rob,
So what you propose is that synthesis tools should
accept the following:
sen_list_equiv : process
begin
if CK='1' then
Q <= D;
QB <= not D;
end if;
wait on CK,D;
end process;
Yes.
Will you also support the following hardware equivalent
process:
hardware_equiv: process
begin
wait on CK,D;
if CK='1' then
Q <= D;
QB <= not D;
end if;
end process;
Yes.
Can I put the "wait on" anywhere else?
Yes, but that might have functional implications (the function might change).
This example :
process begin
<statement1>
wait on CK,D;
<statement2>
end process
is functionally equivalent to this process :
process begin
wait on CK,D;
<statement2>
<statement1>
end process
note that the order of the statements in flipped !
That is because the wait statement determines when the simulator 'stops' updating the drivers.
This change in ordering should be supported by the synthesis tool (and it is in Verific, if we only
downgraded the current error).
Can I have multiple "wait on" in the process?
You can in some synthesis tools, but Verific does not support multiple wait statements in one process.
Can I have one wait on at the end of each
path through the process (which is also similar
to a sensitivity list):
also_sen_list_equiv : process
begin
if CK='1' then
Q <= D;
QB <= not D;
wait on CK,D;
else
wait on CK,D;
end if;
end process;
In prociple, we could support this, since it is similar to a single wait at the end of
the process. However, just to be on the safe side, synthesis tools not supporting
multiple waits per process might error out.
It is great to make enhancements, but hopefully
at the same time you can keep the rules simple.
Simple rule that I used to use :
A process can have only one wait statement, and it needs an 'until' clause.
Simple rule that I will use :
A process can have only one wait statement.
You will note that there are other valuable features
that are in 1076.6-2004, such as multiple edge
registers that I would consider higher priority than
yet another way to do a sensitivity list.
Interesting, I just investigated this last month :
I personally find the 'multiple edge' feature in 1076.6 extremely confusing, and potentially incorrect.
The example given in 1076.6 is this :
Example 1:
process (reset, clk1, clk2) begin
if (reset) then
Q <= '0' ;
elsif rising_edge(clk1) then
Q <= data1 ;
elsif rising_edge(clk2) then
Q <= data2 ;
end if ;
end
Clearly, no hardware element (that I am aware of) can update its output on multiple rising edges,
so you should get a synthesis error.
But 1076.6 now proposes to accept this style, and that we should ignore the second (clk2) edge.
So, a Flip-flop should be synthesized which triggers on 'clk1' only.
I find that very uncomforting, because there will at least be big-time simulation-synthesis differences.
Now lets look at a similar, but different example (not in the 1076.6 LRM) :
Example 2:
process (reset, clk1, clk2) begin
if (reset) then
Q1 <= '0' ;
Q2 <= '0' ;
elsif rising_edge(clk1) then
Q1 <= data1 ;
elsif rising_edge(clk2) then
Q2 <= data2 ;
end if ;
end
This should in prociple be synthesizable (without risking simulation/synthesis differences), with two flip-flops :
Q1 clocked on clk1 and Q2 clocked on clk2. The only assumption is that the two clock edges
do not occur simultaniously (which is a very light assumption, considering delta-time event driven simulators,
and even 1076.6 states that this assumption can be made).
However, if we follow the 1076.6 rule, this process should ignore the second edge :
(6.1.3.3, Note 2: "The determination of the functional clock is made on a process-by-process basis; the
intended clock has to be coded first in each process").
So the (one and only) functional clock should be determined per process, and not per signal.
That is an incorrect rule !
It tells us that we should ignore clk2 in example 2, and thus Q2 will not be clocked.
And that is just plain wrong.
So, I would recommend NOT promoting this 1076.6 rule.
Verific will continue to error out on example1. It is really not synthesizable.
Just stick with a single clock per process, since that is supported by every vendor,
prevents any simulation-synthesis mismatch and does not violate any 1076.6 rules.