-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTestPC.v
76 lines (66 loc) · 1.6 KB
/
TestPC.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
`timescale 1ns / 1ps
////////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer:
//
// Create Date: 21:46:17 04/18/2020
// Design Name: ProgramCounter
// Module Name: D:/Final_Year_Project/EC_448_Major_Project/TestPC.v
// Project Name: EC_448_Major_Project
// Target Device:
// Tool versions:
// Description:
//
// Verilog Test Fixture created by ISE for module: ProgramCounter
//
// Dependencies:
//
// Revision:
// Revision 0.01 - File Created
// Additional Comments:
//
////////////////////////////////////////////////////////////////////////////////
module TestPC;
// Inputs
reg clk;
reg count_enable;
reg reset;
reg load_address;
reg jump_enable;
reg [15:0] jump_address;
// Outputs
wire [15:0] address;
// Instantiate the Unit Under Test (UUT)
ProgramCounter uut (
.clk(clk),
.count_enable(count_enable),
.reset(reset),
.load_address(load_address),
.jump_enable(jump_enable),
.jump_address(jump_address),
.address(address)
);
initial begin
// Initialize Inputs
clk = 0;
count_enable = 0;
reset = 0;
load_address = 0;
jump_enable = 0;
jump_address = 0;
// Wait 100 ns for global reset to finish
#20 load_address = 1; count_enable = 1;
#20 count_enable = 0;
#20 count_enable = 1; jump_address = 16'haa98;
#20 jump_enable = 1;
#20 jump_enable = 0;
#20 reset = 1;
#20 reset = 0;
#20 count_enable = 0;
#20 load_address = 0;
// Add stimulus here
end
initial begin
forever #10 clk = ~clk;
end
endmodule