我正在使用ISE 14.7,我正在尝试用一些1位的分布式RAM块来创建设计。
我的记忆声明:
type tyMemory is array (0 to MEMORY_NUM - 1) of std_logic_vector(MEMORY_SIZE - 1 downto 0) ;
signal Memory: tyMemory := ( others => (others => '0')) ;
attribute ram_style : string ;
attribute ram_style of Memory : signal is "distributed" ;我的代码:
MemoryGen : for i in 0 to MEMORY_NUM - 1 generate
process( CLK )
begin
if rising_edge(CLK) then
if CE = '1' then
DataOut(i) <= Memory(i)(Addr(i)) ;
Memory(i)(Addr(i)) <= DataIn(i) ;
end if ;
end if ;
end process ;
end generate ;合成后我收到这样的警告:
WARNING:Xst:3012 - Available block RAM resources offer a maximum of two write ports.
You are apparently describing a RAM with 16 separate write ports for signal <Memory>.
The RAM will be expanded on registers.我如何才能忘记xst使用size=ARRAY_LENGTH和width=1的分布式内存块?
我可以创建和使用单独的内存组件(和is工作),但我需要更优雅的解决方案。
发布于 2015-07-07 11:11:59
您需要创建一个描述可变长度1位宽内存的实体,然后使用generate语句创建这些变量的数组。虽然您所做的工作将提供您在模拟器中要求的功能,但大多数FPGA工具只会在以特定方式编写代码时提取内存元素。
通过为您的设备选择合适的v6s6.htm文档,您可以找到关于Xilinx工具将作为内存元素理解的代码的文档。看看下面的“HDL编码技术”。
注意,如果您的内存长度很大,如果不添加手动流水线,您将无法从其中获得最大的性能。我认为,如果您的内存超过了分布式内存的预期最大长度,您将得到一条综合消息。假设您使用的是Spartan 6设备,您可以在这里找到有关有用的受支持的分布式内存大小的信息:guides/ug384.pdf页面52。
发布于 2015-07-07 19:27:36
这应该可以推断出16位宽一点的BlockRAM:
architecture ...
attribute ram_style : string;
subtype tyMemory is std_logic_vector(MEMORY_SIZE - 1 downto 0) ;
begin
genMem : for i in 0 to MEMORY_NUM - 1 generate
signal Memory : tyMemory := (others => '0');
attribute ram_style of Memory : signal is "block";
begin
process(clk)
begin
if rising_edge(clk) then
if CE = '1' then
Memory(Addr(i)) <= DataIn(i) ;
DataOut(i) <= Memory(Addr(i)) ;
end if ;
end if ;
end process ;
end generate ;
end architecture;https://stackoverflow.com/questions/31266850
复制相似问题