-
Notifications
You must be signed in to change notification settings - Fork 0
/
tb_IF.sv
42 lines (38 loc) · 827 Bytes
/
tb_IF.sv
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
// https://edaplayground.com/x/r3zg
module tb_IF(branch_sel_tb, branch_inp_tb, pc_present_tb, inst_tb);
logic branch_sel_tb;
bit clk_tb;
bit reset_tb;
logic [31:0] branch_inp_tb;
logic [31:0] pc_present_tb;
logic [31:0] inst_tb;
IF dut(
.clk(clk_tb),
.reset(reset_tb),
.branch_sel(branch_sel_tb),
.branch_inp(branch_inp_tb),
.pc_present(pc_present_tb),
.inst(inst_tb)
);
always
begin
clk_tb = 0;
#5;
clk_tb = 1;
#5;
end
initial
begin
$dumpfile("dump.vcd");
$dumpvars(0, tb_IF);
reset_tb <= 1;
branch_sel_tb <= 0;
branch_inp_tb <= 0;
#1 reset_tb <= 0;
if (pc_present_tb == 32)
begin
branch_sel_tb <= 1;
branch_inp_tb <= 40;
end
end
endmodule