LATCH Primitive禁用输出?

时间:2015-06-01 23:09:26

标签: vhdl synthesis quartus

所以我理解了一个锁存器的概念,但是我没有看到我在这里推断一个,因为我的其他条件应该涵盖通过这个过程的所有可能的路径。 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;

1 个答案:

答案 0 :(得分:3)

      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;

如果redLeds为false且playerWins为true,则不指定dealerWins。同样,如果greenLeds为真,则不指定playerWins