斑竹请帮我看看这个程序,在综合时提示错误!
时间:10-02
整理:3721RD
点击:
--The IEEE standard 1164 package, declares std_logic, rising_edge(), etc.
library IEEE;
use IEEE.std_logic_1164.all;
use IEEE.std_logic_arith.all;
use IEEE.std_logic_unsigned.all;
entity delay300 is
generic(size : integer := 8);
port (
clk: in STD_LOGIC;
q: buffer STD_LOGIC_VECTOR((size - 1) DOWNTO 0);
ctrl300: out STD_LOGIC
);
end delay300;
architecture delay300_arch of delay300 is
begin
process(clk)
begin
if (clk'event and clk = '1') then
q <= q + 1;
else
q <= q;
end if;
end process;
ctrl300 <= '1' when q = "11111111"
else '0';--***
end delay300_arch;
这个程序就是为了延时,但是在综合时:***处有错,q depends on a non-edge
library IEEE;
use IEEE.std_logic_1164.all;
use IEEE.std_logic_arith.all;
use IEEE.std_logic_unsigned.all;
entity delay300 is
generic(size : integer := 8);
port (
clk: in STD_LOGIC;
q: buffer STD_LOGIC_VECTOR((size - 1) DOWNTO 0);
ctrl300: out STD_LOGIC
);
end delay300;
architecture delay300_arch of delay300 is
begin
process(clk)
begin
if (clk'event and clk = '1') then
q <= q + 1;
else
q <= q;
end if;
end process;
ctrl300 <= '1' when q = "11111111"
else '0';--***
end delay300_arch;
这个程序就是为了延时,但是在综合时:***处有错,q depends on a non-edge
小编请帮我看看这个程序,在综合时提示错误!
q是不是需要赋初值?
小编请帮我看看这个程序,在综合时提示错误!
q没有初始值
应该通过复位信号给个初始值
小编请帮我看看这个程序,在综合时提示错误!
if (clk'event and clk = '1') then
q <= q + 1;
else
q <= q;
end if;
把else 那个分支去掉即可