-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathProgramMemory_testing.v
More file actions
171 lines (133 loc) · 2.59 KB
/
ProgramMemory_testing.v
File metadata and controls
171 lines (133 loc) · 2.59 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
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
`timescale 1ns / 1ps
////////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer:
//
// Create Date: 13:23:23 08/26/2019
// Design Name: PROGRAM_MEMORY
// Module Name: D:/efi/IET work/SEM3PROGRAM2/ProgramMemory_testing.v
// Project Name: SEM3PROGRAM2
// Target Device:
// Tool versions:
// Description:
//
// Verilog Test Fixture created by ISE for module: PROGRAM_MEMORY
//
// Dependencies:
//
// Revision:
// Revision 0.01 - File Created
// Additional Comments:
//
////////////////////////////////////////////////////////////////////////////////
module ProgramMemory_testing;
// Inputs
reg [15:0] jump_loc;
reg clk;
reg pc_mux_sel;
reg stall;
reg stall_pm;
reg reset;
// Outputs
wire [31:0] ins;
wire [15:0] current_address;
// Instantiate the Unit Under Test (UUT)
PROGRAM_MEMORY uut (
.jump_loc(jump_loc),
.clk(clk),
.pc_mux_sel(pc_mux_sel),
.stall(stall),
.stall_pm(stall_pm),
.reset(reset),
.ins(ins),
.current_address(current_address)
);
initial begin
// Initialize Inputs
/* jump_loc = 16'b0000000000001000;
pc_mux_sel = 1;
stall = 0;
stall_pm = 0;
reset = 1;
// Wait 100 ns for global reset to finish
#2;
jump_loc = 16'b0000000000001000;
pc_mux_sel = 1;
stall = 0;
stall_pm = 0;
reset = 0;
// Wait 100 ns for global reset to finish
#6;
jump_loc = 16'b0000000000001000; //3
pc_mux_sel = 1;
stall = 0;
stall_pm = 0;
reset = 1;
#2;
pc_mux_sel = 0; //4
stall = 0;
stall_pm = 0;
#5;
pc_mux_sel = 1;
stall = 0;
stall_pm = 0;
#10;
pc_mux_sel = 1; //6
stall = 0;
stall_pm = 0;
#10;
pc_mux_sel = 1; //7
stall = 0;
stall_pm = 0;
#10;
pc_mux_sel = 0;
stall = 1;
stall_pm = 0; //8
#10;
pc_mux_sel = 0;
stall = 0;
stall_pm = 1;
#5;
pc_mux_sel = 0; //10
stall = 0;
stall_pm = 1;
#5;
pc_mux_sel = 1;
stall = 0;
stall_pm = 0;
#5;
pc_mux_sel = 1;
stall = 0;
stall_pm = 0;
// Add stimulus here */
jump_loc = 4'h0008;
pc_mux_sel = 1;
stall = 0;
stall_pm = 0;
reset = 1;
#2;
reset = 0;
#6;
reset = 1;
#2;
pc_mux_sel = 0;
#30;
stall = 1;
#10;
stall_pm = 1;
stall = 0;
#10;
stall_pm = 0;
pc_mux_sel = 1;
#5;
end
initial begin
clk = 0;
forever
begin
#5;
clk = ~clk;
end
// Add stimulus here
end
endmodule