-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathcounter9bit_tb.v
96 lines (84 loc) · 1.57 KB
/
counter9bit_tb.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
`timescale 1ns / 1ps
////////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer:
//
// Create Date: 01:34:11 04/30/2012
// Design Name: counter9bit
// Module Name: C:/Users/Nikhil Handyal/Documents/Spring 2012/EE 201/Xillinx/Final Project/Spectrum_Analyzer/counter9bit_tb.v
// Project Name: Spectrum_Analyzer
// Target Device:
// Tool versions:
// Description:
//
// Verilog Test Fixture created by ISE for module: counter9bit
//
// Dependencies:
//
// Revision:
// Revision 0.01 - File Created
// Additional Comments:
//
////////////////////////////////////////////////////////////////////////////////
module counter9bit_tb;
parameter HALF_PERIOD = 10;
// Inputs
reg Clk;
reg reset;
reg start;
// Outputs
wire [8:0] count;
wire md2;
wire md4;
wire md8;
wire md16;
wire md32;
wire md64;
wire md128;
wire md216;
wire md512;
// Instantiate the Unit Under Test (UUT)
counter9bit uut (
.Clk(Clk),
.reset(reset),
.start(start),
.count(count),
.md2(md2),
.md4(md4),
.md8(md8),
.md16(md16),
.md32(md32),
.md64(md64),
.md128(md128),
.md216(md216),
.md512(md512)
);
initial begin :CLK_GENERATOR
Clk = 0;
forever begin
#HALF_PERIOD Clk = ~Clk;
end
end
initial begin
// Initialize Inputs
Clk = 0;
reset = 1;
start = 0;
// Wait 100 ns for global reset to finish
#100;
// Add stimulus here
#HALF_PERIOD;
reset = 0;
#20;
start = 1;
#40;
start = 0;
wait(md512);
#40;
start = 1;
#12.5;
start = 0;
#400;
reset = 1;
end
endmodule