[VHDL]用信号驱动输出端口,为什么输出端口不可见?
[VHDL]Using signal to drive output ports,why are the output ports not visible?
参考这个 post 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 是?
我是这个领域的初学者。
在 ISE14.4 中工作正常。我记得旧版本的 RTL Viewer 几乎无法使用。
当我第一次开始写 VHDL 时,我也尝试在离散门中写一个 FF,AFAIR 它不太顺利。
您应该写入您的平台(在这种情况下可能是一些 Xilinx 芯片),知道它是什么和做什么。
这也将在您继续培训时帮助您,FPGA 和 CPLD 不是 AND 和 OR 门的大阵列,它们是查找表的大阵列,因此在 FPGA 中实现 FF 的机会是苗条到 none.
关于你的实际问题,我首先要确保我确实将我的输出设置到了某个地方。合成器非常努力地不包含多余的电路,因此如果您的结果没有任何结果,它可能会被优化掉(即使那肯定也应该优化掉您确实得到的电路)。
另外如前所述,请尝试更新您的工具,14.7 比 9.1 新得多,甚至从 2013 年 10 月开始。
参考这个 post 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 是? 我是这个领域的初学者。
在 ISE14.4 中工作正常。我记得旧版本的 RTL Viewer 几乎无法使用。
当我第一次开始写 VHDL 时,我也尝试在离散门中写一个 FF,AFAIR 它不太顺利。 您应该写入您的平台(在这种情况下可能是一些 Xilinx 芯片),知道它是什么和做什么。 这也将在您继续培训时帮助您,FPGA 和 CPLD 不是 AND 和 OR 门的大阵列,它们是查找表的大阵列,因此在 FPGA 中实现 FF 的机会是苗条到 none.
关于你的实际问题,我首先要确保我确实将我的输出设置到了某个地方。合成器非常努力地不包含多余的电路,因此如果您的结果没有任何结果,它可能会被优化掉(即使那肯定也应该优化掉您确实得到的电路)。
另外如前所述,请尝试更新您的工具,14.7 比 9.1 新得多,甚至从 2013 年 10 月开始。