mirror of
https://github.com/YosysHQ/yosys
synced 2025-08-20 18:20:26 +00:00
Added support for initialized xilinx brams
This commit is contained in:
parent
169d1c4711
commit
8520b7fbe0
11 changed files with 313 additions and 90 deletions
|
@ -1,18 +1,29 @@
|
|||
module myram(
|
||||
input rd_clk,
|
||||
input [ 7:0] rd_addr,
|
||||
output reg [15:0] rd_data,
|
||||
output reg [17:0] rd_data,
|
||||
input wr_clk,
|
||||
input wr_enable,
|
||||
input [ 7:0] wr_addr,
|
||||
input [15:0] wr_data
|
||||
input [17:0] wr_data
|
||||
);
|
||||
reg [15:0] memory [0:255];
|
||||
reg [17:0] memory [0:255];
|
||||
integer i;
|
||||
|
||||
function [17:0] hash(input [7:0] k);
|
||||
reg [31:0] x;
|
||||
begin
|
||||
x = {k, ~k, k, ~k};
|
||||
x = x ^ (x << 13);
|
||||
x = x ^ (x >> 17);
|
||||
x = x ^ (x << 5);
|
||||
hash = x;
|
||||
end
|
||||
endfunction
|
||||
|
||||
initial begin
|
||||
for (i = 0; i < 256; i = i+1)
|
||||
memory[i] = i;
|
||||
memory[i] = hash(i);
|
||||
end
|
||||
|
||||
always @(posedge rd_clk)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue