-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrf_test.v
50 lines (47 loc) · 870 Bytes
/
rf_test.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
39
40
41
42
43
44
45
46
47
48
49
50
`timescale 1ps/1ps
module RF_TEST();
reg clk = 0;
reg rst = 0;
initial begin
forever begin
clk <= ~clk;
#5;
end
end
reg we3;
reg [4:0] a1, a2, a3;
reg [31:0] wd3;
wire[31:0] rd1, rd2;
regfile DUT(clk, rst, we3, a1, a2, a3, wd3, rd1, rd2);
initial begin
$dumpfile("rf_test_dump.vcd");
$dumpvars;
//reset
rst = 1;
a1 = 0;
a2 = 0;
a3 = 0;
we3 = 0;
#20;
rst = 0;
a3 = 0;
we3 = 1;
wd3 = 32'hFFFFFFFF;
#10;
a3 = 8;
we3 = 1;
wd3 = 32'hFFFFFFFF;
#10;
a1 = 8;
a2 = 8;
we3 = 0;
#10;
a3 = 10;
we3 = 1;
wd3 = 32'hFFFFFFFF;
#3;
rst = 1;
#7;
$finish;
end
endmodule