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

Subversion Repositories sgmii

[/] [sgmii/] [trunk/] [build/] [OpenCore_MAC/] [TECH/] [altera/] [RGMII2GMII.v.bak] - Blame information for rev 26

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 26 jefflieu
`timescale 1ns / 1ps
2
//////////////////////////////////////////////////////////////////////////////////
3
// Company:
4
// Engineer:
5
//
6
// Create Date:    15:20:11 06/01/2010
7
// Design Name:
8
// Module Name:    RGMII2GMII
9
// Project Name:
10
// Target Devices:
11
// Tool versions:
12
// Description:
13
//
14
// Dependencies:
15
//
16
// Revision:
17
// Revision 0.01 - File Created
18
// Additional Comments:
19
//
20
//////////////////////////////////////////////////////////////////////////////////
21
module RGMII2GMII(
22
    input [3:0] RGMII_RxD,
23
    input RGMII_RxCtl,
24
    input RGMII_RxClk,
25
    output reg [7:0] RxD,
26
    output reg RxDV,
27
    output reg RxER,
28
    output RxClk,
29
         input ClkEN,
30
         input rst
31
    );
32
 
33
        wire [3:0] RxDH;
34
        wire [3:0] RxDL;
35
        wire DV, ER;
36
        reg DV1,ERR1;
37
        reg DV2,ERR2;
38
        wire [7:0] RxD1;
39
        reg [3:0] RxD1H;
40
        reg [3:0] RxD1L;
41
        reg [7:0] RxD2;
42
 
43
        wire [4:0] dataout_h;
44
        wire [4:0] dataout_l;
45
        wire [4:0] datain;
46
 
47
        assign RxClk = RGMII_RxClk;
48
 
49
        DDR_I DDR_I_instance(
50
        .datain(datain),
51
        .inclock(RGMII_RxClk),
52
        .dataout_h(dataout_h),
53
        .dataout_l(dataout_l));
54
 
55
        assign datain = {RGMII_RxCtl,RGMII_RxD};
56
        assign RxDL = dataout_h[3:0];
57
        assign RxDH = dataout_l[3:0];
58
        assign DV = dataout_h[4];
59
        assign ER = dataout_l[4];
60
 
61
 
62
        always@(posedge RGMII_RxClk)
63
        begin
64
                RxD1L<=RxDL;
65
        end
66
 
67
        always@(negedge RGMII_RxClk)
68
        begin
69
                RxD1H<=RxDH;
70
        end
71
 
72
        assign RxD1 = {RxD1H, RxD1L};
73
 
74
        always@(posedge(RGMII_RxClk))
75
        begin
76
                        RxD2 <= RxD1;
77
                        RxD <= RxD2;
78
        end
79
 
80
        always@(posedge(RGMII_RxClk))
81
        begin
82
                DV1 <= DV;
83
        end
84
        always@(negedge(RGMII_RxClk))
85
        begin
86
                ERR1<= ER;
87
        end
88
        always@(posedge(RGMII_RxClk))
89
        begin
90
                        ERR2 <= ERR1;
91
                        DV2 <= DV1;
92
                        RxDV <= DV2;
93
                        RxER <= (DV2^ERR2);
94
        end
95
 
96
 
97
 
98
endmodule

powered by: WebSVN 2.1.0

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