1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
|
// A memory initialized with an external file module memory ( input clk_i, input we_i, input [5:0] addr_i, input [31:0] data_i, output reg [31:0] data_o ); parameter MEMFILE = ""; reg [31:0] mem [0:63]; initial $readmemb(MEMFILE,mem); always @(posedge clk_i) begin if (we_i) mem[addr_i] <= data_i; data_o <= mem[addr_i]; end endmodule anaceas.org/openwrt/upstream' title='openwrt/upstream Git repository'/>