-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfinal_test.v
68 lines (60 loc) · 1.21 KB
/
final_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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
`timescale 1ns / 1ps
//GroupID-14 (15116073_15116037)-Vipul Gupta & Nitin Sethi
//Date:28th October 2016
//Register file + ALU module calling
module final_test;
// Inputs
reg [7:0] inreg1;
reg [7:0] inreg2;
reg [1:0] opcode;
// Outputs
wire [7:0] store_word;
wire [7:0] store_inp1;
wire carry_output;
wire overflow_output;
reg clk=0;
// Instantiate the Unit Under Test (UUT)
register_file uut (
.inreg1(inreg1),
.inreg2(inreg2),
.opcode(opcode),
.store_word(store_word),
.store_inp1(store_inp1),
.carry_output(carry_output),
.overflow_output(overflow_output)
);
always begin
#5 clk =0;
#5 clk =1;
end
initial begin
// Initialize Inputs
inreg1 = 0;
inreg2 = 0;
opcode = 0;
// changes only at positive edge of the clock
//test bench created and tested
// Wait 100 ns for global reset to finish
#27;
inreg1 = 1;
inreg2 = 1;
opcode = 0;
#27 opcode = 1;
#27 opcode = 2;
#27 opcode = 3;
#27
inreg1 = 127;
inreg2 = 10;
opcode = 0;
#27 opcode = 1;
#27 opcode = 2;
#27 opcode = 3;
#27
inreg1 = 12;
inreg2 = -10;
opcode = 0;
#27 opcode = 1;
#27 opcode = 2;
#27 opcode = 3;
end
endmodule