-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_control_unit.v
More file actions
66 lines (56 loc) · 1.24 KB
/
test_control_unit.v
File metadata and controls
66 lines (56 loc) · 1.24 KB
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
`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Assignment 7
//
//Group No.42
//Members: Seemant Guruprasad Achari 19CS10055
// Chappidi Yoga Satwik 19CS30013
//
// This is the testbench for the Control Unit
//
//////////////////////////////////////////////////////////////////////////////////
module control_test;
// Inputs
reg [5:0] opCode;
reg [7:0] functCode;
// Outputs
wire CondBr;
wire RegBr;
wire UncondBr;
wire MemRead;
wire MemWrite;
wire WriteReg;
wire ALUSrc;
wire [1:0] WriteSrc;
wire RegDst;
wire [1:0] UncondControl;
wire [1:0] CondControl;
wire [2:0] ALUOp;
// Instantiate the Unit Under Test (UUT)
control_unit uut (
.CondBr(CondBr),
.RegBr(RegBr),
.UncondBr(UncondBr),
.MemRead(MemRead),
.MemWrite(MemWrite),
.WriteReg(WriteReg),
.ALUSrc(ALUSrc),
.WriteSrc(WriteSrc),
.RegDst(RegDst),
.UncondControl(UncondControl),
.CondControl(CondControl),
.ALUOp(ALUOp),
.opCode(opCode),
.functCode(functCode)
);
initial begin
// Initialize Inputs
opCode = 0;
functCode = 0;
// Wait 100 ns for global reset to finish
#100;
opCode = 6'b001000;
functCode = 8'b001000000;
// Add stimulus here
end
endmodule