-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpipe_EX_test.v
103 lines (93 loc) · 1.76 KB
/
pipe_EX_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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
`timescale 1ns / 1ps
////////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer:
//
// Create Date: 12:51:47 04/19/2016
// Design Name: pipe_EX
// Module Name: E:/xilin_project/sccpu/pipe_EX_test.v
// Project Name: sccpu
// Target Device:
// Tool versions:
// Description:
//
// Verilog Test Fixture created by ISE for module: pipe_EX
//
// Dependencies:
//
// Revision:
// Revision 0.01 - File Created
// Additional Comments:
//
////////////////////////////////////////////////////////////////////////////////
module pipe_EX_test;
// Inputs
reg IDwreg;
reg IDm2reg;
reg IDwmem;
reg [3:0] IDaluc;
reg IDshift;
reg IDaluimm;
reg [4:0] IDwn;
reg [31:0] IDqa;
reg [31:0] IDqb;
reg [31:0] IDimmeOrSa;
reg clk;
reg clrn;
// Outputs
wire EXwreg;
wire EXm2reg;
wire EXwmem;
wire [4:0] EXwn;
wire [31:0] EXaluResult;
wire [31:0] EXdi;
// Instantiate the Unit Under Test (UUT)
pipe_EX uut (
.IDwreg(IDwreg),
.IDm2reg(IDm2reg),
.IDwmem(IDwmem),
.IDaluc(IDaluc),
.IDshift(IDshift),
.IDaluimm(IDaluimm),
.IDwn(IDwn),
.IDqa(IDqa),
.IDqb(IDqb),
.IDimmeOrSa(IDimmeOrSa),
.clk(clk),
.clrn(clrn),
.EXwreg(EXwreg),
.EXm2reg(EXm2reg),
.EXwmem(EXwmem),
.EXwn(EXwn),
.EXaluResult(EXaluResult),
.EXdi(EXdi)
);
always #50 clk = ~clk;
initial begin
// Initialize Inputs
IDwreg = 0;
IDm2reg = 0;
IDwmem = 0;
IDaluc = 0;
IDshift = 0;
IDaluimm = 0;
IDwn = 0;
IDqa = 0;
IDqb = 0;
IDimmeOrSa = 0;
clk = 1;
clrn = 0;
// Wait 100 ns for global reset to finish
#50;
clrn = 1;
#50;
IDaluc = 4'b0000;
IDqa = 32'h0002;
IDqb = 32'h0003;
#100;
IDaluc = 4'b0000;
IDqa = 32'h0004;
IDqb = 32'h0007;
// Add stimulus here
end
endmodule