首页 > 解决方案 > 是否可以创建 VHDL 别名以包含几个不同的串联 std_logic_vector?

问题描述

别名基本上是某事的替代名称。现在假设我想为一堆这样的东西创建替代名称:

alias myalias : std_logic_vector(7 downto 0) is a(3 downto 0) & b(1 downto 0) & c & d;

这在 VHDL 中是否允许?据我了解,并非如此。

标签: vhdl

解决方案


这不就是一根电线吗?

entity Whatever is port (
  a : in std_logic_vector(32 downto 0);
  b : in std_logic_vector(32 downto 0);
  c : in std_logic,
  d : in std_logic);
end Whatever;

architecture x of Whatever is
  signal myalias : std_logic_vector(7 downto 0);
begin
  myalias <= a(3 downto 0) & b(1 downto 0) & c & d;
end x;

推荐阅读