Vector 向量传递

Vector 向量传递,vector,vhdl,Vector,Vhdl,我想把一个值从一个向量传递到另一个向量。 我可以这样做吗 vector_one : out STD_LOGIC_VECTOR (3 downto 0); vector_two : out STD_LOGIC_VECTOR (3 downto 0); vector_one <= vector_two; vector\u one:out标准逻辑向量(3到0); 向量2:输出标准逻辑向量(3到0); vector_onevector_one是一个输出端口(模式输出),VHDL-2008允许读

我想把一个值从一个向量传递到另一个向量。 我可以这样做吗

vector_one : out STD_LOGIC_VECTOR (3 downto 0);
vector_two : out STD_LOGIC_VECTOR (3 downto 0);

vector_one <= vector_two;
vector\u one:out标准逻辑向量(3到0);
向量2:输出标准逻辑向量(3到0);

vector_onevector_one
是一个输出端口(模式
输出
),VHDL-2008允许读取该端口,因此您可以执行以下操作:

vector_one <= vector_two;

一般情况下,应避免复制这样的输出信号,因为从该模块的使用来看,不明显的是某些输出是用相同的值驱动的,这使得理解模块的使用变得更加困难。

您可以,但需要注意的是,如果您需要在模块中使用vector_one,则在其被外部使用之前,意味着模块将需要保存有关它的信息。然后,您需要声明一个内部信号才能处理它

例如:

entity exampleModule is 
port( iClk : in STD_LOGIC;
      iTrigger    : in STD_LOGIC;
      iVector_one : out STD_LOGIC_VECTOR (3 downto 0);
      oVector_two : out STD_LOGIC_VECTOR (3 downto 0));
end exampleModule ;

Architecture RTL of exampleModule is
    signal mVectorBuff : std_logic_vector (3 downto 0);
begin 
    process (iClk) begin
       if rising_edge (iClk) then
           if iTrigger then mVectorBuff <= iVector_one;
           end if;
       end if; 
    end process;

    oVector_two <= mVector_one;
end Architecture RTL;
实体示例模块为
端口(iClk:标准逻辑中;
iTrigger:标准逻辑中;
iVector_一:输出标准逻辑向量(3到0);
输出标准逻辑向量(3到0);
结束示例模块;
exampleModule的体系结构RTL是
信号mVectorBuff:std_逻辑_向量(3到0);
开始
进程(iClk)开始
如果上升沿(iClk),则

如果iTrigger那么mVectorBuff取决于你所说的“通过”是什么意思。这样做将把你的
vector\u two
路由到你的
vector\u one
,从而无条件地“复制”所有数据。这就是我想要的:)
entity exampleModule is 
port( iClk : in STD_LOGIC;
      iTrigger    : in STD_LOGIC;
      iVector_one : out STD_LOGIC_VECTOR (3 downto 0);
      oVector_two : out STD_LOGIC_VECTOR (3 downto 0));
end exampleModule ;

Architecture RTL of exampleModule is
    signal mVectorBuff : std_logic_vector (3 downto 0);
begin 
    process (iClk) begin
       if rising_edge (iClk) then
           if iTrigger then mVectorBuff <= iVector_one;
           end if;
       end if; 
    end process;

    oVector_two <= mVector_one;
end Architecture RTL;