VHDL错误(10822):无法为assignm实现寄存器
我尝试实现一个JK触发器,具有异步预置和清除功能,时钟上具有正边缘逻辑 我从Altera Quartus II收到以下错误: 错误10822:JK_FF_PE_D1处的HDL错误。vhd52:无法在此时钟边缘上实现分配寄存器 错误:无法详细说明顶级用户层次结构 我看不出有什么错误。。。如果能给我一个提示或建议,我将不胜感激 提前谢谢你VHDL错误(10822):无法为assignm实现寄存器,vhdl,intel-fpga,Vhdl,Intel Fpga,我尝试实现一个JK触发器,具有异步预置和清除功能,时钟上具有正边缘逻辑 我从Altera Quartus II收到以下错误: 错误10822:JK_FF_PE_D1处的HDL错误。vhd52:无法在此时钟边缘上实现分配寄存器 错误:无法详细说明顶级用户层次结构 我看不出有什么错误。。。如果能给我一个提示或建议,我将不胜感激 提前谢谢你 library ieee; use ieee.std_logic_1164.all; entity JK_FF_PE_D1 is port( J,
library ieee;
use ieee.std_logic_1164.all;
entity JK_FF_PE_D1 is
port(
J, K : in std_logic; -- J, K inputs of flip flop
PS : in std_logic; -- Preset of flip flop
CLR : in std_logic; -- CLR of flip flop
CLK : in std_logic; -- Clock
Q, Qcompl : out std_logic -- Q and its complementary output
);
end entity JK_FF_PE_D1;
architecture simple of JK_FF_PE_D1 is
signal temp_Q, temp_Qcompl : std_logic;
begin
p0:process(PS, CLR, CLK) is
begin
case std_logic_vector'(PS, CLR) is
when "00" =>
temp_Q <= '1';
temp_Qcompl <= '1';
when "01" =>
temp_Q <= '1';
temp_Qcompl <= '0';
when "10" =>
temp_Q <= '0';
temp_Qcompl <= '1';
when others => -- Preset = 1 , Clear = 1
if rising_edge (CLK) then -- Clock turns from 0 -> 1
case std_logic_vector'(J, K) is
when "11" =>
temp_Q <= not temp_Q;
temp_Qcompl <= not temp_Qcompl;
when "10" =>
temp_Q <= '1';
temp_Qcompl <= '0';
when "01" =>
temp_Q <= '0';
temp_Qcompl <= '1';
when others =>
null;
end case;
end if;
end case;
end process p0;
Q <= temp_Q;
Qcompl <= not temp_Qcompl;
end architecture simple;
它看起来像是Altera Quartus II中的一个限制,因为外壳可以更改为if,如下所示,然后它可以运行合成:
p0 : process(ps, CLR, CLK) is
begin
if std_logic_vector'(ps, CLR) = "00" then
temp_Q <= '1';
temp_Qcompl <= '1';
elsif std_logic_vector'(ps, CLR) = "01" then
temp_Q <= '1';
temp_Qcompl <= '0';
elsif std_logic_vector'(ps, CLR) = "10" then
temp_Q <= '0';
temp_Qcompl <= '1';
else -- Preset = 1 , Clear = 1
if rising_edge (CLK) then -- Clock turns from 0 -> 1
case std_logic_vector'(J, K) is
when "11" =>
temp_Q <= not temp_Q;
temp_Qcompl <= not temp_Qcompl;
when "10" =>
temp_Q <= '1';
temp_Qcompl <= '0';
when "01" =>
temp_Q <= '0';
temp_Qcompl <= '1';
when others =>
null;
end case;
end if;
end if;
end process p0;
如果特定目标设备不允许触发器同时进行异步设置和复位,则会发出警告。非常感谢您的帮助。。。我想把情况改为if,但我意识到这是一个非常愚蠢的编译器限制。。。感谢模板匹配-编译器将if..elsif链视为一组异步预设/清除指令,后跟时钟部分。它与触发器的模板相匹配。案例陈述虽然描述了相同的行为,但不被认为是如此。看看XST和Synplify是否能够管理它将是一件有趣的事情。。。预测:XST不能,Synplify可以