A
arkaitz
Guest
Hi all,
It might be an obvious question but I have a doubt when assigning two buses
that are defined with opposite direction.
Here you are an example;
architecture behavioral of buses is
signal bus_a: std_logic_vector (0 to 7);
signal bus_b: std_logic_vector (7 downto 0);
...
begin
-- this doesn't work
bus_b <= bus_a;
-- but don't know why this doesn't work
process (bus_a)
begin
for i in bus_a'range loop
bus_b (i) <= bus_a (i)
end loop;
-- this works
process (bus_a)
begin
for i in bus_a'range loop
bus_b(i) <= bus_a (bus_a'left - i);
end loop;
end process;
Does anybody have any idea why the second example doesn't work?
Thanks in advance.
Arkaitz.
It might be an obvious question but I have a doubt when assigning two buses
that are defined with opposite direction.
Here you are an example;
architecture behavioral of buses is
signal bus_a: std_logic_vector (0 to 7);
signal bus_b: std_logic_vector (7 downto 0);
...
begin
-- this doesn't work
bus_b <= bus_a;
-- but don't know why this doesn't work
process (bus_a)
begin
for i in bus_a'range loop
bus_b (i) <= bus_a (i)
end loop;
-- this works
process (bus_a)
begin
for i in bus_a'range loop
bus_b(i) <= bus_a (bus_a'left - i);
end loop;
end process;
Does anybody have any idea why the second example doesn't work?
Thanks in advance.
Arkaitz.