A
ALuPin
Guest
Hi everybody,
when trying to compile the following VHDL code with
Altera QuartusII v.4.1 I get the following warning:
signal or variable l_data may not be assigned a new value in every
possible path through the Process statement.
Signal or variable l_data holds its previous value in every path with
no new value assignment, which may create
a combinational loop in the current design
I cannot understand what goes wrong.
Any hint is appreciated.
Kind regards
Andre
signal pos : integer range 0 to 2;
type matr is array(0 to 3) of std_logic_vector(7 downto 0);
signal l_data : matr;
process(Reset, Clk_fast)
variable var_buffer : std_logic_vector(7 downto 0);
variable var_buffer2 : std_logic_vector(7 downto 0);
variable data : matr;
begin
if Reset='1' then
l_valid <= '0';
l_pid <= (others => '0');
l_frame <= (others => '0');
l_addr <= (others => '0');
l_ep <= (others => '0');
pos <= 0;
l_data <= (others => (others => '0'));
l_buffer <= (others => '0');
l_buffer2 <= (others => '0');
l_host_has_acked <= '0';
l_handshake_pid <= '0';
l_token_pid <= '0';
l_data_pid <= '0';
l_data_pid_flag <= '0';
l_valid_ini_read <= '0';
l_sof <= '0';
l_sof_flag <= '0';
l_setup <= '0';
l_setup_flag <= '0';
elsif rising_edge(Clk_fast) then
l_valid <= '0';
l_pid <= l_pid;
l_frame <= l_frame;
l_addr <= l_addr;
l_ep <= l_ep;
pos <= pos;
l_data <= l_data;
data := l_data;
l_buffer <= l_buffer;
var_buffer := l_buffer;
l_buffer2 <= l_buffer2;
var_buffer2 := l_buffer2;
l_host_has_acked <= '0';
l_handshake_pid <= '0';
l_token_pid <= '0';
l_data_pid <= '0';
l_data_pid_flag <= l_data_pid_flag;
l_valid_ini_read <= '0';
l_sof <= '0';
l_sof_flag <= l_sof_flag;
l_setup <= '0';
l_setup_flag <= l_setup_flag;
if Enable_highspeed='1' then
if l_writing_hs='1' then
if pos=0 then
data(0) := Highspeed_data(7 downto 0);
var_buffer := data(0);
l_pid(3 downto 0) <= var_buffer(3 downto 0);
--if (var_buffer(3 downto 0) = (not var_buffer(7
downto 4)) ) then
-- l_valid_ini_read <= '1';
--end if;
if var_buffer(3 downto 0)="0010" then
l_host_has_acked <= '1';
end if;
if var_buffer(3 downto 0)="0101" then
l_sof <= '1';
l_sof_flag <= '1';
end if;
if var_buffer(3 downto 0)="1101" then
l_setup <= '1';
l_setup_flag <= '1';
end if;
if (var_buffer(3 downto 0)="1010") -- NAK
(1010)
or (var_buffer(3 downto 0)="0010") then -- ACK
(0010)
l_handshake_pid <= '1';
end if;
if (var_buffer(3 downto 0)="0001") -- OUT
(0001)
or (var_buffer(3 downto 0)="1001") -- IN
(1001)
or (var_buffer(3 downto 0)="0101") -- SOF
(0101)
or (var_buffer(3 downto 0)="1101") then -- SETUP
(1101)
l_token_pid <= '1';
end if;
if (var_buffer(3 downto 0)="0011") -- DATA0
(0011)
or (var_buffer(3 downto 0)="1011") -- DATA1
(1011)
or (var_buffer(3 downto 0)="0111") -- DATA2
(0111)
or (var_buffer(3 downto 0)="1111") then -- MDATA
(1111)
l_data_pid <= '1';
l_data_pid_flag <= '1'; -
end if;
elsif pos=1 then
data(1) := Highspeed_data(15 downto 8);
if (var_buffer(3 downto 0) = (not var_buffer(7 downto 4))
) then
l_valid_ini_read <= '1';
end if;
elsif pos=2 then
data(2) := Highspeed_data(7 downto 0);
var_buffer2 := data(1);
l_data_pid_flag <= '0';
l_sof_flag <= '0';
l_setup_flag <= '0';
if (var_buffer(3 downto 0) = (not var_buffer(7 downto 4))
) then
if ( (l_data_pid_flag='0') and (l_sof_flag='0') and
(l_setup_flag='0') ) then
l_valid <= '1';
end if;
end if;
l_frame(7 downto 0) <= var_buffer2(7 downto 0);
l_ep(0) <= var_buffer2(7);
l_addr(6 downto 0) <= var_buffer2(6 downto 0);
---------------
var_buffer2 := data(2);
---------------
l_frame(10 downto 8) <= var_buffer2(2 downto 0);
l_ep(3 downto 1) <= var_buffer2(2 downto 0);
end if;
if pos=2 then
pos <= 0;
else
pos <= pos + 1;
end if;
end if;
end if;
l_buffer <= var_buffer;
l_buffer2 <= var_buffer2;
l_data <= data;
end if;
end process;
when trying to compile the following VHDL code with
Altera QuartusII v.4.1 I get the following warning:
signal or variable l_data may not be assigned a new value in every
possible path through the Process statement.
Signal or variable l_data holds its previous value in every path with
no new value assignment, which may create
a combinational loop in the current design
I cannot understand what goes wrong.
Any hint is appreciated.
Kind regards
Andre
signal pos : integer range 0 to 2;
type matr is array(0 to 3) of std_logic_vector(7 downto 0);
signal l_data : matr;
process(Reset, Clk_fast)
variable var_buffer : std_logic_vector(7 downto 0);
variable var_buffer2 : std_logic_vector(7 downto 0);
variable data : matr;
begin
if Reset='1' then
l_valid <= '0';
l_pid <= (others => '0');
l_frame <= (others => '0');
l_addr <= (others => '0');
l_ep <= (others => '0');
pos <= 0;
l_data <= (others => (others => '0'));
l_buffer <= (others => '0');
l_buffer2 <= (others => '0');
l_host_has_acked <= '0';
l_handshake_pid <= '0';
l_token_pid <= '0';
l_data_pid <= '0';
l_data_pid_flag <= '0';
l_valid_ini_read <= '0';
l_sof <= '0';
l_sof_flag <= '0';
l_setup <= '0';
l_setup_flag <= '0';
elsif rising_edge(Clk_fast) then
l_valid <= '0';
l_pid <= l_pid;
l_frame <= l_frame;
l_addr <= l_addr;
l_ep <= l_ep;
pos <= pos;
l_data <= l_data;
data := l_data;
l_buffer <= l_buffer;
var_buffer := l_buffer;
l_buffer2 <= l_buffer2;
var_buffer2 := l_buffer2;
l_host_has_acked <= '0';
l_handshake_pid <= '0';
l_token_pid <= '0';
l_data_pid <= '0';
l_data_pid_flag <= l_data_pid_flag;
l_valid_ini_read <= '0';
l_sof <= '0';
l_sof_flag <= l_sof_flag;
l_setup <= '0';
l_setup_flag <= l_setup_flag;
if Enable_highspeed='1' then
if l_writing_hs='1' then
if pos=0 then
data(0) := Highspeed_data(7 downto 0);
var_buffer := data(0);
l_pid(3 downto 0) <= var_buffer(3 downto 0);
--if (var_buffer(3 downto 0) = (not var_buffer(7
downto 4)) ) then
-- l_valid_ini_read <= '1';
--end if;
if var_buffer(3 downto 0)="0010" then
l_host_has_acked <= '1';
end if;
if var_buffer(3 downto 0)="0101" then
l_sof <= '1';
l_sof_flag <= '1';
end if;
if var_buffer(3 downto 0)="1101" then
l_setup <= '1';
l_setup_flag <= '1';
end if;
if (var_buffer(3 downto 0)="1010") -- NAK
(1010)
or (var_buffer(3 downto 0)="0010") then -- ACK
(0010)
l_handshake_pid <= '1';
end if;
if (var_buffer(3 downto 0)="0001") -- OUT
(0001)
or (var_buffer(3 downto 0)="1001") -- IN
(1001)
or (var_buffer(3 downto 0)="0101") -- SOF
(0101)
or (var_buffer(3 downto 0)="1101") then -- SETUP
(1101)
l_token_pid <= '1';
end if;
if (var_buffer(3 downto 0)="0011") -- DATA0
(0011)
or (var_buffer(3 downto 0)="1011") -- DATA1
(1011)
or (var_buffer(3 downto 0)="0111") -- DATA2
(0111)
or (var_buffer(3 downto 0)="1111") then -- MDATA
(1111)
l_data_pid <= '1';
l_data_pid_flag <= '1'; -
end if;
elsif pos=1 then
data(1) := Highspeed_data(15 downto 8);
if (var_buffer(3 downto 0) = (not var_buffer(7 downto 4))
) then
l_valid_ini_read <= '1';
end if;
elsif pos=2 then
data(2) := Highspeed_data(7 downto 0);
var_buffer2 := data(1);
l_data_pid_flag <= '0';
l_sof_flag <= '0';
l_setup_flag <= '0';
if (var_buffer(3 downto 0) = (not var_buffer(7 downto 4))
) then
if ( (l_data_pid_flag='0') and (l_sof_flag='0') and
(l_setup_flag='0') ) then
l_valid <= '1';
end if;
end if;
l_frame(7 downto 0) <= var_buffer2(7 downto 0);
l_ep(0) <= var_buffer2(7);
l_addr(6 downto 0) <= var_buffer2(6 downto 0);
---------------
var_buffer2 := data(2);
---------------
l_frame(10 downto 8) <= var_buffer2(2 downto 0);
l_ep(3 downto 1) <= var_buffer2(2 downto 0);
end if;
if pos=2 then
pos <= 0;
else
pos <= pos + 1;
end if;
end if;
end if;
l_buffer <= var_buffer;
l_buffer2 <= var_buffer2;
l_data <= data;
end if;
end process;