3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-08-07 03:31:24 +00:00

Bugfix and improvements in memory_share

This commit is contained in:
Clifford Wolf 2016-04-21 12:06:07 +02:00
parent bf64974d43
commit 1761d08dd2
2 changed files with 40 additions and 22 deletions

View file

@ -243,3 +243,24 @@ module memtest10(input clk, input [5:0] din, output [5:0] dout);
assign dout = queue[3];
endmodule
// ----------------------------------------------------------
module memtest11(clk, wen, waddr, raddr, wdata, rdata);
input clk, wen;
input [1:0] waddr, raddr;
input [7:0] wdata;
output [7:0] rdata;
reg [7:0] mem [3:0];
assign rdata = mem[raddr];
always @(posedge clk) begin
if (wen)
mem[waddr] <= wdata;
else
mem[waddr] <= mem[waddr];
end
endmodule