原程序:
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity taxi is
port ( clk_250:in std_logic; --频率为250Hz的时钟
start :in std_logic; --计价使能信号
stop:in std_logic; --等待信号
fin:in std_logic; --公里脉冲信号
cha3
ut std_logic_vector(3 downto 0);
cha2,cha1,cha0
ut std_logic_vector(3 downto 0); --费用数据
km1,km0
ut std_logic_vector(3 downto 0); --公里数据
min1,min0: out std_logic_vector(3 downto 0)); --等待时间
end taxi;
architecture behav of taxi is
signal f_25,f_10,f_1:std_logic; --频率为25Hz,10Hz,1Hz的信号
signal q_25:integer range 0 to 24; --分频器
signal q_10:integer range 0 to 9; --分频器
signal q_1:integer range 0 to 249; --分频器
signal w:integer range 0 to 59; --秒计数器
signal c3:std_logic_vector(3 downto 0);
signal c2,c1,c0:std_logic_vector(3 downto 0); --制费用计数器
signal k1,k0:std_logic_vector(3 downto 0); --公里计数器
signal m1:std_logic_vector(3 downto 0); --分的十位计数器
signal m0:std_logic_vector(3 downto 0); --分的个位计数器
signal en1,en0,f:std_logic; --使能信号
begin
feipin:process(clk_250,start)
begin
if clk_250'event and clk_250='1' then
if start='0' then q_25<=0;q_10<=0;f_25<='0';f_10<='0';f_1<='0';f<='0';
else
if q_25=24 then q_25<=0;f_10<='1'; --此语句得到频率为10Hz的信号
else q_25<=q_25+1;f_10<='0';
end if;
if q_10=9 then q_10<=0;f_25<='1'; --此语句得到频率为25Hz的信号
else q_10<=q_10+1;f_25<='0';
end if;
if q_1=249 then q_1<=0;f_1<='1'; --此语句得到频率为1Hz的信号
else q_1<=q_1+1;f_1<='0';
end if;
if en1='1' then f<=f_10; --此语句得到计费脉冲f
elsif en0='1' then f<=f_25;
else f<='0';
end if;
end if;
end if;
end process;
process(f_1)
begin
if f_1'event and f_1='1' then
if start='0' then
w<=0;en1<='0';en0<='0';m1<="0000";m0<="0000";k1<="0000";k0<="0000";
elsif stop='1' then
--if w=59 then w<=0; --此语句完成等待计时
if m0="1001" then m0<="0000"; --此语句完成分计数
if m1<="0101" then m1<="0000";
else m1<=m1+1;
end if;
else m0<=m0+1;
end if;
if m1&m0>"00000001"then en1<='1'; --此语句得到en1使能信号等待计时
else en1<='0';--not count money
end if;
--else w<=w+1;en1<='1';
--end if;
elsif fin='1' then
if k0="1001" then k0<="0000"; --此语句完成公里脉冲计数
if k1="1001" then k1<="0000";
else k1<=k1+1;
end if;
else k0<=k0+1;
end if;
if k1&k0>"00000010" then en0<='1';en1<='0'; --此语句得到en0使能信号开始计费
else en0<='0';
end if;
else en1<='0';en0<='0';
end if;
cha3<=c3;cha2<=c2;cha1<=c1;cha0<=c0; --费用数据输出
km1<=k1;km0<=k0;min1<=m1;min0<=m0; --公里数据、分钟数据输出
end if;
end process;
process(f,start)
begin
if start='0' then c3<="0000";c2<="0001";c1<="0000";c0<="0000";
elsif f'event and f='1' then
if c0="1001" then c0<="0000"; --此语句完成对费用的计数
if c1="1001" then c1<="0000";
if c2="1001" then c2<="0000";
if c3<="1001" then c3<="0000";
else c3<=c3+1;
end if;
else c2<=c2+1;
end if;
else c1<=c1+1;
end if;
else c0<=c0+1;
end if;
end if;
end process;
end behav;
编译后有几处警告,是什么意思?该怎么消除阿??
Warning: Reduced register "taxi:inst7|c3[3]" with stuck data_in port to stuck value GND
Warning: Reduced register "taxi:inst7|cha3[3]" with stuck data_in port to stuck value GND
Warning: Reduced register "taxi:inst7|c3[2]" with stuck data_in port to stuck value GND
Warning: Reduced register "taxi:inst7|c3[1]" with stuck data_in port to stuck value GND
Warning: Reduced register "taxi:inst7|c3[0]" with stuck data_in port to stuck value GND
Warning: Reduced register "taxi:inst7|cha3[2]" with stuck data_in port to stuck value GND
Warning: Reduced register "taxi:inst7|cha3[1]" with stuck data_in port to stuck value GND
Warning: Reduced register "taxi:inst7|cha3[0]" with stuck data_in port to stuck value GND
Warning: Output pins are stuck at VCC or GND
Warning: Pin "row[2]" stuck at VCC |