OpenCores
URL https://opencores.org/ocsvn/boundaries/boundaries/trunk

Subversion Repositories boundaries

[/] [boundaries/] [trunk/] [bench/] [verilog/] [clock_detect_tb.v] - Blame information for rev 4

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 esquehill
//////////////////////////////////////////////////////////////////////
2
////                                                              ////
3
//// clock_detect_tb.v                                            ////
4
////                                                              ////
5
//// This file is part of the boundaries opencores effort.        ////
6
//// <http://www.opencores.org/cores/boundaries/>                 ////
7
////                                                              ////
8
//// Module Description:                                          ////
9
//// Clock detect testbench.                                      ////
10
////                                                              ////
11
//// To Do:                                                       ////
12
//// Done.                                                        ////
13
////                                                              ////
14
//// Author(s):                                                   ////
15
//// - Shannon Hill                                               ////
16
////                                                              ////
17
//////////////////////////////////////////////////////////////////////
18
////                                                              ////
19
//// Copyright (C) 2004 Shannon Hill and OPENCORES.ORG            ////
20
////                                                              ////
21
//// This source file may be used and distributed without         ////
22
//// restriction provided that this copyright statement is not    ////
23
//// removed from the file and that any derivative work contains  ////
24
//// the original copyright notice and the associated disclaimer. ////
25
////                                                              ////
26
//// This source file is free software; you can redistribute it   ////
27
//// and/or modify it under the terms of the GNU Lesser General   ////
28
//// Public License as published by the Free Software Foundation; ////
29
//// either version 2.1 of the License, or (at your option) any   ////
30
//// later version.                                               ////
31
////                                                              ////
32
//// This source is distributed in the hope that it will be       ////
33
//// useful, but WITHOUT ANY WARRANTY; without even the implied   ////
34
//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR      ////
35
//// PURPOSE. See the GNU Lesser General Public License for more  ////
36
//// details.                                                     ////
37
////                                                              ////
38
//// You should have received a copy of the GNU Lesser General    ////
39
//// Public License along with this source; if not, download it   ////
40
//// from <http://www.opencores.org/lgpl.shtml>                   ////
41
////                                                              ////
42
//////////////////////////////////////////////////////////////////////
43
//
44
// $Id: clock_detect_tb.v,v 1.1 2004-07-07 12:39:14 esquehill Exp $
45
//
46
// CVS Revision History
47
//
48
// $Log: not supported by cvs2svn $
49
//
50
//
51
 
52
`timescale 1ns/1ps
53
 
54
module clock_detect_tb();
55
 
56
reg       clk0_i;
57
reg       clk1_i;
58
reg       clk2_i;
59
reg       clk3_i;
60
 
61
reg       rst0_i;
62
 
63
wire   alive1;
64
wire   alive2;
65
wire   alive3;
66
 
67
 
68
initial
69
begin
70
 clk0_i   <= 0;
71
 clk1_i   <= 0;
72
 clk2_i   <= 0;
73
 clk3_i   <= 0;
74
 rst0_i   <= 1;
75
#10;
76
 rst0_i   <= 0;
77
#5000;
78
 if( alive1 & alive2 & ~alive3 ) $display("OK");
79
                            else $display("BAD");
80
 $finish;
81
end
82
 
83
always #5      clk0_i <= ~clk0_i;  // 10 ns
84
 
85
always #150    clk1_i <= ~clk1_i;
86
always #160    clk2_i <= ~clk2_i;
87
always #170    clk3_i <= ~clk3_i;
88
 
89
/* clock_detect AUTO_TEMPLATE (
90
.rst_i     (rst0_i),
91
.clk_i     (clk0_i),
92
.sclk_i    (clk1_i),
93
.alive_o   (alive1),
94
); */
95
 
96
clock_detect #(4) u_d1 ( /*AUTOINST*/
97
                        // Outputs
98
                        .alive_o        (alive1),                // Templated
99
                        // Inputs
100
                        .rst_i          (rst0_i),                // Templated
101
                        .clk_i          (clk0_i),                // Templated
102
                        .sclk_i         (clk1_i));                // Templated
103
 
104
/* clock_detect AUTO_TEMPLATE (
105
.rst_i     (rst0_i),
106
.clk_i     (clk0_i),
107
.sclk_i    (clk2_i),
108
.alive_o   (alive2),
109
); */
110
 
111
clock_detect #(4) u_d2 ( /*AUTOINST*/
112
                        // Outputs
113
                        .alive_o        (alive2),                // Templated
114
                        // Inputs
115
                        .rst_i          (rst0_i),                // Templated
116
                        .clk_i          (clk0_i),                // Templated
117
                        .sclk_i         (clk2_i));                // Templated
118
 
119
/* clock_detect AUTO_TEMPLATE (
120
.rst_i     (rst0_i),
121
.clk_i     (clk0_i),
122
.sclk_i    (clk3_i),
123
.alive_o   (alive3),
124
); */
125
 
126
clock_detect #(4) u_d3 ( /*AUTOINST*/
127
                        // Outputs
128
                        .alive_o        (alive3),                // Templated
129
                        // Inputs
130
                        .rst_i          (rst0_i),                // Templated
131
                        .clk_i          (clk0_i),                // Templated
132
                        .sclk_i         (clk3_i));                // Templated
133
 
134
 
135
endmodule

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.