Mirzaaur
Member level 2
Hi there,
I am trying to read 2D array using for loop as index to array but index never change from the first vale to next Can you please check where I am wrong ?
as shown:-
library IEEE;
use IEEE.std_logic_1164.all;
use work.my_pack.all;
entity ff is
port( D : in cxt;
clk: in std_logic;
reset: in std_logic;
q: out bit_vector(4 downto 0));
end ff;
architecture behav of ff is
signal check : integer range 0 to 2;
begin
process (clk)
begin
if (clk'event and clk='1') then
for I in 2 downto 0 loop
q <= D(I);
check <= I;
end loop;
end if;
end process;
end behav;
--------------------- cxt is the type, i declared in different file as my pack
package my_pack is
type cxt is array (0 to 2) of bit_vector (4 downto 0);
end package my_pack;
--------------------
thanks and best regrads,
mirzaaur
I am trying to read 2D array using for loop as index to array but index never change from the first vale to next Can you please check where I am wrong ?
as shown:-
library IEEE;
use IEEE.std_logic_1164.all;
use work.my_pack.all;
entity ff is
port( D : in cxt;
clk: in std_logic;
reset: in std_logic;
q: out bit_vector(4 downto 0));
end ff;
architecture behav of ff is
signal check : integer range 0 to 2;
begin
process (clk)
begin
if (clk'event and clk='1') then
for I in 2 downto 0 loop
q <= D(I);
check <= I;
end loop;
end if;
end process;
end behav;
--------------------- cxt is the type, i declared in different file as my pack
package my_pack is
type cxt is array (0 to 2) of bit_vector (4 downto 0);
end package my_pack;
--------------------
thanks and best regrads,
mirzaaur