0

我在 ISE 中创建了一个 VHDL 模块并生成了相应的原理图符号。我希望符号中的总线是可变宽度的,使用原理图布局编辑器中的属性指定。整个项目的 DRC 是可以的,但是当我尝试合成顶层原理图时,它会为我指定为“变量”的每个端口引发错误。我根据此处此处列出的常识和示例建立了这一点。

模块的VHDL:

library IEEE;
use IEEE.STD_LOGIC_1164.ALL;

entity BUS_SWITCHER is
    generic (
        WIDTH : integer := 1 -- Structure
    );

    port (
        A : in STD_LOGIC_VECTOR (WIDTH - 1 downto 0);
        B : in STD_LOGIC_VECTOR (WIDTH - 1 downto 0);
        X : out STD_LOGIC_VECTOR (WIDTH - 1 downto 0);
        Y : out STD_LOGIC_VECTOR (WIDTH - 1 downto 0);
        S : in STD_LOGIC
    );
end BUS_SWITCHER;

architecture Behavioral of BUS_SWITCHER is
begin
    process (A, B, S)
    begin
        if S = '1' then
            X <= B;
            Y <= A;
        else
            X <= A;
            Y <= B;
        end if;
    end process;
end Behavioral;

模块符号(在连接到 4 x 256 宽总线的示意图中):

截图(通过 Imgur)

属性窗口:

截图(通过 Imgur)

错误日志:

ERROR:DesignEntry:20 - Pin "A(0:0)" is connected to a bus of a different width.
ERROR:DesignEntry:20 - Pin "B(0:0)" is connected to a bus of a different width.
ERROR:DesignEntry:20 - Pin "Y(0:0)" is connected to a bus of a different width.
ERROR:DesignEntry:20 - Pin "X(0:0)" is connected to a bus of a different width.
4

1 回答 1

0

当你实例化这个模块时,你需要把它连接到一个std_logic_vector相等的宽度。所以在这种情况下,您的更高级别模块需要创建一个中间信号,即 std_logic_vector(0 downto 0)。如果要将其转换为单个std_logic,可以按如下方式执行:

single_bit <= entire_vector(0);

出于这个原因,我尽量避免长度为 1 的 std_logic_vectors,它们可能会很痛苦。

于 2014-07-17T16:45:26.327 回答