T
Tricky
Guest
Ive always been told categorically that "Shared variables cannot be
synthesized, Use signals for communication between processes"
But now it appears at least Quartus does. I have infered a ram using
one, plus also this interesting setup.
shared variable C : std_logic;
begin
process(clk)
begin
if rising_edge(clk) then
C := data_a;
end if;
end process;
process(clk)
begin
if rising_edge(clk) then
--c := data_b;
q_b <= C;
end if;
end process;
From synthesis, this gives me 2 registers, source from data_a. If I
uncomment the C assignment in the 2nd process, I only get 1 register
driven from data_b, with no warning about multiple constant drivers,
like you would if C was a signal.
So, is this an interesting and potentially dangerous precident Altera
are setting, or is this happening with other synthesisors too? would
shared variables actually have any use anywhere?
synthesized, Use signals for communication between processes"
But now it appears at least Quartus does. I have infered a ram using
one, plus also this interesting setup.
shared variable C : std_logic;
begin
process(clk)
begin
if rising_edge(clk) then
C := data_a;
end if;
end process;
process(clk)
begin
if rising_edge(clk) then
--c := data_b;
q_b <= C;
end if;
end process;
From synthesis, this gives me 2 registers, source from data_a. If I
uncomment the C assignment in the 2nd process, I only get 1 register
driven from data_b, with no warning about multiple constant drivers,
like you would if C was a signal.
So, is this an interesting and potentially dangerous precident Altera
are setting, or is this happening with other synthesisors too? would
shared variables actually have any use anywhere?