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

Subversion Repositories mcs-4

[/] [mcs-4/] [trunk/] [rtl/] [verilog/] [common/] [timing_recovery.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 recovery module
6
//
7
// This file is part of the MCS-4 project hosted at OpenCores:
8
//      http://www.opencores.org/cores/mcs-4/
9
//
10
// Copyright © 2021 by Reece Pollack <rrpollack@opencores.org>
11
//
12
// These materials are provided under the Creative Commons
13
// "Attribution-NonCommercial-ShareAlike" (CC BY-NC-SA) Public License.
14
// They are NOT "public domain", and are protected by copyright.
15
//
16
// This work based on materials provided by Intel Corporation and
17
// others under the same license. See the file doc/License for
18
// details of this license.
19
//
20
////////////////////////////////////////////////////////////////////////
21
 
22
/*
23
 *  Recover the clock phase timing from the MCS-4 bus
24
 *
25
 *  This module is for use in other component emulations
26
 *  such as the i4001 ROM and the i4002 RAM chips.
27
 */
28
module timing_recovery (
29
    input  wire     sysclk, // System clock
30
    input  wire     clk1,   // Clock phase 1
31
    input  wire     clk2,   // Clock phase 2
32
    input  wire     sync,   // Clock sync
33
 
34
    output reg      a11,
35
    output reg      a12,
36
    output reg      a21,
37
    output reg      a22,
38
    output reg      a31,
39
    output reg      a32,
40
 
41
    output reg      m11,
42
    output reg      m12,
43
    output reg      m21,
44
    output reg      m22,
45
 
46
    output reg      x11,
47
    output reg      x12,
48
    output reg      x21,
49
    output reg      x22,
50
    output reg      x31,
51
    output reg      x32
52
    );
53
 
54
    //
55
    // Recover the cycle timing
56
    //
57
    always @(posedge sysclk) begin
58
        if (clk2) begin
59
            a11 <= sync;
60
            a21 <= a12;
61
            a31 <= a22;
62
            m11 <= a32;
63
            m21 <= m12;
64
            x11 <= m22;
65
            x21 <= x12;
66
            x31 <= x22;
67
        end
68
    end
69
 
70
    always @(posedge sysclk) begin
71
        if (clk1) begin
72
            a12 <= a11;
73
            a22 <= a21;
74
            a32 <= a31;
75
            m12 <= m11;
76
            m22 <= m21;
77
            x12 <= x11;
78
            x22 <= x21;
79
            x32 <= x31;
80
        end
81
    end
82
 
83
endmodule

powered by: WebSVN 2.1.0

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