scfor 发表于 2011-7-23 11:58:33

仿真无错,综合出现问题

library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
entity fenpin is
port(
clk_a:in std_logic;         --a脉冲
clk_b:in std_logic;         --a脉冲
cmd:in std_logic_vector(7 downto 0);--拨码输入
clkout_a:out std_logic;      --a
clkout_b:out std_logic;   --拨码分频输出b
out_a : outSTD_LOGIC;   --
out_b : outSTD_LOGIC;   ---8分频输出b
k : outSTD_LOGIC          --方向输出
);
end fenpin;
architecture arch of fenpin is
signal clkt_a:std_logic:='0';
signal clkt_b:std_logic:='0';
signal        count_a :std_logic_vector(2 downto 0):="000";
signal        count_b :std_logic_vector(2 downto 0):="000";
signal kout:std_logic:='0';
signal kc:std_logic:='0';

begin
clkout_a<=clkt_a;
clkout_b<=clkt_b;
k<=kout;

process(clk_a,kc)
        begin
        if (kc='1') then count_a<="000";
          else
          if (clk_a'event and clk_a='1')
                then
                        if (count_a="111") then
                               count_a<=(others=>'0');
                        else
                               count_a<=count_a+1;
                                  if(count_a(2)='0') then
                                out_a<='1';
                        else
                                out_a<='0';
                        end if;
                        end if;
        end if;
    end if;
end process;

process(clk_b,kc)
        begin
        if (kc='1') then count_b<="000";
       else
          if (clk_b'event and clk_b='1')
                then
                        if (count_b="111") then
                               count_b<=(others=>'0');
                        else
                               count_b<=count_b+1;
                                  if(count_b(2)='0') then
                                out_b<='1';
                        else
                                out_b<='0';
                        end if;
                        end if;
        end if;
      end if;
end process;
-- b信号八分频
process(kout,clk_a)
begin
if(kout'event) then kc<='1';         -----------------------------------line 175
else if (clk_a='0') then kc<='0';
end if;
end if;
end process;

process(clk_a,clk_b)
        begin
                if (clk_a'event and clk_a='1') then
                        if clk_b='1' then
                                kout<='1';
                        else
                                kout<='0';
                        end if;
                end if;
end process;

-- ab信号相位判断



process(clk_a,cmd)
variable cnt_a:std_logic_vector(7 downto 0):="00000000";
begin
   if cmd=0 then
      clkt_a<=clk_a;
      cnt_a:="00000001";
      elsif rising_edge(clk_a) then
            if cnt_a="00000001" then
                   clkt_a<=not clkt_a;
                   cnt_a:=cmd;
            else
                  cnt_a:=cnt_a-1;
            end if;
    end if;
end process;
-- a拨码分频

process(clk_b,cmd)
variable cnt_b:std_logic_vector(7 downto 0):="00000000";
begin
    if cmd=0 then
      clkt_b<=clk_b;
      cnt_b:="00000001";
elsif rising_edge(clk_b) then
if cnt_b="00000001" then
clkt_b<=not clkt_b;
cnt_b:=cmd;
else
cnt_b:=cnt_b-1;
end if;
end if;
end process;
end arch;
-- b拨码分频



综合提示错误:
Analyzing Entity <fenpin> in library <work> (Architecture <arch>).
ERROR:Xst:797 - "E:/xilinx workfile/fenpin/fenpin.vhd" line 175: unsupported Clock statement.

高手帮我看下怎么回事?

lanqilove 发表于 2011-7-23 12:36:42

看结果是第175行出问题了…………

可是……我发现你贴出来的代码压根就没有175行啊?

你能否把代码的行号标上,要不然别人还得一句一句分析啊?贴个完整的。

g47603690 发表于 2011-7-23 12:52:43

时钟双沿触发,不得行

scfor 发表于 2011-7-23 13:30:45

回复【1楼】lanqilove 三木
看结果是第175行出问题了…………
可是……我发现你贴出来的代码压根就没有175行啊?
你能否把代码的行号标上,要不然别人还得一句一句分析啊?贴个完整的。
-----------------------------------------------------------------------

我标了啊if(kout'event) then kc<='1';         -----------------------------------line 175
页: [1]
查看完整版本: 仿真无错,综合出现问题