W
Weng Tianxiang
Guest
Hi,
Here is a code segment showing 2 methods doing 2 writes to an array with 2 different addresses on the same cycle:
1.
p1: process(CLK) is
begin
if CLK'event and CLK = '1' then
if C1 then
An_Array(a) <= D1;
end if;
-- I know a /= b
-- do I need to inform VHDL compiler of 2 different addresses?
if C2 then
An_Array(b) <= D2;
end if;
end if;
end process;
2.
p2: process(CLK) is
begin
if CLK'event and CLK = '1' then
case C1 & C2 is
when "10" =>
An_Array(a) <= D1;
when "01" =>
An_Array(b) <= D2;
when "11" =>
-- I know a /= b
-- do I need to inform VHDL compiler of 2 different addresses?
An_Array(a) <= D1;
An_Array(b) <= D2;
when others =>
null;
end case;
end if;
end process;
I think it is no problem with a simulator.
Thank you.
Weng
Here is a code segment showing 2 methods doing 2 writes to an array with 2 different addresses on the same cycle:
1.
p1: process(CLK) is
begin
if CLK'event and CLK = '1' then
if C1 then
An_Array(a) <= D1;
end if;
-- I know a /= b
-- do I need to inform VHDL compiler of 2 different addresses?
if C2 then
An_Array(b) <= D2;
end if;
end if;
end process;
2.
p2: process(CLK) is
begin
if CLK'event and CLK = '1' then
case C1 & C2 is
when "10" =>
An_Array(a) <= D1;
when "01" =>
An_Array(b) <= D2;
when "11" =>
-- I know a /= b
-- do I need to inform VHDL compiler of 2 different addresses?
An_Array(a) <= D1;
An_Array(b) <= D2;
when others =>
null;
end case;
end if;
end process;
I think it is no problem with a simulator.
Thank you.
Weng