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

Subversion Repositories ethmac10g

[/] [ethmac10g/] [trunk/] [rtl/] [verilog/] [rx_engine/] [rxRSIO.v] - Blame information for rev 69

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 39 fisher5090
//////////////////////////////////////////////////////////////////////
2 69 fisher5090
////                                                              ////
3
//// MODULE NAME: rxRSIO                                          ////
4
////                                                              ////
5 39 fisher5090
//// DESCRIPTION: Datapath of Reconciliation Sublayer.            ////
6
////                                                              ////
7 69 fisher5090
////                                                              ////
8 39 fisher5090
//// This file is part of the 10 Gigabit Ethernet IP core project ////
9 69 fisher5090
////  http://www.opencores.org/projects/ethmac10g/                ////
10
////                                                              ////
11
//// AUTHOR(S):                                                   ////
12
//// Zheng Cao                                                    ////
13
////                                                              ////
14 39 fisher5090
//////////////////////////////////////////////////////////////////////
15 69 fisher5090
////                                                              ////
16
//// Copyright (c) 2005 AUTHORS.  All rights reserved.            ////
17
////                                                              ////
18 39 fisher5090
//// This source file may be used and distributed without         ////
19
//// restriction provided that this copyright statement is not    ////
20
//// removed from the file and that any derivative work contains  ////
21
//// the original copyright notice and the associated disclaimer. ////
22
////                                                              ////
23
//// This source file is free software; you can redistribute it   ////
24
//// and/or modify it under the terms of the GNU Lesser General   ////
25
//// Public License as published by the Free Software Foundation; ////
26
//// either version 2.1 of the License, or (at your option) any   ////
27
//// later version.                                               ////
28
////                                                              ////
29
//// This source is distributed in the hope that it will be       ////
30
//// useful, but WITHOUT ANY WARRANTY; without even the implied   ////
31
//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR      ////
32
//// PURPOSE.  See the GNU Lesser General Public License for more ////
33
//// details.                                                     ////
34
////                                                              ////
35
//// You should have received a copy of the GNU Lesser General    ////
36
//// Public License along with this source; if not, download it   ////
37 69 fisher5090
//// from http://www.opencores.org/lgpl.shtml                     ////
38
////                                                              ////
39 39 fisher5090
//////////////////////////////////////////////////////////////////////
40
//
41
// CVS REVISION HISTORY:
42
//
43
// $Log: not supported by cvs2svn $
44 69 fisher5090
// Revision 1.1.1.1  2006/05/31 05:59:43  Zheng Cao
45
// first version
46
//
47 39 fisher5090
// Revision 1.1  2005/12/25 16:43:10  Zheng Cao
48
// 
49
// 
50
//
51
//////////////////////////////////////////////////////////////////////
52
 
53
`include "timescale.v"
54
`include "xgiga_define.v"
55
 
56
module rxRSIO(rxclk, rxclk_180, reset, rxd_in, rxc_in, rxd64, rxc8, local_fault, remote_fault);
57
    input rxclk;
58 69 fisher5090
    input rxclk_180;
59
    input reset;
60 39 fisher5090
    input [31:0] rxd_in;
61 69 fisher5090
    input [3:0] rxc_in;
62 39 fisher5090
    output [63:0] rxd64;
63
    output [7:0] rxc8;
64 69 fisher5090
    output local_fault;
65
    output remote_fault;
66 39 fisher5090
 
67 69 fisher5090
    parameter TP =1;
68 39 fisher5090
 
69 69 fisher5090
    reg local_fault, remote_fault;
70
//  wire get_align, get_seq;
71 39 fisher5090
 
72 69 fisher5090
    always@(posedge rxclk or posedge reset) begin
73
          if(reset) begin
74
            local_fault <=#TP 0;
75
            remote_fault <=#TP 0;
76
          end
77
          else begin
78
            local_fault <=#TP (rxd_in[7:0] == `SEQUENCE) & (rxd_in[29:8] == 0) & (rxc_in[3:0]== 4'h8) & ~rxd_in[30] & rxd_in[31];
79
            remote_fault<=#TP (rxd_in[7:0] == `SEQUENCE) & (rxd_in[29:8] == 0) & (rxc_in[3:0]== 4'h8) & rxd_in[30] & rxd_in[31];
80
          end
81
    end
82
//  assign get_align = ((rxd_in[7:0]==`START) & rxc_in[0]) & ((rxd_in[15:8]==`PREAMBLE) & ~rxc_in[1]);
83
//  assign get_seq = (rxd_in[7:0] == `SEQUENCE) & (rxd_in[29:8] == 0) & (rxc_in[3:0]== 4'h8) & rxd_in[31];
84
//  assign local_fault = get_seq & ~rxd_in[30];
85
//  assign remote_fault = get_seq & rxd_in[30];
86
 
87
    reg[7:0] rxc8_in_tmp;
88
    reg[63:0]rxd64_in_tmp;
89
 
90
//  reg get_align_reg;
91
//  always@(posedge rxclk_180 or posedge reset) begin
92
//       if (reset)
93
//         get_align_reg <=#TP 0;
94
//       else if(get_align)      
95
//         get_align_reg <=#TP 1'b1;
96
//       else
97
//         get_align_reg <=#TP get_align_reg;
98
//  end
99
 
100
    always@(posedge rxclk_180) begin
101
          if (reset)begin
102
            rxd64_in_tmp[63:32] <=#TP 0;
103
            rxc8_in_tmp[7:4] <=#TP 0;
104
          end
105
          else begin
106
            rxd64_in_tmp[63:32] <=#TP rxd_in;
107
            rxc8_in_tmp[7:4] <=#TP rxc_in;
108
          end
109
    end
110
 
111
    always@(posedge rxclk) begin
112
         if (reset)begin
113
           rxd64_in_tmp[31:0] <=#TP 0;
114
           rxc8_in_tmp[3:0] <=#TP 0;
115
         end
116
         else begin
117
           rxd64_in_tmp[31:0] <=#TP rxd_in;
118
           rxc8_in_tmp[3:0] <=#TP rxc_in;
119
         end
120
    end
121 39 fisher5090
 
122
    reg[63:0] rxd64;
123 69 fisher5090
    reg[7:0] rxc8;
124
    always@(posedge rxclk) begin
125
//       if(reset) begin
126
//         rxc8<=#TP 0;
127
//         rxd64 <=#TP 0;
128
//       end
129
//       else   begin
130
           rxc8<=#TP rxc8_in_tmp;
131
           rxd64 <=#TP rxd64_in_tmp;
132
//       end
133
    end
134 39 fisher5090
 
135
 
136
endmodule

powered by: WebSVN 2.1.0

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