芯片:SPARTAN-6 45T 3速 FGG484封装
软件:ISE13.1
原来的一个项目,在实际的电路板上工作正常。使用了多个简单的DPRAM,分别调用如下VHDL代码:
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
entity dpram_w_r is
generic (
ADDR_WIDTH : integer := 11;
DATA_WIDTH : integer := 8
);
port (
clka : in std_logic;
ena : in std_logic;
wea : in std_logic;
addra : in std_logic_vector(ADDR_WIDTH-1 downto 0);
dina : in std_logic_vector(DATA_WIDTH-1 downto 0);
clkb : in std_logic;
enb : in std_logic;
addrb : in std_logic_vector(ADDR_WIDTH-1 downto 0);
doutb : out std_logic_vector(DATA_WIDTH-1 downto 0)
);
end dpram_w_r;
architecture rtl of dpram_w_r is
type ram_type is array(2**ADDR_WIDTH-1 downto 0) of std_logic_vector(DATA_WIDTH-1 downto 0);
signal ram : ram_type;
attribute syn_ramstyle : string;
attribute syn_ramstyle of ram : signal is "no_rw_check" ;
begin
-- dual port block ram inference
process (clka)
begin
if rising_edge(clka) then
if ena = '1' then
if wea = '1' then
ram(to_integer(unsigned(addra))) <= dina;
end if;
end if;
end if;
end process;
process (clkb)
begin
if rising_edge(clkb) then
if enb = '1' then
doutb <= ram(to_integer(unsigned(addrb)));
end if;
end if;
end process;
end rtl;
(1)在ISE13.1下,改变综合器的一个参数:将ram style从auto改为block,重新编译以后,下载到电路板中,工作不正常。
(2)将上面代码中的attribute syn_ramstyle of ram : signal is "no_rw_check" ;
改为attribute syn_ramstyle of ram : signal is "block_ram" ;
重新编译以后,下载到电路板中,工作不正常。
晕倒
请大侠赐教 |