mirror of
https://github.com/YosysHQ/yosys
synced 2025-08-10 21:20:53 +00:00
Add memory_libmap tests.
This commit is contained in:
parent
2a2dc12eb6
commit
982a11c709
22 changed files with 1500 additions and 0 deletions
25
tests/memlib/memlib_wide_read.v
Normal file
25
tests/memlib/memlib_wide_read.v
Normal file
|
@ -0,0 +1,25 @@
|
|||
module RAM_WIDE_READ #(
|
||||
parameter [63:0] INIT = 64'hx,
|
||||
parameter PORT_A_RD_WIDTH = 8,
|
||||
parameter PORT_A_WR_WIDTH = 2
|
||||
) (
|
||||
input PORT_A_CLK,
|
||||
input PORT_A_RD_EN,
|
||||
input [5:0] PORT_A_ADDR,
|
||||
output reg [7:0] PORT_A_RD_DATA,
|
||||
input PORT_A_WR_EN,
|
||||
input [1:0] PORT_A_WR_DATA
|
||||
);
|
||||
|
||||
reg [63:0] mem;
|
||||
|
||||
initial mem = INIT;
|
||||
|
||||
always @(posedge PORT_A_CLK) begin
|
||||
if (PORT_A_RD_EN)
|
||||
PORT_A_RD_DATA <= mem[{PORT_A_ADDR[5:3], 3'b000}+:8];
|
||||
if (PORT_A_WR_EN)
|
||||
mem[{PORT_A_ADDR[5:1],1'b0}+:2] <= PORT_A_WR_DATA;
|
||||
end
|
||||
|
||||
endmodule
|
Loading…
Add table
Add a link
Reference in a new issue