一个简单的6位数字钟,利用外部5M clk做时钟,但是无法编译通过,我所有的case语句都被打上了这句错误,unsupported feature error:channel of width >=32 is not supported
-----------------这是全部源码,双击错误会直接定位到case那一行------------
LIBRARY IEEE;
USE IEEE.STD_LOGIC_1164.ALL;
USE IEEE.STD_LOGIC_UNSIGNED.ALL;
ENTITY xin IS
PORT(CLK,REST,AD_SHI,AD_FEN: IN STD_LOGIC;
WX:OUT STD_LOGIC_VECTOR(7 downto 0);
DX:OUT STD_LOGIC_VECTOR(5 downto 0);
LED:OUT STD_LOGIC_VECTOR(7 downto 0);
BELL:OUT STD_LOGIC );
END xin;
ARCHITECTURE ONE OF xin IS
SIGNAL TIME1,TIME2:INTEGER;
SIGNAL shuzi,TB,ZD,HY:INTEGER;
BEGIN
P1:PROCESS(CLK) --分频
VARIABLE A,B,C:INTEGER ;
VARIABLE D,E:INTEGER RANGE 0 TO 1;--分频参数
BEGIN
IF (CLK'EVENT AND CLK='1') THEN A:=A+1; --5M分频
IF A >10 THEN A:=0;B:=B+1;D:=D+1;TIME1<=D;
IF B>10 THEN C:=C+1;E:=E+1;TIME2<=E;B:=0;TIME1<=0;
END IF;
END IF;
END IF;
END PROCESS P1;
P2:PROCESS(TIME2,REST,AD_SHI,AD_FEN) --计时 调时 复位 输出控制参数
VARIABLE A:INTEGER;
VARIABLE SS,FS,MS,SG,FG,MG:INTEGER; --时间参数 S F M和G S
BEGIN
IF TIME2 =1 THEN MG:=MG+1; --计时模块
IF MG > 10 THEN MG:=0;MS:=MS+1;
IF MS > 6 THEN MS:=0;FG:=FG+1;
IF FG > 10 THEN FG:=0;FS:=FS+1;
IF FS > 6 THEN FS:=0;SG:=SG+1;ZD<=ZD+1;--整点赋1
IF SG > 4 THEN SG:=0;SS:=SS+1;
IF SS > 2 THEN SS:=0;
END IF;
END IF;
END IF;
END IF;
END IF;
END IF;
END IF;
IF REST'EVENT AND REST='1'THEN MG:=0; MS:=0; FG:=0; FS:=0; SG:=0; SS:=0;END IF; --清零
IF AD_SHI'EVENT AND AD_SHI='1'THEN SG:=SG+1;END IF; --调时
IF AD_FEN'EVENT AND AD_FEN='1'THEN FG:=FG+1;END IF;
IF MG<5 THEN HY<=MG; END IF; --输出控制参数 --花样时间
IF MG=3 THEN ZD<=0; END IF; --整点参数清零
IF TIME1=1 THEN A:=A+1; --动态扫描时间间距参数
IF A >6 THEN A:=0;
END IF;
END IF;
CASE A IS
WHEN 0 => shuzi<=MG;TB<=0; --数据显示轮输出
WHEN 1 => shuzi<=MS;TB<=1;
WHEN 2 => shuzi<=FS;TB<=2;
WHEN 3 => shuzi<=FG;TB<=3;
WHEN 4 => shuzi<=SG;TB<=4;
WHEN 5 => shuzi<=SS;TB<=5;
when others=> NULL;
END CASE;
END PROCESS P2;
P3:PROCESS(TB,shuzi) --显示模块
BEGIN
CASE shuzi IS
WHEN 0 => WX<="00111111"; --译码
WHEN 1 => WX<="00000110";
WHEN 2 => WX<="01011011";
WHEN 3 => WX<="01001111";
WHEN 4 => WX<="01100110";
WHEN 5 => WX<="01101101";
WHEN 6 => WX<="01111101";
WHEN 7 => WX<="00000111";
WHEN 8 => WX<="01111111";
WHEN 9 => WX<="01101111";
when others=> NULL;
END CASE ;
CASE TB IS
WHEN 0 => DX<="000001"; --选位
WHEN 1 => DX<="000010";
WHEN 2 => DX<="000100";
WHEN 3 => DX<="001000";
WHEN 4 => DX<="010000";
WHEN 5 => DX<="100000";
when others=> NULL;
END CASE ;
END PROCESS P3;
P4:PROCESS(ZD,HY)
BEGIN
IF ZD=1 THEN
CASE HY IS
WHEN 0 =>BELL<='0';LED<="10101010"; --LED花样 --闹钟
WHEN 1 =>BELL<='1';LED<="01010101";
WHEN 2 =>BELL<='0';LED<="11110000";
WHEN 3 =>BELL<='1';LED<="00001111";
WHEN 4 =>BELL<='0';LED<="00000000";
when others=> NULL;
END CASE;
END IF;
END PROCESS P4;
END ONE;
求教, |