本帖最后由 胡斯哲 于 2014-12-3 18:18 编辑
这个这样放置在边沿检测编译不通过ADJUST2:PROCESS(down) BEGIN
IF adj_bit = 6 THEN v60s1<="000000";v60m1<="000000";END IF;--problem--
IF down' EVENT AND down='0' THEN
CASE adj_bit IS
WHEN "0001"=>v60s1<=v60s1+1;
WHEN "0010"=>v60m1<=v60m1+1;
WHEN OTHERS=>NULL;
END CASE;
END IF;
END PROCESS;
放置在后面就编译通过ADJUST2:PROCESS(down) BEGIN
IF down' EVENT AND down='0' THEN
CASE adj_bit IS
WHEN "0001"=>v60s1<=v60s1+1;
WHEN "0010"=>v60m1<=v60m1+1;
WHEN OTHERS=>NULL;
END CASE;
END IF;
IF adj_bit = 6 THEN v60s1<="000000";v60m1<="000000";END IF;---------++++++++——————————
END PROCESS;
而另一则放置在边沿检测前可以通过
SEC: PROCESS(clk)
VARIABLE v60s2:STD_LOGIC_VECTOR(5 DOWNTO 0);
BEGIN
IF adj_bit/=0 THEN v60s2:=v60s1; END IF;
IF clk' EVENT AND clk='1'
THEN
IF stop='0' THEN
if v60s=59 THEN v60s<="000000";clk_60s_m<='1';--59
ELSE v60s<=v60s+1+v60s2;clk_60s_m<='0';
END IF;
END IF;
END IF;
END PROCESS; |