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

Added SAT-based write-port sharing to memory_share

This commit is contained in:
Clifford Wolf 2014-07-19 15:33:55 +02:00
parent 35edac0b31
commit 297a0962ea
2 changed files with 205 additions and 0 deletions

View file

@ -0,0 +1,25 @@
// expect-wr-ports 1
// expect-rd-ports 1
module test(
input clk,
input wr_en1, wr_en2, wr_en3,
input [3:0] wr_addr1, wr_addr2, wr_addr3,
input [15:0] wr_data,
input [3:0] rd_addr,
output reg [31:0] rd_data
);
reg [31:0] mem [0:15];
always @(posedge clk) begin
if (wr_en1)
mem[wr_addr1][15:0] <= wr_data;
else if (wr_en2)
mem[wr_addr2][23:8] <= wr_data;
else if (wr_en3)
mem[wr_addr3][31:16] <= wr_data;
rd_data <= mem[rd_addr];
end
endmodule