Guest
I have written code to have data shifted into a buffer but for some
reason the output is grounded. What am I doing wrong? I have supplied
my code below. Thank you for your time and attention.
save_data: process (rst,clk)
variable count,I_temp,Q_temp: std_logic_vector(7 downto 0);
variable I_buff_temp,Q_buff_temp:std_logic_vector(23 downto 0):=
(others => '0');
begin
if (rst= '1') then
I_buff<= (others=> '0'); --buffers with data
Q_buff<= (others=> '0');
I_buff_temp:= (others=> '0'); --temp buffers that hold data
Q_buff_temp:= (others=> '0'); -- until it is full
count:=x"00"; --counts number of bytes to make
-- 188 byte packet
buff_rdy<= '0';
elsif (clk='1' and clk'event) then
if (count=0) then
I_temp:=I_in;
Q_temp:=Q_in;
I_buff_temp := I_buff_temp(23 downto 8) & I_temp;-- save first
set of data
Q_buff_temp := Q_buff_temp(23 downto 8) & Q_temp;-- into buffers
count:= count+1;
I_buff<= I_buff;
Q_buff<= Q_buff;
buff_rdy<= '0';
elsif ((count< byte_cnt) and (count>0)) then
I_temp:=I_in;
Q_temp:=Q_in;
I_buff_temp := I_buff_temp(23 downto 8) & I_temp;-- save first
set of data
Q_buff_temp := Q_buff_temp(23 downto 8) & Q_temp;-- into buffers
count:= count+1;
I_buff<= I_buff;
Q_buff<= Q_buff;
buff_rdy<= '0';
elsif (count= byte_cnt) then
I_temp:=I_in;
Q_temp:=Q_in;
I_buff_temp := I_buff_temp(23 downto 8) & I_temp;-- save first
set of data
Q_buff_temp := Q_buff_temp(23 downto 8) & Q_temp;-- into buffers
buff_rdy<='1';
I_buff<= I_buff_temp;
Q_buff<= Q_buff_temp;
count:= (others =>'0');
end if;
I_buff<=I_buff;
Q_buff<=Q_buff;
end if;
end process save_data;
reason the output is grounded. What am I doing wrong? I have supplied
my code below. Thank you for your time and attention.
save_data: process (rst,clk)
variable count,I_temp,Q_temp: std_logic_vector(7 downto 0);
variable I_buff_temp,Q_buff_temp:std_logic_vector(23 downto 0):=
(others => '0');
begin
if (rst= '1') then
I_buff<= (others=> '0'); --buffers with data
Q_buff<= (others=> '0');
I_buff_temp:= (others=> '0'); --temp buffers that hold data
Q_buff_temp:= (others=> '0'); -- until it is full
count:=x"00"; --counts number of bytes to make
-- 188 byte packet
buff_rdy<= '0';
elsif (clk='1' and clk'event) then
if (count=0) then
I_temp:=I_in;
Q_temp:=Q_in;
I_buff_temp := I_buff_temp(23 downto 8) & I_temp;-- save first
set of data
Q_buff_temp := Q_buff_temp(23 downto 8) & Q_temp;-- into buffers
count:= count+1;
I_buff<= I_buff;
Q_buff<= Q_buff;
buff_rdy<= '0';
elsif ((count< byte_cnt) and (count>0)) then
I_temp:=I_in;
Q_temp:=Q_in;
I_buff_temp := I_buff_temp(23 downto 8) & I_temp;-- save first
set of data
Q_buff_temp := Q_buff_temp(23 downto 8) & Q_temp;-- into buffers
count:= count+1;
I_buff<= I_buff;
Q_buff<= Q_buff;
buff_rdy<= '0';
elsif (count= byte_cnt) then
I_temp:=I_in;
Q_temp:=Q_in;
I_buff_temp := I_buff_temp(23 downto 8) & I_temp;-- save first
set of data
Q_buff_temp := Q_buff_temp(23 downto 8) & Q_temp;-- into buffers
buff_rdy<='1';
I_buff<= I_buff_temp;
Q_buff<= Q_buff_temp;
count:= (others =>'0');
end if;
I_buff<=I_buff;
Q_buff<=Q_buff;
end if;
end process save_data;