本帖最后由 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...为什么不可达到?
|