A
ALuPin@web.de
Guest
Hi Newsgroup,
defining the following vector
SIGNAL ls_data : std_logic_vector(63 DOWNTO 0);
I want to write chunks of 2 bit in that vector, that is
1.write
ls_data(1 DOWNTO 0) <= "11";
2.write
ls_data(3 DOWNTO 2) <= "11";
....
32. write
ls_data(63 DOWNTO 62) <= "11";
PROCESS(Reset, Clk)
BEGIN
IF Reset='1' THEN
ls_cnt <= 1;
ls_data <= (OTHERS => '0'):
ELSIF rising_edge(Clk) THEN
IF Write='1' THEN
IF ls_cnt=32 THEN
ls_cnt <= 1;
ELSE
ls_cnt <= ls_cnt + 1;
END IF;
FOR i IN 1 TO 32 LOOP
IF (i=2*ls_cnt - 1) OR (i=2*ls_cnt -2) THEN
ls_data(i) <= '1';
END IF;
END LOOP;
END IF;
END IF;
END PROCESS;
Is there a more elegant way to fill the chunks in the vector ?
Rgds
André
defining the following vector
SIGNAL ls_data : std_logic_vector(63 DOWNTO 0);
I want to write chunks of 2 bit in that vector, that is
1.write
ls_data(1 DOWNTO 0) <= "11";
2.write
ls_data(3 DOWNTO 2) <= "11";
....
32. write
ls_data(63 DOWNTO 62) <= "11";
PROCESS(Reset, Clk)
BEGIN
IF Reset='1' THEN
ls_cnt <= 1;
ls_data <= (OTHERS => '0'):
ELSIF rising_edge(Clk) THEN
IF Write='1' THEN
IF ls_cnt=32 THEN
ls_cnt <= 1;
ELSE
ls_cnt <= ls_cnt + 1;
END IF;
FOR i IN 1 TO 32 LOOP
IF (i=2*ls_cnt - 1) OR (i=2*ls_cnt -2) THEN
ls_data(i) <= '1';
END IF;
END LOOP;
END IF;
END IF;
END PROCESS;
Is there a more elegant way to fill the chunks in the vector ?
Rgds
André