Verilog HDL Single-Clock Synchronous RAM with Two Read
Addresses
module dual_ram_infer (q, q2, write_address,
read_address, read_address2, d, we, clk);
output reg [7:0] q;
output reg [7:0] q2;
input [7:0] d;
input [6:0] write_address;
input [6:0] read_address;
input [6:0] read_address2;
input we, clk;
reg [7:0] mem [127:0];
always @ (posedge clk) begin
if (we)
mem[write_address] <= d;
q <= mem[read_address];
q2 <= mem[read_address2];
end
endmodule
dual port跟single port差不了太多,可以先调通一个port
或者把完整的ip、设计代码及testbench代码发上来,大家可以帮你跑一下 |