I had always used this for detecting a rising edge:
if (clk'event and clk='1') then
but this can also be used:
if rising_edge(clk) then
Reading this post, rising_edge(clk)
is recommended, but there is also a comment indicating that rising_edge(clk)
could lead to wrong behaviour.
I can't decide which one to choose for the future, going on with (clk'event and clk='1')
or adopting rising_edge(clk)
.
Any real-world expereince on these two? Any preferences?
Thanks!
question from:https://stackoverflow.com/questions/15205202/clkevent-vs-rising-edge