我正在学习并使用VHDL编程Lattice FPGA,以模拟74HCT245的功能。以下是我的代码。
我一直收到"语句不可综合,因为在NOT(时钟边缘)条件下它不保持其值。VHDL-1242" 错误提示。
entity HCT541 is
port (Clk : in std_logic;
A : inout std_logic_vector(15 downto 0) := "1011101010111010";
BA : out std_logic_vector(15 downto 0);
n_OE, DIR : in std_logic;
M_D : inout std_logic_vector(15 downto 0) := "0000000000000001";
D : inout std_logic_vector(15 downto 0) := "1011101010111010";
BD : inout std_logic_vector(15 downto 0) := "1011101010111010");
end HCT541;
architecture df of HCT541 is
signal n_OE_1, n_OE_2 : std_logic := '0';
begin
process(Clk, n_OE, DIR)
begin
if ((BD = "ZZZZZZZZZZZZZZZZ" or D = "ZZZZZZZZZZZZZZZZ") and n_OE = '0') then
BD <= "0000000000000000";
D <= M_D;
end if;
M_D <= M_D + '1';
CLK1 : if(rising_edge(Clk)) then
if(n_OE_1 = '0' and n_OE_2 = '0') then
A <= A - '1';
BA <= A;
else
BA <= "ZZZZZZZZZZZZZZZZ";
end if;
if (n_OE = '0' and DIR = '1') then
D <= M_D;
BD <= D;
elsif (n_OE = '0' and DIR = '0') then
BD <= BD - '1';
D <= BD;
elsif (n_OE = '1') then
BD <= "ZZZZZZZZZZZZZZZZ";
D <= "ZZZZZZZZZZZZZZZZ";
end if;
end if CLK1;
end process;
end df;
有什么想法吗?
使用rising_edge有什么问题吗?
if rising_edge(clk)
之前的部分。 - user1818839