OpenCores
URL https://opencores.org/ocsvn/mcs-4/mcs-4/trunk

Subversion Repositories mcs-4

[/] [mcs-4/] [trunk/] [rtl/] [verilog/] [common/] [clockgen_tb.v] - Blame information for rev 6

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 6 rrpollack
`timescale 1ns / 1ps
2
`default_nettype none
3
////////////////////////////////////////////////////////////////////////
4
//
5
// MCS-4 common clock generator testbench
6
//
7
// This module is a testbench for the two-phase clock generator module.
8
//
9
// As a testbench, it leaves much to be desired. It allows a user to
10
// observe the behavior of the module through simulation, but does
11
// not verify its proper operation. Use at your own risk.
12
//
13
// This file is part of the MCS-4 project hosted at OpenCores:
14
//      http://www.opencores.org/cores/mcs-4/
15
//
16
// Copyright © 2012, 2021 by Reece Pollack <rrpollack@opencores.org>
17
//
18
// These materials are provided under the Creative Commons
19
// "Attribution-NonCommercial-ShareAlike" (CC BY-NC-SA) Public License.
20
// They are NOT "public domain", and are protected by copyright.
21
//
22
// This work based on materials provided by Intel Corporation and
23
// others under the same license. See the file doc/License for
24
// details of this license.
25
//
26
////////////////////////////////////////////////////////////////////////
27
 
28
module clockgen_tb;
29
 
30
    parameter SYSCLK_TCY = 20;
31
 
32
    // Inputs
33
    reg     sysclk;
34
 
35
    // Outputs
36
    wire    clk1;
37
    wire    clk2;
38
    wire    clk1_ext;
39
    wire    clk2_ext;
40
 
41
    // Instantiate the Unit Under Test (UUT)
42
    clockgen #(
43
        .SYSCLK_TCY     (SYSCLK_TCY),
44
        .EXT_CLK_PROP   (4)
45
    ) clockgen (
46
        .sysclk     (sysclk),
47
        .clk1       (clk1),
48
        .clk2       (clk2),
49
        .clk1_ext   (clk1_ext),
50
        .clk2_ext   (clk2_ext)
51
    );
52
 
53
    always begin
54
        sysclk = 1'b0;
55
        #(SYSCLK_TCY / 2);
56
        sysclk = 1'b1;
57
        #(SYSCLK_TCY / 2);
58
    end
59
 
60
    initial begin
61
        $display ("counter width (W) is %d\n", clockgen.W);
62
    end
63
 
64
endmodule
65
 

powered by: WebSVN 2.1.0

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