-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathinstMem.v
38 lines (29 loc) · 862 Bytes
/
instMem.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
35
36
37
38
module instMem(inst,pc,clk);
input [31:0] pc;
input clk;
output [31:0] inst;
reg [31:0] inst;
reg [31:0] memdata [127:0];
initial
begin
memdata[0] = 32'h8c070003; //first test
memdata[1] = 32'h8c030009;
memdata[2] = 32'h8c060006;
memdata[3] = 32'h00672822;
memdata[4] = 32'h10a70000;
memdata[5] = 32'h01095024;
memdata[6] = 32'h8c020000;
/* memdata[0] = 32'h8c030003; //second test
memdata[1] = 32'h8c070007;
memdata[2] = 32'h8c080008;
memdata[3] = 32'h00e30820;
memdata[4] = 32'h01012820;
memdata[5] = 32'h8c09ffff;
memdata[5] = 32'h00291022;
memdata[5] = 32'hac62000c;*/
end
always @(posedge clk)
begin
inst = memdata[pc];
end
endmodule