T
The Weiss Family
Guest
The "Clock Edge Transitions" thread got me thinking.
If I have two synchronous processes, one of which outputs a signal
synchronous to a clock and is a single clock in width, and the other process
monitors the status of the signal, is it possible that the pulse could occur
without the second process seeing it?
I have code in a design that seems to work fine, but I have doubts that this
is not the best way of doing things...
See the example below:
PROC_A: process(clk, rst)
begin
-- async reset, set to zero
if (rst = '1') then
pulse <= '0';
-- at each rising edge, set pulse to '1'
elsif (rising_edge(clk)) then
if (pulse <= '1') then -- here always limit pulse to 1 clock.
That is, if it is '1', set it right back to '0' on the next clock
pulse <= '0';
elsif (some_condition_is_true)
pulse < = '1';
endif;
endif;
end process;
PROC_B: process(clk, rst)
begin
-- async reset, set to zero
if (rst = '1') then
pulse2 <= '0';
elsif (rising_edge(clk)) then
if (pulse = '1') then -- is it possible that this process will
never see pulse = '1' because it is only 1 clock wide?
pulse2 <= '1'
end if;
end process;
If I have two synchronous processes, one of which outputs a signal
synchronous to a clock and is a single clock in width, and the other process
monitors the status of the signal, is it possible that the pulse could occur
without the second process seeing it?
I have code in a design that seems to work fine, but I have doubts that this
is not the best way of doing things...
See the example below:
PROC_A: process(clk, rst)
begin
-- async reset, set to zero
if (rst = '1') then
pulse <= '0';
-- at each rising edge, set pulse to '1'
elsif (rising_edge(clk)) then
if (pulse <= '1') then -- here always limit pulse to 1 clock.
That is, if it is '1', set it right back to '0' on the next clock
pulse <= '0';
elsif (some_condition_is_true)
pulse < = '1';
endif;
endif;
end process;
PROC_B: process(clk, rst)
begin
-- async reset, set to zero
if (rst = '1') then
pulse2 <= '0';
elsif (rising_edge(clk)) then
if (pulse = '1') then -- is it possible that this process will
never see pulse = '1' because it is only 1 clock wide?
pulse2 <= '1'
end if;
end process;