-
Notifications
You must be signed in to change notification settings - Fork 23
/
tb_register.v
executable file
·65 lines (46 loc) · 1.06 KB
/
tb_register.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
module register_test;
reg[3:0] read_address;
reg[3:0] write_address;
reg[31:0] write_data;
reg write_enable = 0;
reg[31:0] pc_update;
reg pc_write;
reg clk;
wire[31:0] out_data_1;
wire[31:0] cspr;
wire[31:0] pc;
register_file RegisterFile( //inputs
.in_address1(read_address),
.in_address2(),
.in_address3(),
.in_address4(write_address),
.universal_read_address(),
.in_data(write_data),
.write_enable(write_enable),
.pc_update(pc_update),
.pc_write(pc_write),
.cspr_write(),
.cspr_update(),
.clk(clk),
//outputs
.out_data1(out_data_1),
.out_data2(),
.out_data3(),
.universal_out_data(),
.pc(pc),
.cspr(cspr)
);
initial begin
#1 clk = 1;
#2 clk = 0;
#3 clk = 1;
read_address = 0;
#4 clk = 0;
$display("pc- %h" , pc);
#5 clk = 1;
pc_update = pc+4;
pc_write = 1;
#6 clk = 0;
$display("pc %h", pc);
end
endmodule