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

Subversion Repositories mcs-4

[/] [mcs-4/] [trunk/] [rtl/] [verilog/] [common/] [timing_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 clock phase generator and recovery module testbench
6
//
7
// As a testbench, it leaves much to be desired. It allows a user to
8
// observe the behavior of the modules through simulation, but does
9
// not verify their proper operation. Use at your own risk.
10
//
11
// This file is part of the MCS-4 project hosted at OpenCores:
12
//      http://www.opencores.org/cores/mcs-4/
13
//
14
// Copyright © 2021 by Reece Pollack <rrpollack@opencores.org>
15
//
16
// These materials are provided under the Creative Commons
17
// "Attribution-NonCommercial-ShareAlike" (CC BY-NC-SA) Public License.
18
// They are NOT "public domain", and are protected by copyright.
19
//
20
// This work based on materials provided by Intel Corporation and
21
// others under the same license. See the file doc/License for
22
// details of this license.
23
//
24
////////////////////////////////////////////////////////////////////////
25
 
26
module timing_tb;
27
 
28
        localparam SYSCLK_TCY = 50;
29
 
30
        // Shared
31
        reg sysclk;
32
        wire sync;
33
 
34
    // Clockgen outputs
35
    wire clk1;
36
    wire clk2;
37
 
38
    clockgen #(
39
        .SYSCLK_TCY     (SYSCLK_TCY)
40
    ) clockgen (
41
        .sysclk         (sysclk),
42
        .clk1           (clk1),
43
        .clk2           (clk2)
44
    );
45
 
46
        // Generater outputs
47
        wire gen_a11;
48
        wire gen_a12;
49
        wire gen_a21;
50
        wire gen_a22;
51
        wire gen_a31;
52
        wire gen_a32;
53
        wire gen_m11;
54
        wire gen_m12;
55
        wire gen_m21;
56
        wire gen_m22;
57
        wire gen_x11;
58
        wire gen_x12;
59
        wire gen_x21;
60
        wire gen_x22;
61
        wire gen_x31;
62
        wire gen_x32;
63
 
64
        // Instantiate the timing generator
65
        timing_generator generator (
66
                .sysclk(sysclk),
67
                .clk1(clk1),
68
                .clk2(clk2),
69
                .a11(gen_a11),
70
                .a12(gen_a12),
71
                .a21(gen_a21),
72
                .a22(gen_a22),
73
                .a31(gen_a31),
74
                .a32(gen_a32),
75
                .m11(gen_m11),
76
                .m12(gen_m12),
77
                .m21(gen_m21),
78
                .m22(gen_m22),
79
                .x11(gen_x11),
80
                .x12(gen_x12),
81
                .x21(gen_x21),
82
                .x22(gen_x22),
83
                .x31(gen_x31),
84
                .x32(gen_x32),
85
                .sync(sync)
86
        );
87
 
88
        // Recovery outputs
89
        wire rec_a11;
90
        wire rec_a12;
91
        wire rec_a21;
92
        wire rec_a22;
93
        wire rec_a31;
94
        wire rec_a32;
95
        wire rec_m11;
96
        wire rec_m12;
97
        wire rec_m21;
98
        wire rec_m22;
99
        wire rec_x11;
100
        wire rec_x12;
101
        wire rec_x21;
102
        wire rec_x22;
103
        wire rec_x31;
104
        wire rec_x32;
105
 
106
        // Instantiate the timing recovery
107
        timing_recovery recovery (
108
                .sysclk(sysclk),
109
                .clk1(clk1),
110
                .clk2(clk2),
111
                .sync(sync),
112
                .a11(rec_a11),
113
                .a12(rec_a12),
114
                .a21(rec_a21),
115
                .a22(rec_a22),
116
                .a31(rec_a31),
117
                .a32(rec_a32),
118
                .m11(rec_m11),
119
                .m12(rec_m12),
120
                .m21(rec_m21),
121
                .m22(rec_m22),
122
                .x11(rec_x11),
123
                .x12(rec_x12),
124
                .x21(rec_x21),
125
                .x22(rec_x22),
126
                .x31(rec_x31),
127
                .x32(rec_x32)
128
        );
129
 
130
        initial begin
131
                // Initialize Inputs
132
                sysclk = 0;
133
 
134
                forever begin
135
                        #(SYSCLK_TCY/2) sysclk = ~sysclk;
136
                end
137
        end
138
 
139
endmodule
140
 

powered by: WebSVN 2.1.0

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