J
Jim Lewis
Rob,
Let me help you find a couple pieces of hardware that
need this coding style.
Xilinx register with both rising and falling edges:
http://toolbox.xilinx.com/docsan/xilinx7/books/data/docs/lib/lib0130_116.html
Xilinx dual port memory with separate clocks:
http://www.xilinx.com/ipcenter/catalog/logicore/docs/dp_block_mem.pdf
My read on the standard is different from yours.
The standard has the following three statements:
1: "The clock edge conditions shall be mutually exclusive."
If you don't make this assumption, then the first clock
will have higher precedence than the second clock. This
may work for some hardware and may not for others. There
will be a potential RTL and gate simulation mismatch if
both clocks do happen at the same time. The standard
shows a way to handle this using synthesis pragmas.
2: "For each clock edge expression, when the remaining clock
edge expressions are replaced by FALSE in all statements
of the process, the transformed process must fulfill the
conditions of 6.1.3.1 or 6.1.3.2."
Basically this makes the effect of each clock independent of
the others. Make all branches except for the current clock
false and calculate what the current clock does. Repeat
for all clocks and combine their effect.
3: "The signal in the first clock edge expression
(textually) shall be taken as the functional clock."
If there is a precedence relationship in the target hardware,
then the higher precedence clock must be coded first.
I disagree with this. I showed the intended read of
the standard and showed real hardware that would be the
target of this type of code.
And if we do this, how do you propose that we code
the Xilinx hardware referenced above?
The standard is there to help you find the way.
If you still think there is an issue with the standard,
please file an issue/bug report against the standard.
You can do this by going to the VASG web page and following
the link for "bugs / enhancement requests":
http://www.eda.org/vasg/
You can also use the above to request an
interpretation of the standard.
Cheers,
Jim Lewis
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Jim Lewis
Director of Training mailto:[email protected]
SynthWorks Design Inc. http://www.SynthWorks.com
1-503-590-4787
Expert VHDL Training for Hardware Design and Verification
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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.
Let me help you find a couple pieces of hardware that
need this coding style.
Xilinx register with both rising and falling edges:
http://toolbox.xilinx.com/docsan/xilinx7/books/data/docs/lib/lib0130_116.html
Xilinx dual port memory with separate clocks:
http://www.xilinx.com/ipcenter/catalog/logicore/docs/dp_block_mem.pdf
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.
My read on the standard is different from yours.
The standard has the following three statements:
1: "The clock edge conditions shall be mutually exclusive."
If you don't make this assumption, then the first clock
will have higher precedence than the second clock. This
may work for some hardware and may not for others. There
will be a potential RTL and gate simulation mismatch if
both clocks do happen at the same time. The standard
shows a way to handle this using synthesis pragmas.
2: "For each clock edge expression, when the remaining clock
edge expressions are replaced by FALSE in all statements
of the process, the transformed process must fulfill the
conditions of 6.1.3.1 or 6.1.3.2."
Basically this makes the effect of each clock independent of
the others. Make all branches except for the current clock
false and calculate what the current clock does. Repeat
for all clocks and combine their effect.
3: "The signal in the first clock edge expression
(textually) shall be taken as the functional clock."
If there is a precedence relationship in the target hardware,
then the higher precedence clock must be coded first.
So, I would recommend NOT promoting this 1076.6 rule.
Verific will continue to error out on example1. It is really not synthesizable.
I disagree with this. I showed the intended read of
the standard and showed real hardware that would be the
target of this type of code.
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.
And if we do this, how do you propose that we code
the Xilinx hardware referenced above?
The standard is there to help you find the way.
If you still think there is an issue with the standard,
please file an issue/bug report against the standard.
You can do this by going to the VASG web page and following
the link for "bugs / enhancement requests":
http://www.eda.org/vasg/
You can also use the above to request an
interpretation of the standard.
Cheers,
Jim Lewis
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Jim Lewis
Director of Training mailto:[email protected]
SynthWorks Design Inc. http://www.SynthWorks.com
1-503-590-4787
Expert VHDL Training for Hardware Design and Verification
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~