简体   繁体   English

我们可以合成一个简单的通用内存吗?

[英]Can we synthesis a simple generic memory?

I'm trying to synthesis with simple generic memory model within design compiler. 我正在尝试在设计编译器中使用简单的通用内存模型进行综合。

but I do find that some error messages as the below, 但我确实发现了以下一些错误消息,

and I used the simple generic memory model as the below 我使用了如下的简单通用内存模型

module RAM_generic
 (clk,
 enb,
 wr_din,
 wr_addr,
 wr_en,
 rd_addr,
 rd_dout);

 parameter AddrWidth = 1;
 parameter DataWidth = 1;

 input clk;
 input enb;
 input signed [DataWidth - 1:0] wr_din;
 input [AddrWidth - 1:0] wr_addr;
 input wr_en;
 input [AddrWidth - 1:0] rd_addr;
 output signed [DataWidth - 1:0] rd_dout;

 reg [DataWidth - 1:0] ram [2**AddrWidth - 1:0];
 reg [DataWidth - 1:0] data_int;


 always @(posedge clk)
 begin
 if (enb == 1'b1) begin
 if (wr_en == 1'b1) begin
 ram[wr_addr] <= wr_din;
 end
 data_int <= ram[rd_addr];
 end
 end

 assign rd_dout = data_int;
endmodule

I want to know Can't we synthesis a simple generic memory? 我想知道我们不能合成一个简单的通用内存吗? If yes, What am I supposed to do to synthesis the generic memory synthesis error? 如果是,我应该怎么做以综合通用内存综合错误?

Yes you can. 是的你可以。

In FPGA's a single or dual ported memory will be mapped on the internal memory structures. 在FPGA中,单端口或双端口存储器将映射到内部存储器结构上。 (At least if you use the right syntax! Look for the FPGA application notes how to do that) (至少如果您使用正确的语法!请查找FPGA应用笔记中的操作方法)

In an ASIC it will be made from registers. 在ASIC中,它将由寄存器组成。 I needed a small triple ported memory (Two read and a write port all simultaneous) a few years back and it came out fine. 几年前,我需要一个很小的三端口内存(两个读和一个写端口同时进行),结果还不错。 Most FIFO's have a memory in them and 90% of them are made from registers. 大多数FIFO中都有一个存储器,其中90%由寄存器组成。

Your code is missing 'endmodule'. 您的代码缺少“ endmodule”。 I don't spot any other obvious errors. 我没有发现其他明显的错误。

Some tips: 一些技巧:

  • Using ((1 << AddrWidth) -1) will also work in old fashion Verilog. 使用((1 << AddrWidth)-1)也可以在老式Verilog中使用。
  • I would not use a default width/depth of 1 for a memory. 我不会为内存使用默认的宽度/深度1。 You get [0:0] constructs which work, but why should you if eg 8x8 is more likely to be used. 您将获得[0:0]的构造有效,但是如果更可能使用例如8x8,为什么还要这样做。
  • A generic memory should not be signed. 通用内存不应签名。 By convention a generic memory is unsigned. 按照约定,通用内存是无符号的。
  • Parameters are by convention all uppercase. 按照惯例,参数均为大写。 (At least in every firm I worked it was) (至少在我工作的每个公司都是)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM