下面DATACLK产生代码,两个计数器cnt_1M和cnt_LS都是通过24M分频至8M(采用时钟使能设计),再通过8M计数产生。
DATACLKS:process(clk24M,rst_state)
begin
if clk24M'event and clk24M='1' then
if rst_state='0' then
DATACLK<='0';
else
if MODE="00" then
if ((cnt_total>="0000000000000") and (cnt_total<"0000000000000"+1120)) then
DATACLK<='1';
elsif cnt_1M="000" or cnt_1M="001" or cnt_1M="010" or cnt_1M="011" then
DATACLK<='0';
else
DATACLK<='1';
end if;
elsif MODE="01" then
if ((cnt_total>="0000000000000") and (cnt_total<"0000000000000"+880)) then
DATACLK<='0';
elsif cnt_LS="1100" or cnt_LS="1101" or cnt_LS="1110" or cnt_LS="1111" then
DATACLK<='1';
else
DATACLK<='0';
end if;
elsif MODE="10" then
if ((cnt_total>="00000000000000") and (cnt_total<"00000000000000"+1640)) then
DATACLK<='1';
elsif cnt_1M="000" or cnt_1M="001" or cnt_1M="010" or cnt_1M="011" then
DATACLK<='0';
else
DATACLK<='1';
end if;
elsif MODE="11" then
if ((cnt_total>="00000000000000") and (cnt_total<"00000000000000"+1840)) then
DATACLK<='0';
elsif cnt_LS="1100" or cnt_LS="1101" or cnt_LS="1110" or cnt_LS="1111" then
DATACLK<='1';
else
DATACLK<='0';
end if;
end if;
end if;
end if;
end process DATACLKS;
这是warning:Warning: Found 1 node(s) in clock paths which may be acting as ripple and/or gated clocks -- node(s) analyzed as buffer(s) resulting in clock skew
Info: Detected ripple clock "CCD_Driver:inst|DATACLK" as buffer