【发布时间】:2013-04-02 09:10:58
【问题描述】:
我有一个 VHDL 设计问题。 我有 N 个相似的实体,它们接受一些输入,每个实体都生成 STD_LOGIC 输出。
例子:
entity example1 is
begin
...
result_1 : out std_logic;
end example1;
entity example2 is
begin
...
result_2 : out std_logic;
end example2;
...
我正在寻找一种方法将所有这些单个位结果聚合为一个 UNSIGNED(N - 1 downto 0) 结果信号 V,使得 V(i) = result_i 成立。
目前,我的方法是这样的:
entity ResultAggregation is
port (
result_1 : in std_logic;
result_2 : in std_logic;
aggregate_results : out unsigned(1 downto 0)
);
end ResultAggregation;
architecture Behavioral of ResultAggregation is
begin
aggregate_results <= result_2 & result_1;
end Behavioral;
我觉得这种方法相当笨拙。我正在寻找的是一个更自动化的解决方案, 例如,我可以提供数字 N 以便生成适当的引脚。
我知道这是一个相当笼统的问题,但如果有人知道一个聪明的解决方案,请 告诉我。
提前致谢,
斯文
【问题讨论】: