VHDL有没有办法制作一系列组件?

Is there a way in VHDL to make a series of components?

简单地说,我有一个组件“X”,我想将其中的24个连接成一排;显然意味着一个的输出是下一个的输入;我可以自己用复制粘贴和 link 编写它们,但我想知道是否有办法优雅地做到这一点。

我知道指令 for I in N downto 0 generate 但我认为我不能用它来创建串联组件,它只能并行创建组件,其中每个组件对 [=11 的不同值起作用=] 参数,或不是 ?

generate 语句正是您所需要的。例如,如果您的 X 组件有一个输入 a 和一个类型为 bit 的输出 b

entity bar is
end entity bar;

architecture rtl of bar is
  signal c: bit_vector(0 to 24);
  component x is
    port(
      a: in  bit;
      b: out bit
    );
  end component x;
begin
  u0: for i in 0 to 23 generate
    x0: x
    port map(
      a => c(i),
      b => c(i+1)
    );
  end generate u0;
end architecture rtl;

第一个 X 实例的输入是 c(0),最后一个实例的输出是 c(24)