LATCH Primitive 禁用输出?
LATCH Primitive disables outputs?
所以我理解锁存器的概念,但我没有看到我是如何在这里推断锁存器的,因为我的 else 条件应该涵盖通过这个过程的所有可能路径。 Quartus 告诉我它正在禁用 greenLEDS 和 redLED,因为 LATCH 原语,以及它们上有一个推断的锁存器。我在这里遗漏了什么吗?
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;
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;
如果 playerWins
为假且 dealerWins
为真,则不分配 redLeds
。同样,如果 playerWins
为真,则不分配 greenLeds
。
所以我理解锁存器的概念,但我没有看到我是如何在这里推断锁存器的,因为我的 else 条件应该涵盖通过这个过程的所有可能路径。 Quartus 告诉我它正在禁用 greenLEDS 和 redLED,因为 LATCH 原语,以及它们上有一个推断的锁存器。我在这里遗漏了什么吗?
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;
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;
如果 playerWins
为假且 dealerWins
为真,则不分配 redLeds
。同样,如果 playerWins
为真,则不分配 greenLeds
。