菜鸟求指导~VHDL交通灯程序的编译错误···

2019-03-25 10:07发布

其中一个process如下,可不可以这样计数呀,就是不同的状态要延续不同的时间
process(clk,reset,call)
        begin
                if(reset='1')then
                        cur_st<=s0;
                else
                        if(cur_st=s0)then
                                if(clk'event and clk='1')then
                                        if(call='0')then
                                                if(count0=4999)then
                                                        cur_st<=next_st;
                                                        count0<=0;
                                                else
                                                        count0<=count0+1;
                                                end if;
                                        end if;
                                end if;
                        elsif(cur_st=s1 or cur_st=s3)then
                                if(clk'event and clk='1')then
                                        if(call='0')then
                                                if(count1=24999)then
                                                        cur_st<=next_st;
                                                        count1<=0;
                                                else
                                                        count1<=count1+1;
                                                end if;
                                        end if;
                                end if;
                        elsif(cur_st=s2 or cur_st=s4)then
                                if(clk'event and clk='1')then
                                        if(call='0')then
                                                if(count2=9999)then
                                                        cur_st<=next_st;
                                                        count2<=0;
                                                else
                                                        count2<=count2+1;
                                                end if;
                                        end if;
                                end if;
                        end if;
                end if;
        end process;

出现如下编译错误,求救啊!!!该怎么改呢??
Error (10821): HDL error at jiaotongdeng.vhd(21): can't infer register for "cur_st.s4" because its behavior does not match any supported register model
Error (10821): HDL error at jiaotongdeng.vhd(21): can't infer register for "cur_st.s3" because its behavior does not match any supported register model
Error (10821): HDL error at jiaotongdeng.vhd(21): can't infer register for "cur_st.s2" because its behavior does not match any supported register model
Error (10821): HDL error at jiaotongdeng.vhd(21): can't infer register for "cur_st.s1" because its behavior does not match any supported register model
Error (10821): HDL error at jiaotongdeng.vhd(21): can't infer register for "cur_st.s0" because its behavior does not match any supported register model
Error (10822): HDL error at jiaotongdeng.vhd(33): couldn't implement registers for assignments on this clock edge
Error (10822): HDL error at jiaotongdeng.vhd(44): couldn't implement registers for assignments on this clock edge
Info (10018): Can't recognize finite state machine "cur_st" because it has a complex reset state
Error: Can't elaborate top-level user hierarchy
Error: Quartus II Analysis & Synthesis was unsuccessful. 8 errors, 6 warnings
        Error: Peak virtual memory: 214 megabytes
        Error: Processing ended: Wed Aug 24 15:50:17 2011
        Error: Elapsed time: 00:00:03
        Error: Total CPU time (on all processors): 00:00:03
Error: Quartus II Full Compilation was unsuccessful. 10 errors, 6 warnings 此帖出自小平头技术问答
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
1条回答
eeleader
2019-03-25 13:59
< /

if(cur_st=s0)then
if(clk'event and clk='1')then
if(call='0')then
if(count0=4999)then

 

楼主这种语法格式绝对不正确,不符合电路,VHDL标准的电路编写方式

 

begin

if (rst='1') then

  --------------

if(clk'event and clk='1')then

---------------

end if;

一周热门 更多>