Weng Tianxiang
2017-11-11 19:57:54 UTC
comp.lang.vhdl ›
create 400 clocks delay for a signal
https://groups.google.com/forum/#!topic/comp.lang.vhdl/0q5kuIgX7eg
Charles Bailey:
signal a : std_logic;
signal b : std_logic;
signal q : std_logic_vector(0 to 399);
begin
delay : process (CLK)
if( CLK'event and CLK = '1' ) then
q <= a & q(0 to 398);
end if;
end process;
b <= q(399);
Rick C:
I'm curious, why do you still use the notation above for a clock edge rather
than ( CLK'event and CLK = '1' )? Normally this is only seen in students being taught by teachers who aren't versed in modern methods.
My result:
What happens surprises me:
1. I followed Rick's comment and changed all ( CLK'event and CLK = '1' ) to rising_edge(CLK) in a very thoroughly tested code.
2. Synthesization is OK.
3. I have assertion statements in my code and the assertion statements are located under ( CLK'event and CLK = '1' ).
4. it generates an error, indicating my result has an error which never happens before after the code was thoroughly debugged.
5. I restored the original coding, and the code runs without any error!
6. It seems that something different exists between rising_edge(CLK) and ( CLK'event and CLK = '1' ).
7. Any comment?
Weng
create 400 clocks delay for a signal
https://groups.google.com/forum/#!topic/comp.lang.vhdl/0q5kuIgX7eg
Charles Bailey:
signal a : std_logic;
signal b : std_logic;
signal q : std_logic_vector(0 to 399);
begin
delay : process (CLK)
if( CLK'event and CLK = '1' ) then
q <= a & q(0 to 398);
end if;
end process;
b <= q(399);
Rick C:
I'm curious, why do you still use the notation above for a clock edge rather
than ( CLK'event and CLK = '1' )? Normally this is only seen in students being taught by teachers who aren't versed in modern methods.
My result:
What happens surprises me:
1. I followed Rick's comment and changed all ( CLK'event and CLK = '1' ) to rising_edge(CLK) in a very thoroughly tested code.
2. Synthesization is OK.
3. I have assertion statements in my code and the assertion statements are located under ( CLK'event and CLK = '1' ).
4. it generates an error, indicating my result has an error which never happens before after the code was thoroughly debugged.
5. I restored the original coding, and the code runs without any error!
6. It seems that something different exists between rising_edge(CLK) and ( CLK'event and CLK = '1' ).
7. Any comment?
Weng