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

Subversion Repositories smii

[/] [smii/] [trunk/] [rtl/] [verilog/] [smii_module_inst.v] - Blame information for rev 7

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 3 unneback
//////////////////////////////////////////////////////////////////////
2
////                                                              ////
3
////  SMII                                                        ////
4
////                                                              ////
5
////  Description                                                 ////
6
////  SMII low pin count ethernet PHY interface                   ////
7
////                                                              ////
8
////  To Do:                                                      ////
9
////   -                                                          ////
10
////                                                              ////
11
////  Author(s):                                                  ////
12
////      - Michael Unneback, unneback@opencores.org              ////
13
////                          michael.unneback@orsoc.se           ////
14
////                                                              ////
15
//////////////////////////////////////////////////////////////////////
16
////                                                              ////
17
//// Copyright (C) 2009 Authors and OPENCORES.ORG                 ////
18
////                                                              ////
19
//// This source file may be used and distributed without         ////
20
//// restriction provided that this copyright statement is not    ////
21
//// removed from the file and that any derivative work contains  ////
22
//// the original copyright notice and the associated disclaimer. ////
23
////                                                              ////
24
//// This source file is free software; you can redistribute it   ////
25
//// and/or modify it under the terms of the GNU Lesser General   ////
26
//// Public License as published by the Free Software Foundation; ////
27
//// either version 2.1 of the License, or (at your option) any   ////
28
//// later version.                                               ////
29
////                                                              ////
30
//// This source is distributed in the hope that it will be       ////
31
//// useful, but WITHOUT ANY WARRANTY; without even the implied   ////
32
//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR      ////
33
//// PURPOSE.  See the GNU Lesser General Public License for more ////
34
//// details.                                                     ////
35
////                                                              ////
36
//// You should have received a copy of the GNU Lesser General    ////
37
//// Public License along with this source; if not, download it   ////
38
//// from http://www.opencores.org/lgpl.shtml                     ////
39
////                                                              ////
40
//////////////////////////////////////////////////////////////////////
41
// wire declarations
42
`for (i=1;i<=SMII;i++)
43
   // MII
44
wire         m::`i::tx_clk;
45
wire [3:0]            m::`i::txd;
46
wire         m::`i::txen;
47
wire         m::`i::txerr;
48
wire         m::`i::rx_clk;
49
wire [3:0]            m::`i::rxd;
50
wire         m::`i::rxdv;
51
wire         m::`i::rxerr;
52
wire         m::`i::coll;
53
wire         m::`i::crs;
54
`endfor
55
wire [1:10]          state;
56
wire              sync;
57
wire [1:`SMII]    rx, tx;
58
wire [1:`SMII]    mdc_o, md_i, md_o, md_oe;
59
smii_sync smii_sync1
60
  (
61
   .sync(sync),
62
   .state(state),
63
   .clk(eth_clk),
64
   .rst(wb_rst)
65
   );
66
 
67
`ifndef SMII_SYNC_PER_PHY
68 7 unneback
obufdff obufdff_sync
69 3 unneback
  (
70
   .d(sync),
71 7 unneback
   .pad(eth_sync_pad_o),
72 3 unneback
   .clk(eth_clk),
73
   .rst(wb_rst)
74
   );
75
`endif
76
 
