我正在设计一种基本的低燃油检测仪,当燃油空载或降低1/3时开启。我的代码如下:
ENTITY LFDetector_behav IS
PORT (Fuel3, Fuel2, Fuel1, Fuel0: IN std_logic;
FuelWarningLight: OUT std_logic);
END LFDetector_behav;
ARCHITECTURE Behavior OF LFDetector_behav IS
BEGIN
PROCESS (Fuel3, Fuel2, Fuel1, Fuel0)
BEGIN
FuelWarningLight <= [(NOT(Fuel3)) AND (NOT(Fuel2))] OR [(NOT(Fuel1)) AND (NOT(Fuel0))] AFTER 5.8 ns;
END PROCESS;
END Behavior;
我的FuelWarningLight任务附近出现错误,我不明白为什么,我创建了其他完全相同格式的设计。 谢谢。
答案 0 :(得分:0)
我不确定您的错误发生在哪里(合成器或SIM卡),但after
关键字不可合成。我也不确定你是否打算将其完全组合起来。
可能尝试以下方法:
ARCHITECTURE Behavior OF LFDetector_behav IS
BEGIN
PROCESS (Fuel3, Fuel2, Fuel1, Fuel0)
BEGIN
FuelWarningLight <= ((not Fuel3) AND (not Fuel2)) OR ((not Fuel1) AND (not Fuel0));
END PROCESS;
END Behavior;
考虑使用时钟进程,如下所示(我实际上没有合成这个,所以如果有任何错误就道歉)。
ENTITY LFDetector_behav IS
PORT (clk, Fuel3, Fuel2, Fuel1, Fuel0: IN std_logic;
FuelWarningLight: OUT std_logic);
END LFDetector_behav;
ARCHITECTURE Behavior OF LFDetector_behav IS
BEGIN
PROCESS (clk)
BEGIN
if rising_edge(clk) then
FuelWarningLight <= ((not Fuel3) AND (not Fuel2)) OR ((not Fuel1) AND (not Fuel0));
end if;
END PROCESS;
END Behavior;