信号_IBUF>不完整

发布于 2024-09-30 16:15:55 字数 2535 浏览 3 评论 0 原文

我正在尝试编写一个 VHDL 模块,但我遇到了一些输入问题,这是我的代码:

library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
--use ieee.std_logic_arith.all;
use ieee.std_logic_signed.all;


entity binary_add is
    port( n1 : in std_logic_vector(3 downto 0);
    n2 : in std_logic_vector(3 downto 0);
    segments : out std_logic_vector(7 downto 0);
    DNout : out std_logic_vector(3 downto 0));

end binary_add;

architecture Behavioral of binary_add is
begin

DNout <= "1110";

process(n1, n2)

variable x: integer;


begin

x:= conv_integer(n1(3)&n1(2)&n1(1)&n1(0)) + conv_integer(n2(3)&n2(2)&n2(1)&n2(0));

if(x = "0") then

segments <= "10000001";

elsif(x = "1") then

segments <= "11001111";

else

segments <= "00000000";

end if;

end process;

end Behavioral;

我收到这些错误:

WARNING:PhysDesignRules:367 - The signal <n1<1>_IBUF> is incomplete. The signal
   does not drive any load pins in the design.
WARNING:PhysDesignRules:367 - The signal <n1<2>_IBUF> is incomplete. The signal
   does not drive any load pins in the design.
WARNING:PhysDesignRules:367 - The signal <n1<3>_IBUF> is incomplete. The signal
   does not drive any load pins in the design.
WARNING:PhysDesignRules:367 - The signal <n2<1>_IBUF> is incomplete. The signal
   does not drive any load pins in the design.
WARNING:PhysDesignRules:367 - The signal <n2<2>_IBUF> is incomplete. The signal
   does not drive any load pins in the design.
WARNING:PhysDesignRules:367 - The signal <n2<3>_IBUF> is incomplete. The signal
   does not drive any load pins in the design.
WARNING:Par:288 - The signal n1<1>_IBUF has no load.  PAR will not attempt to route this signal.
WARNING:Par:288 - The signal n1<2>_IBUF has no load.  PAR will not attempt to route this signal.
WARNING:Par:288 - The signal n1<3>_IBUF has no load.  PAR will not attempt to route this signal.
WARNING:Par:288 - The signal n2<1>_IBUF has no load.  PAR will not attempt to route this signal.
WARNING:Par:288 - The signal n2<2>_IBUF has no load.  PAR will not attempt to route this signal.
WARNING:Par:288 - The signal n2<3>_IBUF has no load.  PAR will not attempt to route this signal.
WARNING:Par:283 - There are 6 loadless signals in this design. This design will cause Bitgen to issue DRC warnings.

错误看起来很复杂,但实际上它说,我认为,无法路由我的 n1 和 n2 的其他 3 个输入信号。我不知道为什么会发生这种情况,但我想做的就是将 n1 和 n2 有符号数的总和显示到 7 段显示器中。如果有人能帮助我解决这个问题,我将非常感激。

I am trying to write a VHDL module but I am having some input problems, here is my code:

library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
--use ieee.std_logic_arith.all;
use ieee.std_logic_signed.all;


entity binary_add is
    port( n1 : in std_logic_vector(3 downto 0);
    n2 : in std_logic_vector(3 downto 0);
    segments : out std_logic_vector(7 downto 0);
    DNout : out std_logic_vector(3 downto 0));

end binary_add;

architecture Behavioral of binary_add is
begin

DNout <= "1110";

process(n1, n2)

variable x: integer;


begin

x:= conv_integer(n1(3)&n1(2)&n1(1)&n1(0)) + conv_integer(n2(3)&n2(2)&n2(1)&n2(0));

if(x = "0") then

segments <= "10000001";

elsif(x = "1") then

segments <= "11001111";

else

segments <= "00000000";

end if;

end process;

end Behavioral;

I am getting these errors:

WARNING:PhysDesignRules:367 - The signal <n1<1>_IBUF> is incomplete. The signal
   does not drive any load pins in the design.
WARNING:PhysDesignRules:367 - The signal <n1<2>_IBUF> is incomplete. The signal
   does not drive any load pins in the design.
WARNING:PhysDesignRules:367 - The signal <n1<3>_IBUF> is incomplete. The signal
   does not drive any load pins in the design.
WARNING:PhysDesignRules:367 - The signal <n2<1>_IBUF> is incomplete. The signal
   does not drive any load pins in the design.
WARNING:PhysDesignRules:367 - The signal <n2<2>_IBUF> is incomplete. The signal
   does not drive any load pins in the design.
WARNING:PhysDesignRules:367 - The signal <n2<3>_IBUF> is incomplete. The signal
   does not drive any load pins in the design.
WARNING:Par:288 - The signal n1<1>_IBUF has no load.  PAR will not attempt to route this signal.
WARNING:Par:288 - The signal n1<2>_IBUF has no load.  PAR will not attempt to route this signal.
WARNING:Par:288 - The signal n1<3>_IBUF has no load.  PAR will not attempt to route this signal.
WARNING:Par:288 - The signal n2<1>_IBUF has no load.  PAR will not attempt to route this signal.
WARNING:Par:288 - The signal n2<2>_IBUF has no load.  PAR will not attempt to route this signal.
WARNING:Par:288 - The signal n2<3>_IBUF has no load.  PAR will not attempt to route this signal.
WARNING:Par:283 - There are 6 loadless signals in this design. This design will cause Bitgen to issue DRC warnings.

The errors seems complicated but actually it says, I think, cannot route the other 3 inputs of my n1 and n2 signals. I do not why this is happening but all I want to do is displaying summation of n1 and n2 signed numbers into 7-segment display. If anyone can help me to figure out this issue, I would really appreciate it.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

孤云独去闲 2024-10-07 16:15:55

第一:不要使用 std_logic_arithstd_logic_signed - 我已经

我会将我的端口设为 signed 类型和 使用 ieee.numeric_stdd.all;。或者甚至在输入端口上使用整数类型。如果这是顶级块,您需要放置一个包装器以获取最外层引脚上的 std_logic_vectors,将它们转换为整数并将它们输入到上面编写的块中:

n1 <= to_integer(signed(n1_pins));

然后您需要执行类似的操作...

architecture Behavioral of binary_add is
begin
DNout <= "1110";
process(clk)
  variable x: integer;
begin
  x:= n1+n2;
  case x
    when 0 => segments <= "10000001";
    when 1 => segments <= "11001111";

等等

或者创建一个常量数组将整数转换为7段并执行

segments <= int_to_7seg(x);

First: Don't use std_logic_arith or std_logic_signed - I've written about why not.
Second: you have created an asynchronous process, which is not great practise in FPGAs which are designed for use (and the tools expect you to use) in a synchronous fashion. Create a clock input and use it. You can do it asynchronously, but until you really know what you're doing, avoid it. Once you really know what you're doing, chances are you'll avoid it as well, because you understand how nasty it will be :)

I'd make my ports of signed type and use ieee.numeric_stdd.all;. Or even use the integer type on the input ports. If this is the top-level block, you'll need to put a wrapper around to take std_logic_vectors on the outermost pins, turn them into integers and feed them into the block you've written above:

n1 <= to_integer(signed(n1_pins));

Then you need to do something like this...

architecture Behavioral of binary_add is
begin
DNout <= "1110";
process(clk)
  variable x: integer;
begin
  x:= n1+n2;
  case x
    when 0 => segments <= "10000001";
    when 1 => segments <= "11001111";

etc

Or create a constant array to convert integer to 7-segment and do

segments <= int_to_7seg(x);
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文