打印
[VHDL]

状态机case的默认情况为什么没执行?

[复制链接]
659|1
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
petrel87|  楼主 | 2016-6-7 21:09 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 petrel87 于 2016-6-8 09:46 编辑

   busy1<=send_data_grp;
            busy2<=busy1;
            if reset='0'  then
                state<="10";
                send_data_grp<='0';
                else  if rising_edge(clk) then
                         case  state   is
                         when "10"=>
                              if  me_wr='0'    then
                              state<="00";
                              end if;
                         when "00"  =>
                 ........
                              send_data_grp<='1';
                              state<="01";
                          when "01"    =>
                    ......
                              state<="11";
                          when "11"  =>
                    .            ..........
                          when others =>
                               state<="10";
                               send_data_grp<='0';
                          end case;               
           end if;
关键性就是测试busy的输出。而busy源于send_data_grp。
综合以后我后仿了一下,给me_wr有0或者1时,send_data_grp值是St1或St0,然后给me_wr 不定态x时,send_data_grp为不定态Stx.
貌似是因为语句

                                 if me_wr='0' then
                              state<="00";
                              end if;         
  if无法判定me_wr是不是0,所以state就是不定态,然后send_data_grp就没值了。
问题来了!state是2位共81种状态,按默认others都应该会执行
                               when others =>
                               state<="10";
                               send_data_grp<='0';
  为什么却没执行???对了,综合时这里还有个警告,说这个case 语句的  :default branch cannot be reached...为什么不可达到?

相关帖子

沙发
petrel87|  楼主 | 2016-6-8 16:24 | 只看该作者
查到了。。原来是dc不识别4值逻辑。。。
那可咋办啊。这句默认看来是纠错用的。有没有什么工具识别4值逻辑啊

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

3

主题

6

帖子

0

粉丝