]> jspc29.x-matter.uni-frankfurt.de Git - trb5sc.git/blob
b9edbef0cfad96872bf5bb9f90e96300bbc46de7
[trb5sc.git] /
1 //**************************************************************************\r
2 // *************************************************************************\r
3 // *                LATTICE SEMICONDUCTOR CONFIDENTIAL                     *\r
4 // *                         PROPRIETARY NOTE                              *\r
5 // *                                                                       *\r
6 // *  This software contains information confidential and proprietary      *\r
7 // *  to Lattice Semiconductor Corporation.  It shall not be reproduced    *\r
8 // *  in whole or in part, or transferred to other documents, or disclosed *\r
9 // *  to third parties, or used for any purpose other than that for which  *\r
10 // *  it was obtained, without the prior written consent of Lattice        *\r
11 // *  Semiconductor Corporation.  All rights reserved.                     *\r
12 // *                                                                       *\r
13 // *************************************************************************\r
14 //**************************************************************************\r
15 \r
16 `timescale 1ns/100ps\r
17 \r
18 module rate_resolution (\r
19         gbe_mode,\r
20         sgmii_mode,\r
21         an_enable,\r
22         advertised_rate,\r
23         link_partner_rate,\r
24         non_an_rate,\r
25 \r
26         operational_rate\r
27 );\r
28 \r
29 input gbe_mode;\r
30 input sgmii_mode;\r
31 input an_enable;\r
32 input [1:0] advertised_rate; // 00=10Mbps    01=100Mbps    10=1Gbps\r
33 input [1:0] link_partner_rate;\r
34 input [1:0] non_an_rate;\r
35 \r
36 output [1:0] operational_rate;\r
37 reg [1:0] operational_rate;\r
38 \r
39 \r
40 \r
41 always @(gbe_mode or sgmii_mode or an_enable or advertised_rate or link_partner_rate or non_an_rate) begin\r
42         if (gbe_mode) begin\r
43                 operational_rate <= 2'b10; // 1Gbps\r
44         end\r
45         else begin\r
46                 if (an_enable) begin\r
47                         if (sgmii_mode) begin\r
48                                 // PHY Mode\r
49                                 operational_rate <= advertised_rate;\r
50                         end\r
51                         else begin\r
52                                 // MAC Mode\r
53                                 operational_rate <= link_partner_rate;\r
54                         end\r
55                 end\r
56                 else begin\r
57                         // If auto-negotiation disabled, then this becomes active rate\r
58                         operational_rate <= non_an_rate;\r
59                 end\r
60         end\r
61 end\r
62 \r
63 \r
64 \r
65 endmodule\r
66 \r