|
这段代码功能没问题,但有30多警告,大概是寄存器之类的警告,有没有隐患?
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
use ieee.std_logic_arith.all;
entity PUL is
port(
rest : in STD_LOGIC:='0';
cen : in STD_LOGIC:='0';
jEN : in STD_LOGIC:='0';
clk : in std_logic;
yd : in integer range 0 to 8000;
sout : out integer range 0 to 8000;
sd : in integer range 0 to 8000);
end PUL;
architecture ep2c8 of PUL is
signal scounter :integer range 0 to 8000;
begin
process (clk,cen,rest,yd)
begin
if (rest='1')then
scounter <=yd;
sout <=1000;
elsif (clk'event and clk='1')AND (rest='0')then
if (cen='1')then
if(sd /= scounter)AND(jEN='0')AND(sd >100) then
scounter <=scounter -1;
elsif (jEN='1')AND(scounter<8000)then
scounter <=scounter+1;
else
scounter <=scounter;
end if;
sout<=scounter;
end if;
else
null;
end if;
end process;
end ep2c8; |
阿莫论坛20周年了!感谢大家的支持与爱护!!
知道什么是神吗?其实神本来也是人,只不过神做了人做不到的事情 所以才成了神。 (头文字D, 杜汶泽)
|