Vhdl 两个进程的同步

Vhdl 两个进程的同步,vhdl,Vhdl,我的体系结构使用平方根组件,该组件具有以下端口: component SQRT is port (sqrt_clock : in std_logic; start : in std_logic; value : in std_logic_vector (15 downto 0); result : out std_logic_vector (7 downto 0); busy

我的体系结构使用平方根组件,该组件具有以下端口:

component SQRT is
    port (sqrt_clock : in  std_logic;
          start      : in  std_logic;
          value      : in  std_logic_vector (15 downto 0);
          result     : out std_logic_vector (7 downto 0);
          busy       : out std_logic
          );
  end component;
当sqrt模块完成其工作时,忙信号将为“0”

在我的主要过程中,我迭代一个输入数组并计算两个整数a和b,它们是平方根模块的输入。然后,我想用输出文件填充第二个数据数组,其数组大小与输入数组相同

Main_Process: process(clk)
  variable a : integer := 0;
  variable b : integer := 0;
begin
if reset = '0'then
...
elsif clk'event and clk = '1' then
for iter in 0 to arraySize-1 loop
 -- x and y calculation with inputarray(iter)
   value      <= std_logic_vector(TO_UNSIGNED(a+b, 16));
   start      <= '1';
   outputarray(iter) <= TO_INTEGER(unsigned(sqrt_output)); 
end loop;     
end case;
end process;
Main_进程:进程(clk)
变量a:整数:=0;
变量b:整数:=0;
开始
如果重置='0',则
...
elsif clk'事件和clk='1'则
国际热核实验堆0至1回路阵列化
--带输入阵列的x和y计算(iter)

值在简化的示例中,您不需要main的时钟信号,因此可以删除灵敏度列表

wait until busy = '0'
outputarray(iter) <= TO_INTEGER(unsigned(sqrt_output)); 
start <= '0';

不幸的是,你不能将等待语句放在敏感列表的流程中,这就是为什么答案说“删除敏感列表”@BrianDrummond他的评论是在我编辑答案之前。我的错在那里。
wait until busy = '0'
outputarray(iter) <= TO_INTEGER(unsigned(sqrt_output)); 
start <= '0';
variable iter : integer range 0 to arraySize;

variable first : boolean;

[...]
iter := 0;
first := true;
while iter < arraySize loop
   if busy = '0' then
      if first = false then          
        outputarray(iter) <= TO_INTEGER(unsigned(sqrt_output)); 
        start <= '0';
      end if

 -- x and y calculation with inputarray(iter)
   value      <= std_logic_vector(TO_UNSIGNED(a+b, 16));
   start      <= '1';

   first := false;
   iter := iter + 1;

   end if
end loop;