-
Notifications
You must be signed in to change notification settings - Fork 2
/
mem.v
34 lines (28 loc) · 875 Bytes
/
mem.v
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
// Class: CSCI 401 Computer Architecture
// Term: SPR11
// Name(s):
//
// Lab #1: Instruction Fetch Stage
// -*- Mode: Verilog -*-
// Filename : mem.v
// Description : The instruction memory module
// of the IF stage of the pipeline
// Authors : George M. Georgiou and Scott McWilliams
// Created On : 2/06/2003
// Modified On : 4/5/2011
// Modified By : Jason Fredrick and David Sturgeon
module memory (
output reg [31:0] data, // Output of Instruction Memory
input wire [31:0] addr // Input of Instruction Memory
);
// Register Declarations
reg [31:0] MEM[0:127]; // 128 words of 32-bit memory
integer i;
// Initialize Registers
initial begin
$readmemb("etc/risc.txt",MEM);
end
always @(addr) begin
data <= MEM[addr];
end
endmodule // memory