【问题标题】:[VHDL]Using signal to drive output ports,why are the output ports not visible?[VHDL]使用信号驱动输出端口,为什么输出端口不可见?
【发布时间】:2015-11-29 19:14:51
【问题描述】:

参考这篇文章How to write to two output ports from inside architecture in VHDL?,我使用与其中一个答案中描述的相同概念制作了一个 VHDL 模块。 他的代码:

entity HIER is
port (
    IN1 : in bit;
    OUT1, OUT2 : out bit);
end hier;

architecture HIER_IMPL of HIER is 
   signal temp : bit;
   component BUF1 is 
      port (a : in bit; o : out bit);
   end component;
begin
   BUF2 : BUF1 port map (a => IN1, o => temp);
   OUT1 <= temp;
   OUT2 <= temp;

end HIER_IMPL;

他生成的 RTL(使用 xilinx 9.1i)

我使用相同的信号概念制作了一个 D 触发器来驱动输出端口 我的代码:

entity dfff is
    Port ( D : in  STD_LOGIC;
           clk : in  STD_LOGIC;
           Q : out  STD_LOGIC;
           Qbar : out  STD_LOGIC);
end dfff;

architecture Behavioral of dfff is
component nand_2 is
port(A:in std_logic;
        B:in std_logic;
        C:out std_logic);
end component;
component not_1 is
port(A:in std_logic;
                B:out std_logic);
                end component;
signal Z : std_logic_vector(4 downto 0);
begin
n1 : not_1 port map (D,z(0));
n2 : nand_2 port map(D,clk,z(1));
n3 : nand_2 port map(z(0),clk,z(2));
n4 : nand_2 port map(z(1),z(3),z(4));
n5 : nand_2 port map(z(2),z(4),z(3));
Q<=z(4);
Qbar<=z(3);
end Behavioral;

我生成的 RTL(使用 xilinx 9.1i):

现在我的问题是,为什么我的输出端口 Q 和 Qbar 在 RTL 中不可见,而他的 OUT1 和 OUT2 是? 我是这个领域的初学者。

【问题讨论】:

  • Xilinx 9.1i(假设是 ISE)听起来像是一个相当旧的版本;在尝试调试任何问题之前,您可能需要更新到最新版本。
  • 上次我测试“功能”时,我需要一个 *PAD 原语,因此不存在开放端。

标签: vhdl


【解决方案1】:

在 ISE14.4 中运行良好。我记得旧版本的 RTL Viewer 几乎无法使用。

【讨论】:

    【解决方案2】:

    当我第一次开始编写 VHDL 时,我还尝试在离散门中编写 FF,但结果并不顺利。 你应该在你的平台上写东西(在这种情况下可能是一些 Xilinx 芯片),知道它是什么和做什么。 这也将在您进行培训时为您提供帮助,FPGA 和 CPLD 不是很好的 AND 和 OR 门阵列,它们是很好的查找表阵列,因此在 FPGA 中实现 FF 的机会很好苗条到没有。

    关于您的实际问题,我首先要确保我确实将输出设置到某个地方。合成器非常努力地不包含多余的电路,因此如果您的结果没有以任何形式结束,它可能会被优化掉(即使这肯定也会优化掉您确实得到的电路)。

    如上所述,请尝试更新您的工具,14.7 比 9.1 更新得多,甚至从 2013 年 10 月开始。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-02-20
      • 2018-05-04
      • 1970-01-01
      • 2013-10-25
      • 2017-06-15
      相关资源
      最近更新 更多