mirror of
https://github.com/YosysHQ/yosys
synced 2025-08-04 10:20:24 +00:00
Added Xilinx test case for initialized brams
This commit is contained in:
parent
4389d9306e
commit
d19866615b
4 changed files with 80 additions and 0 deletions
24
techlibs/xilinx/tests/bram2.v
Normal file
24
techlibs/xilinx/tests/bram2.v
Normal file
|
@ -0,0 +1,24 @@
|
|||
module myram(
|
||||
input rd_clk,
|
||||
input [ 7:0] rd_addr,
|
||||
output reg [15:0] rd_data,
|
||||
input wr_clk,
|
||||
input wr_enable,
|
||||
input [ 7:0] wr_addr,
|
||||
input [15:0] wr_data
|
||||
);
|
||||
reg [15:0] memory [0:255];
|
||||
integer i;
|
||||
|
||||
initial begin
|
||||
for (i = 0; i < 256; i = i+1)
|
||||
memory[i] = i;
|
||||
end
|
||||
|
||||
always @(posedge rd_clk)
|
||||
rd_data <= memory[rd_addr];
|
||||
|
||||
always @(posedge wr_clk)
|
||||
if (wr_enable)
|
||||
memory[wr_addr] <= wr_data;
|
||||
endmodule
|
Loading…
Add table
Add a link
Reference in a new issue