-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMemory_Fixture.v
More file actions
67 lines (59 loc) · 742 Bytes
/
Memory_Fixture.v
File metadata and controls
67 lines (59 loc) · 742 Bytes
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
`include "Memory.v"
module Module_Fixture;
wire [7:0] B;
wire [15:0] W;
reg [15:0]A;
reg [15:0]WW;
reg [7:0]WB;
reg [1:0]MW;
reg C;
reg R;
initial
$vcdpluson;
initial
$monitor($time," Input W = %h, Input B = %h, Address = %h, Output W = %h, Output B = %h, ctrl = %b", WW, WB, A, W, B, MW);
Memory a1(B,W,A,WW,WB,MW,C,R);
initial
begin
R=0;
#10;
R=1;
//lw
MW=2'b00;
A=16'h0006;
#10;
//lw
A=16'h0008;
#10;
//sb
MW=2'b01;
A=16'h0000;
WB=8'h0F;
#10;
//lb
MW=2'b00;
A=16'h0000;
#10;
//sw
MW=2'b10;
A=16'h0006;
WW=16'h000A;
#10;
//lw
MW=2'b00;
A=16'h0006;
#10;
//lb
MW=2'b00;
A=16'h0000;
end
initial
begin
C = 1'b0;
forever #10 C = ~C;
end
initial
begin
#100 $finish;
end
endmodule