我有一個VHDL設計問題。 我有N個相似的實體需要一些輸入,他們每個產生一個STD_LOGIC輸出 。VHDL位聚合
實施例:
entity example1 is
begin
...
result_1 : out std_logic;
end example1;
entity example2 is
begin
...
result_2 : out std_logic;
end example2;
...
我正在尋找一種方法來聚集所有在一個UNSIGNED那些單個位結果 - 使得V(I)= result_i保持結果信號V(N 1 DOWNTO 0)。
目前,我的做法是這樣的:
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,以便生成適當的引腳。
我知道這是一個相當普遍的問題,但如果有人知道一個聰明的解決方案,請 告訴我。
由於提前,
斯文