R
Rick North
Guest
Hi all,
I have been away from the vhdl design for a while and when I got back
and read through some code I found some things that was new for me.
1.) In a process sensitive list I usually have a clock and a reset
making it synchronous or signals to do some combinatorial stuff. But
now I see that the two versions are being mixed.
process (clk, reset, switch)
begin
if rising_edge(clk) then
a_delay <= b or c;
if switch = "00" then
output <= "010" & a_delay;
elsif switch = "01" then
output <= "011" & a_delay;
elsif switch = "10" then
output <= "111" & a_delay or d;
elsif switch = "11" then
output <= "101" & a_delay;
end if;
end if;
end process;
As I see it this would place a combinatorial cloud on the output flip-
flop a_delay with an or gate at its input. Is there any advantage to
write this in a single process?
2.) is there any benefit of writing a synchronous reset as follows?
....
if rising_edge(clk) then
....
a <= b;
c <= d;
etc....
if reset = '1' then
a <= '0';
c <= '1';
end if;
end if;
.....
instead of
if rising_edge(clk) then
if reset = '1' then
a <= '0';
c <= '1';
else
....
a <= b;
c <= d;
etc....
end if;
end if;
What do you think?
Best regards,
Rick
I have been away from the vhdl design for a while and when I got back
and read through some code I found some things that was new for me.
1.) In a process sensitive list I usually have a clock and a reset
making it synchronous or signals to do some combinatorial stuff. But
now I see that the two versions are being mixed.
process (clk, reset, switch)
begin
if rising_edge(clk) then
a_delay <= b or c;
if switch = "00" then
output <= "010" & a_delay;
elsif switch = "01" then
output <= "011" & a_delay;
elsif switch = "10" then
output <= "111" & a_delay or d;
elsif switch = "11" then
output <= "101" & a_delay;
end if;
end if;
end process;
As I see it this would place a combinatorial cloud on the output flip-
flop a_delay with an or gate at its input. Is there any advantage to
write this in a single process?
2.) is there any benefit of writing a synchronous reset as follows?
....
if rising_edge(clk) then
....
a <= b;
c <= d;
etc....
if reset = '1' then
a <= '0';
c <= '1';
end if;
end if;
.....
instead of
if rising_edge(clk) then
if reset = '1' then
a <= '0';
c <= '1';
else
....
a <= b;
c <= d;
etc....
end if;
end if;
What do you think?
Best regards,
Rick