微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

此处只能声明 SHARED 变量

如何解决此处只能声明 SHARED 变量

我需要你的帮助来解决这个问题:

-Line 34. Only SHARED variables can be declared here
-Line 35. Only SHARED variables can be declared here
-Line 36. parse error,unexpected IDENTIFIER

library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.numeric_std.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;

entity Managementsystem is
            port( e     :  in    std_logic;
                    s       :  out   std_logic_vector (0 to 5)
                );
end Managementsystem;

architecture Managment_Archi of Managementsystem is
    type State is (st1,st2,st3,st4,st5,st6,st7,st8);
    signal w:State;
    variable Ppv,Pwind,Pl,SOC,SOCmin,SOCmax : integer range 0 to 1000000;
    variable x,y,z,a,b : integer range 0 to 1000000;
    x <= (Ppv > Pl);
    y <= (Pwind > Pl);
    z <= ((Ppv + Pwind) > Pl);
    a <= (SOC > SOCmin);
    b <= (SOC < SOCmax);
begin
    process (e,w)
    begin
            case w is
            when st1 =>
            if e = z then w <= st5 ;
            elsif e = y then w <= st1 ;
            elsif e = x then w <= st3 ;
            elsif e = (not (z) and a) then w <= st7;
            else w <= st1;
            end if;
            end case;
    end process;                    
    --with w select
        s <= "010010" when st1;
        --s <= "011010" when st2;
        --s <= "100001" when st3;
        --s <= "101001" when st4;
        --s <= "110000" when st5;
        --s <= "110100" when st6;
        --s <= "111000" when st7; -- décharge
        --s <= "111000" when st8; -- charge
end Managment_Archi;

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。