本帖最后由 lover9 于 2010-1-5 16:57 编辑
lpm_ram_dp 参数化双端口 RAM 宏模块
// synopsys translate_off
`timescale 1 ps / 1 ps
// synopsys translate_on
module dpram16k_1to512_32 (
data,
wren,
wraddress,
rdaddress,
wrclock,
rdclock,
wr_aclr,
rd_aclr,
q);
input [0:0] data;
input wren;
input [13:0] wraddress;
input [8:0] rdaddress;
input wrclock;
input rdclock;
input wr_aclr;
input rd_aclr;
output [31:0] q;
wire [31:0] sub_wire0;
wire [31:0] q = sub_wire0[31:0];
altsyncram altsyncram_component (
.wren_a (wren),
.aclr0 (wr_aclr),
.clock0 (wrclock),
.aclr1 (rd_aclr),
.clock1 (rdclock),
.address_a (wraddress),
.address_b (rdaddress),
.data_a (data),
.q_b (sub_wire0)
// synopsys translate_off
,
.addressstall_a (),
.addressstall_b (),
.byteena_a (),
.byteena_b (),
.clocken0 (),
.clocken1 (),
.data_b (),
.q_a (),
.rden_b (),
.wren_b ()
// synopsys translate_on
);
defparam
altsyncram_component.intended_device_family = "Cyclone",
altsyncram_component.operation_mode = "DUAL_PORT",
altsyncram_component.width_a = 1,
altsyncram_component.widthad_a = 14,
altsyncram_component.numwords_a = 16384, //2^14 = 16384
altsyncram_component.width_b = 32,
altsyncram_component.widthad_b = 9,
altsyncram_component.numwords_b = 512, //2^9 = 512
altsyncram_component.lpm_type = "altsyncram",
altsyncram_component.width_byteena_a = 1,
altsyncram_component.outdata_reg_b = "UNREGISTERED",
altsyncram_component.indata_aclr_a = "CLEAR0",
altsyncram_component.wrcontrol_aclr_a = "CLEAR0",
altsyncram_component.address_aclr_a = "CLEAR0",
altsyncram_component.address_reg_b = "CLOCK1",
altsyncram_component.address_aclr_b = "CLEAR1",
altsyncram_component.outdata_aclr_b = "NONE",
altsyncram_component.power_up_uninitialized = "FALSE";
endmodule
// |