求救!BRAM数据读出现随机错误。
时间:10-02
整理:3721RD
点击:
大家好, 我有个项目在XINLINX 的Artix100T上运行,开发板为Digilent公司的nexys 4。发现有个BRAM读数据出现随机性错误,甚至对同一地址反复读都是同一错误数据,好像BRAM数据被篡改一样, 读写时钟为50MHz。时序报告*.twx 对该BRAM接口无任何异常报告。 这个问题已经困扰我好长时间了,测量VCCINT 和VCCBRAM都在合理范围,相问问各位大侠有又没有遇到类似情况?问题应该从那里下手?谢谢(如果能有高手解决,有酬谢)!
附上BRAM的VHDL代码:
entity BlockRAM_SDP is
generic(MemDepth : integer := 2048;
AddrBusWidth:integer:= 11;
DataBusWidth: integer := 16);
Port (
Clk : in STD_LOGIC;
CE: in STD_LOGIC;
Read_Addr : in STD_LOGIC_VECTOR ((AddrBusWidth - 1) downto 0);
Read_Data : out STD_LOGIC_VECTOR ((DataBusWidth - 1) downto 0);
Write_Addr : in STD_LOGIC_VECTOR ((AddrBusWidth - 1) downto 0);
Write_Data : in STD_LOGIC_VECTOR ((DataBusWidth - 1) downto 0);
Write_En : in STD_LOGIC
);
end BlockRAM_SDP;
--read first model
architecture Behavioral of BlockRAM_SDP is
TYPE BRAMDataVector is array (natural range <>) of STD_LOGIC_VECTOR ((DataBusWidth - 1) downto 0);
signal Memory : BRAMDataVector(0 to (MemDepth - 1)) := (others => (others=>'0'));
begin
Process(Clk)
begin
if(Clk'event and Clk = '1') then
if(CE = '1') then
Read_Data <= Memory(conv_integer(Read_Addr));
if(Write_En = '1') then
Memory(conv_integer(Write_Addr)) <= Write_Data;
end if;
end if;
end if;
end process;
end Behavioral;
附上BRAM的VHDL代码:
entity BlockRAM_SDP is
generic(MemDepth : integer := 2048;
AddrBusWidth:integer:= 11;
DataBusWidth: integer := 16);
Port (
Clk : in STD_LOGIC;
CE: in STD_LOGIC;
Read_Addr : in STD_LOGIC_VECTOR ((AddrBusWidth - 1) downto 0);
Read_Data : out STD_LOGIC_VECTOR ((DataBusWidth - 1) downto 0);
Write_Addr : in STD_LOGIC_VECTOR ((AddrBusWidth - 1) downto 0);
Write_Data : in STD_LOGIC_VECTOR ((DataBusWidth - 1) downto 0);
Write_En : in STD_LOGIC
);
end BlockRAM_SDP;
--read first model
architecture Behavioral of BlockRAM_SDP is
TYPE BRAMDataVector is array (natural range <>) of STD_LOGIC_VECTOR ((DataBusWidth - 1) downto 0);
signal Memory : BRAMDataVector(0 to (MemDepth - 1)) := (others => (others=>'0'));
begin
Process(Clk)
begin
if(Clk'event and Clk = '1') then
if(CE = '1') then
Read_Data <= Memory(conv_integer(Read_Addr));
if(Write_En = '1') then
Memory(conv_integer(Write_Addr)) <= Write_Data;
end if;
end if;
end if;
end process;
end Behavioral;
可以考虑调用BRAM IP core试试。