77
`for (i=1;i<=SMII;i++)
78
// ethernet MAC
79
eth_top eth_top::`i
80
        (
81
         // wb common
82
         .wb_clk_i(wb_clk),
83
         .wb_rst_i(wb_rst),
84
         // wb slave
85
         .wb_dat_i(wbs_eth::`i::_cfg_dat_i),
86
         .wb_dat_o(wbs_eth::`i::_cfg_dat_o),
87
         .wb_adr_i(wbs_eth::`i::_cfg_adr_i[11:2]),
88
         .wb_sel_i(wbs_eth::`i::_cfg_sel_i),
89
         .wb_we_i(wbs_eth::`i::_cfg_we_i),
90
         .wb_cyc_i(wbs_eth::`i::_cfg_cyc_i),
91
         .wb_stb_i(wbs_eth::`i::_cfg_stb_i),
92
         .wb_ack_o(wbs_eth::`i::_cfg_ack_o),
93
         .wb_err_o(wbs_eth::`i::_cfg_err_o),
94
         // wb master
95
         .m_wb_adr_o(wbm_eth::`i::_adr_o),
96
         .m_wb_sel_o(wbm_eth::`i::_sel_o),
97
         .m_wb_we_o(wbm_eth::`i::_we_o),
98
         .m_wb_dat_o(wbm_eth::`i::_dat_o),
99
         .m_wb_dat_i(wbm_eth::`i::_dat_i),
100
         .m_wb_cyc_o(wbm_eth::`i::_cyc_o),
101
         .m_wb_stb_o(wbm_eth::`i::_stb_o),
102
         .m_wb_ack_i(wbm_eth::`i::_ack_i),
103
         .m_wb_err_i(wbm_eth::`i::_err_i),
104
         .m_wb_cti_o(wbm_eth::`i::_cti_o),
105
         .m_wb_bte_o(wbm_eth::`i::_bte_o),
106
         // MII TX
107
         .mtx_clk_pad_i(m::`i::tx_clk),
108
         .mtxd_pad_o(m::`i::txd),
109
         .mtxen_pad_o(m::`i::txen),
110
         .mtxerr_pad_o(m::`i::txerr),
111
         .mrx_clk_pad_i(m::`i::rx_clk),
112
         .mrxd_pad_i(m::`i::rxd),
113
         .mrxdv_pad_i(m::`i::rxdv),
114
         .mrxerr_pad_i(m::`i::rxerr),
115
         .mcoll_pad_i(m::`i::coll),
116
         .mcrs_pad_i(m::`i::crs),
117
         // MII management
118
         .mdc_pad_o(mdc_o[`i]),
119
         .md_pad_i(md_i[`i]),
120
         .md_pad_o(md_o[`i]),
121
         .md_padoe_o(md_oe[`i]),
122
         .int_o(eth_int[`i])
123
         );
124
 
125
iobuftri iobuftri::`i
126
  (
127
   .i(md_o[`i]),
128
   .oe(md_oe[`i]),
129
   .o(md_i[`i]),
130
   .pad(eth_md_pad_io[`i])
131
   );
132
 
133
obuf obuf::`i
134
  (
135
   .i(mdc_o[`i]),
136
   .pad(eth_mdc_pad_o[`i])
137
   );
138
 
139
smii_txrx smii_txrx::`i
140
  (
141
   .tx(tx[`i]),
142
   .rx(rx[`i]),
143
   .mtx_clk(m::`i::tx_clk),
144
   .mtxd(m::`i::txd),
145
   .mtxen(m::`i::txen),
146
   .mtxerr(m::`i::txerr),
147
   .mrx_clk(m::`i::rx_clk),
148
   .mrxd(m::`i::rxd),
149
   .mrxdv(m::`i::rxdv),
150
   .mrxerr(m::`i::rxerr),
151
   .mcoll(m::`i::coll),
152
   .mcrs(m::`i::crs),
153
   .state(state),
154
   .clk(eth_clk),
155
   .rst(wb_rst)
156
   );
157
 
158
 `ifdef SMII_SYNC_PER_PHY
159
obufdff obufdff_sync::`i
160
  (
161
   .d(sync),
162
   .pad(eth_sync_pad_o[`i]),
163
   .clk(eth_clk),
164
   .rst(wb_rst)
165
   );
166
 `endif
167
 
168
obufdff obufdff_tx::`i
169
  (
170
   .d(tx[`i]),
171
   .pad(eth_tx_pad_o[`i]),
172
   .clk(eth_clk),
173
   .rst(wb_rst)
174
   );
175
 
176
ibufdff ibufdff_rx::`i
177
  (
178
   .pad(eth_rx_pad_i[`i]),
179
   .q(rx[`i]),
180
   .clk(eth_clk),
181
   .rst(wb_rst)
182
   );
183
 
184
`endfor
185
 

powered by: WebSVN 2.1.0

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