2

作为学习练习,我正在使用 VHDL 在 FPGA 上进行一些 HDMI 实验。在 Vivado (2017.1) 中实施它时,我在时序报告中遇到以下警告:

There are 11 register/latch pins with no clock driven by root clock pin: Hsync_i_reg/Q (HIGH)

我打开了实现的原理图并寻找有问题的引脚。它似乎与其他所有东西都连接到同一个时钟(并且这些时钟没有在时序报告中标记),所以我对上述错误所指的内容感到困惑。以下是示意图中的一些照片:

在此处输入图像描述 在此处输入图像描述

这是违规设计的 VHDL 代码:

library ieee;
use ieee.std_logic_1164.all;

entity ctrl_gen is
    generic (
        ha: integer := 96; --hpulse
        hb: integer := 144; --hpulse+hbp
        hc: integer := 784; --hpulse+hbp+hactive
        hd: integer := 800; --hpulse+hbp+hactive+hfp
        va: integer := 2; --vpulse
        vb: integer := 35; --vpulse+vbp
        vc: integer := 515; --vpulse+vbp+vactive
        vd: integer := 525 --vpulse+vbp+vactive+vfp
    );
    port (
        clk25: in std_logic; --tmds clock (25mhz)
        hsync: out std_logic; --horizontal sync
        vsync: out std_logic; --vertical sync
        hactive: out std_logic; --active portion of hsync
        vactive: out std_logic; --active portion of vsync
        dena: out std_logic --display enable
    );
end entity;

architecture behavioral of ctrl_gen is
    signal hsync_i, hactive_i, vactive_i, vsync_i : std_logic;
begin
    -- horizontal signals generation
    hproc : process (clk25)
        variable hcount: integer range 0 to hd := 0;
    begin
        if rising_edge(clk25) then
            hcount := hcount + 1;

            if (hcount=ha) then
                hsync_i <= '1';
            elsif (hcount=hb) then
                hactive_i <= '1';
            elsif (hcount=hc) then
                hactive_i <= '0';
            elsif (hcount=hd) then
                hsync_i <= '0';
                hcount := 0;
            end if;
        end if;
    end process;

    -- vertical signals generation
    vproc : process (hsync_i)
        variable vcount: integer range 0 to vd := 0;
    begin
        if falling_edge(hsync_i) then
            vcount := vcount + 1;

            if (vcount=va) then
                vsync_i <= '1';
            elsif (vcount=vb) then
                vactive_i <= '1';
            elsif (vcount=vc) then
                vactive_i <= '0';
            elsif (vcount=vd) then
                vsync_i <= '0';
                vcount    := 0;
            end if;
        end if;
    end process;

    dena <= hactive_i and vactive_i;
    hsync <= hsync_i;
    vactive <= vactive_i;
    hactive <= hactive_i;
end behavioral;

回想起来,我认为警告告诉我 Hsync_i_reg/Q 是用于 Vcount 寄存器的时钟,而不是 Hsync_i_reg 本身,如果没有连接到根时钟引脚?

我使用的方法是不好的做法并且不太可能奏效吗?整体设计不起作用,我试图了解这是否是原因。

谢谢。

4

2 回答 2

3

我看到了潜在的设计问题。首先是variable用于实际上是时钟信号的对象。其次,您使用生成的信号作为时钟输入。这也不好。

我会将您的代码修改为以下内容(如果它完全完成您的代码之前所做的事情,则未经测试)

library ieee;
use ieee.std_logic_1164.all;

entity ctrl_gen is
    generic (
        ha: integer := 96; --hpulse
        hb: integer := 144; --hpulse+hbp
        hc: integer := 784; --hpulse+hbp+hactive
        hd: integer := 800; --hpulse+hbp+hactive+hfp
        va: integer := 2; --vpulse
        vb: integer := 35; --vpulse+vbp
        vc: integer := 515; --vpulse+vbp+vactive
        vd: integer := 525 --vpulse+vbp+vactive+vfp
    );
    port (
        clk25: in std_logic; --tmds clock (25mhz)
        hsync: out std_logic; --horizontal sync
        vsync: out std_logic; --vertical sync
        hactive: out std_logic; --active portion of hsync
        vactive: out std_logic; --active portion of vsync
        dena: out std_logic --display enable
    );
end entity;

architecture behavioral of ctrl_gen is
    signal hsync_i, hactive_i, vactive_i, vsync_i : std_logic;

    signal hcount: integer range 0 to hd-1 := 0;
    signal vcount: integer range 0 to vd-1 := 0;
begin
    -- horizontal signals generation
    hproc : process (clk25)
    begin
        if rising_edge(clk25) then
            if hcount < hd-1 then
                hcount <= hcount + 1;
            else
                hcount <= 0;
            end if;

            if (hcount=ha-1) then
                hsync <= '1';
            end if;
            if (hcount=hb-1) then
                hactive_i <= '1';
            end if;
            if (hcount=hc-1) then
                hactive_i <= '0';
            end if;
            if (hcount=hd-1) then
                hsync <= '0';
            end if;
        end if;
    end process;

    -- vertical signals generation
    vproc : process (clk25)
    begin
        if rising_edge(clk25) then
            if hcount = hd-1 then -- moment of falling_edge hsync.
                if vcount < vd-1 then
                    vcount <= vcount + 1;
                else
                    vcount <= 0;
                end if;

                if (vcount=va-1) then
                    vsync <= '1';
                end if;
                if (vcount=vb-1) then
                    vactive_i <= '1';
                end if;
                if (vcount=vc-1) then
                    vactive_i <= '0';
                end if;
                if (vcount=vd-1) then
                    vsync <= '0';
                end if;
            end if;
        end if;
    end process;

    dena <= hactive_i and vactive_i;
    vactive <= vactive_i;
    hactive <= hactive_i;
end behavioral;
于 2018-01-10T17:31:10.230 回答
-1

我认为:

signal hcount: integer range 0 to hd-1 := 0;
signal vcount: integer range 0 to vd-1 := 0;

不是 , 的有效综合类型hcountvcount它应该是std_logic_vector

于 2018-06-21T10:31:42.777 回答