Vhdl 合成后仿真中的错误结果

Vhdl 合成后仿真中的错误结果,vhdl,fpga,synthesis,Vhdl,Fpga,Synthesis,我正在用VHDL写一个矩阵转置的代码,我在每一个时钟周期中以行主格式和矩阵的一个元素进行输入,然后以列主格式存储数据,然后在每个时钟周期中以列主格式逐元素发送数据到输出。代码如下所示,正在正确模拟,但合成后的结果不正确。有人能帮助plz合成代码以获得正确的结果吗 library IEEE; use IEEE.STD_LOGIC_1164.ALL; use IEEE.numeric_std.ALL; entity Matrix_Trans_Sysgen is generic(n: integer

我正在用VHDL写一个矩阵转置的代码,我在每一个时钟周期中以行主格式和矩阵的一个元素进行输入,然后以列主格式存储数据,然后在每个时钟周期中以列主格式逐元素发送数据到输出。代码如下所示,正在正确模拟,但合成后的结果不正确。有人能帮助plz合成代码以获得正确的结果吗

library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.numeric_std.ALL;

entity Matrix_Trans_Sysgen is
generic(n: integer :=3);
port (my_clk : in std_logic;
my_ce : in std_logic;
input_matrix : in std_logic_vector(5 downto 0);
output_matrix : out std_logic_vector(5 downto 0)
);
end Matrix_Trans_Sysgen;

architecture Behavioral of Matrix_Trans_Sysgen is

type t1 is array (natural range<>) of std_logic_vector(5 downto 0);

signal a : t1((n*n)-1 downto 0) :=(others => (others =>'0'));

signal output_there : std_logic :='0';

signal x : integer range 0 to 2*n :=0;
signal y : integer range 0 to 2*n :=0;
signal z : integer range 0 to 2*n*n :=0;

begin

----- Process to take all input_matrix into array
process(my_clk,input_matrix,x,y)
begin

if(x < n) then

    if(y < n) then
       if(rising_edge(my_clk)) then 
          a(y*n+x) <= input_matrix;
          y <= y+1;
       end if;
    else
      x<=x+1;
      y<=0;
    end if;
  else
    output_there <= '1';

end if;
end process;


----- Process to send all output elements through port
process(my_clk,z,output_there)
begin

if (output_there = '1') then

    if(z < n*n) then


      if(rising_edge(my_clk)) then


         output_matrix <= a(z);
         z<=z+1;

      end if;

    end if;

end if;

end process;

end Behavioral;
IEEE库;
使用IEEE.STD_LOGIC_1164.ALL;
使用IEEE.numeric_std.ALL;
实体矩阵\u Trans\u Sysgen为
泛型(n:整数:=3);
端口(我的时钟:在标准逻辑中;
我的ce:标准逻辑;
输入矩阵:标准逻辑向量(5到0);
输出矩阵:输出标准逻辑向量(5到0)
);
端矩阵转换系统;
矩阵转换系统的体系结构是
t1型是std_逻辑_向量(5到0)的数组(自然范围);
信号a:t1((n*n)-1向下至0):=(其他=>(其他=>'0');
那里的信号输出:标准逻辑:='0';
信号x:整数范围0到2*n:=0;
信号y:整数范围0到2*n:=0;
信号z:整数范围0到2*n*n:=0;
开始
-----将所有输入矩阵放入数组的过程
过程(我的时钟,输入矩阵,x,y)
开始
如果(xa(y*n+x)使用时钟进程的常用模板重写它。也就是说,用

如果上升沿(clk),则…”

过程中最外层的。合成工具寻找这个构造并正确处理它;其他形式的过程可能会混淆工具