VHDL no函数声明为“ =”(if语句,std_logic)

时间:2019-01-20 15:27:27

标签: vhdl function-declaration

我想是时候到这里了。因此,对于学校来说,我正在对此VHDL控件进行编码,并且不断收到相同的错误。我搜索了各种类似的问题,但找不到解决方法。 las,我必须承认我是VHDL的绝对初学者,但是学校的科学助手也无法解决这个问题。 这是我的代码:

library ieee;

use ieee.std_logic_1164.all; 

use ieee.std_logic_arith.ALL; 



entity steuerung is 

  port  

  ( 

    Clk             : in std_logic;
    Reset           : in std_logic;
    AktPos          : in std_logic_vector(15 downto 0);
    Notaus          : in std_logic;
    Betrieb         : in std_logic;
    HPR             : in std_logic;
    HPL             : in std_logic;
    ESR             : in std_logic;
    ESL             : in std_logic;
    CntClr          : out std_logic;
    LedR            : out std_logic;
    LedG            : out std_logic;
    M_An            : out std_logic;
    M_Li            : out std_logic;
    M_Re            : out std_logic;
    State           : out std_logic_vector(2 downto 0)
  );

end steuerung;


architecture behave of steuerung is
begin
        process(Clk, Reset, AktPos, Notaus, Betrieb, ESR, ESL)

            type statet is (auf, ab, steht, notaus, reset_ab, reset_auf);

            variable var_zustand: statet;

            variable var_ausgabe: std_logic_vector (2 downto 0);

        begin

            if Reset = '1' then

                var_zustand := steht;

            elsif(Clk'event and Betrieb = '1') then

                case var_zustand is

                    when steht =>

                        if (ESR = '0' and ESL = '0' and Notaus = '0') then

                            var_zustand := steht;

                        end if;

                        if (ESL = '1' and Notaus = '0' and ESR = '0') then

                            var_zustand := reset_ab;

                        end if;

                        if (ESR = '1' and Notaus = '0') then

                            var_zustand := reset_auf;

                        end if;

                        if (Notaus = '1') then

                            var_zustand := notaus;

                        end if;

                    when reset_ab =>

                        if (Notaus = '1') then

                            var_zustand := notaus;

                        elsif (ESL = '0' and Notaus = '0' and AktPos < "10111110100000000") then

                            var_zustand := ab;

                        elsif (Notaus = '0' and AktPos >= "10111110100000000") then

                            var_zustand := steht;

                        end if;

                    when ab =>

                        if (AktPos < "10111110100000000" and ESL = '0' and Notaus = '0') then

                            var_zustand := ab;

                        end if;

                        if ((ESL = '1' or AktPos >= "10111110100000000") and Notaus = '0') then

                            var_zustand := reset_ab;

                        end if;

                        if (Notaus = '1') then

                            var_zustand := notaus;

                        end if;

                    when auf =>

                        if (AktPos > "0100000110000000" and ESR = '0' and Notaus = '0') then

                            var_zustand := auf;

                        end if;

                        if ((AktPos <= "0100000110000000" or ESR = '1') and Notaus = '0') then

                            var_zustand := reset_auf;

                        end if;

                        if (Notaus = '1') then

                            var_zustand := notaus;

                        end if;

                    when reset_auf =>

                        if (Notaus = '1') then

                            var_zustand := notaus;

                        elsif (Notaus = '0' and ESR = '0' and AktPos  > "0100000110000000") then

                            var_zustand := auf;

                        elsif (AktPos <= "0100000110000000" and Notaus = '0') then

                            var_zustand := steht;

                        end if;

                    when notaus =>

                        if (Betrieb = '0') then

                            var_zustand := notaus;

                        end if;

                        if (Betrieb = '1') then

                            var_zustand := steht;

                        end if;

                    when others =>

                        var_zustand := steht;

                end case;

            end if;



                case var_zustand is

                    when steht =>

                        var_ausgabe := "000";

                        M_An <= '0';

                        M_Li <= '0';

                        M_Re <= '0';

                        LedR <= '0';

                    when ab =>

                        var_ausgabe := "010";

                        M_An <= '1';

                        M_Li <= '1';

                        M_Re <= '0';

                    when reset_ab =>

                        var_ausgabe := "001";

                        CntClr <= '1';

                    when auf =>

                    M_An <= '1';

                    M_Li <= '0';

                    M_Re <= '1';

                    var_ausgabe := "100";

                    when reset_auf =>

                        var_ausgabe := "011";

                        CntClr <= '1';

                    when notaus =>

                        var_ausgabe := "110";

                        M_An <= '0';

                        M_Li <= '0';

                        M_Re <= '0';

                        LedR <= '1';

                    when others =>

                        var_ausgabe := "111";

                        M_An <= '0';

                        M_Li <= '0';

                        M_Re <= '0';

                        LedR <= '1';

                end case;



                State <= var_ausgabe;

        end process;

end behave;

我得到的所有错误

  

../ hdl_temp / steuerung.vhd:40:95:没有用于运算符的函数声明   “ =”

但对于几行不同的代码(40、43、46、49、53、55、57、61、6467, 71、74、77、81、83、85)。我希望这是可以理解的,尽管有些 德国人扔在那里。 从字面上讲,我一直在强调这个问题,感觉像个白痴。我没看到什么?

0 个答案:

没有答案