initial
[fpgammix.git] / rtl / Icarus / progmem.v
blobf910a8fbfee42deaccb83fbde80a40de6afccdbe
1 // -----------------------------------------------------------------------
2 //
3 // Copyright 2004 Tommy Thorn - All Rights Reserved
4 //
5 // This program is free software; you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation, Inc., 53 Temple Place Ste 330,
8 // Bostom MA 02111-1307, USA; either version 2 of the License, or
9 // (at your option) any later version; incorporated herein by reference.
11 // -----------------------------------------------------------------------
13 `timescale 1ns/10ps
15 module progmem(input wire clock,
16 input wire rden,
17 input wire [6:0] rdaddress,
18 input wire [6:0] wraddress,
19 input wire wren,
20 input wire [31:0] data,
21 output wire [31:0] q);
23 reg [ 6:0] addr_delayed;
24 reg [31:0] ram[(1<<7) - 1:0];
26 assign q = ram[addr_delayed];
28 always @(posedge clock)
29 if (rden)
30 addr_delayed <= rdaddress;
33 initial
34 $readmemh("initmem.data", ram);
35 endmodule