所以我理解闩锁的概念,但我没有看到我在这里如何推断一个,因为我的 else 条件应该涵盖通过这个过程的所有可能路径。Quartus 告诉我,由于 LATCH 原语,它正在禁用 greenLEDS 和 redLED,并且它们上有一个推断的锁存器。我在这里错过了什么吗?
process(current,advance,playerWins,dealerWins) begin
if(advance) then
case current is
when START =>
deal <= '1';
dealTo <= '1';
dealToCardSlot <= "00";
greenLeds <= (others => '0');
redLeds <= (others => '0');
when PT1 =>
deal <= '1';
dealTo <= '1';
dealToCardSlot <= "01";
greenLeds <= (others => '0');
redLeds <= (others => '0');
when DT1 =>
deal <= '1';
dealTo <= '0';
dealToCardSlot <= "00";
greenLeds <= (others => '0');
redLeds <= (others => '0');
when PT2 =>
deal <= '1';
dealTo <= '1';
dealToCardSlot <= "10";
greenLeds <= (others => '0');
redLeds <= (others => '0');
when PT3 =>
deal <= '1';
dealTo <= '1';
dealToCardSlot <= "11";
greenLeds <= (others => '0');
redLeds <= (others => '0');
when DT2 =>
deal <= '1';
dealTo <= '0';
dealToCardSlot <= "01";
greenLeds <= (others => '0');
redLeds <= (others => '0');
when DT3 =>
deal <= '1';
dealTo <= '0';
dealToCardSlot <= "10";
greenLeds <= (others => '0');
redLeds <= (others => '0');
when DT4 =>
deal <= '1';
dealTo <= '0';
dealToCardSlot <= "11";
greenLeds <= (others => '0');
redLeds <= (others => '0');
when WIN =>
deal <= '0';
dealTo <= '0';
dealToCardSlot <= "00";
if(playerWins) then
greenLeds <= (others => '1');
elsif(dealerWins) then
redLeds <= (others => '1');
else
greenLeds <= (others => '0');
redLeds <= (others => '0');
end if;
when ENDGAME =>
deal <= '0';
dealTo <= '1';
dealToCardSlot <= "00";
greenLeds <= (others => '0');
redLeds <= (others => '0');
when others =>
deal <= '0';
dealTo <= '0';
dealToCardSlot <= "00";
greenLeds <= (others => '0');
redLeds <= (others => '0');
end case;
else
deal <= '0';
dealTo <= '0';
dealToCardSlot <= "00";
greenLeds <= (others => '0');
redLeds <= (others => '0');
end if;
end process;