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

Subversion Repositories ethernet_tri_mode

[/] [ethernet_tri_mode/] [trunk/] [bench/] [verilog/] [tb_top.v] - Blame information for rev 7

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

Line No. Rev Author Line
1 6 maverickis
`timescale 1 ns/100ps
2 5 maverickis
//////////////////////////////////////////////////////////////////////
3
////                                                              ////
4 6 maverickis
////  tb_top.v                                                    ////
5 5 maverickis
////                                                              ////
6
////  This file is part of the Ethernet IP core project           ////
7
////  http://www.opencores.org/projects.cgi/web/ethernet_tri_mode/////
8
////                                                              ////
9
////  Author(s):                                                  ////
10
////      - Jon Gao (gaojon@yahoo.com)                            ////
11
////                                                              ////
12
////                                                              ////
13
//////////////////////////////////////////////////////////////////////
14
////                                                              ////
15
//// Copyright (C) 2001 Authors                                   ////
16
////                                                              ////
17
//// This source file may be used and distributed without         ////
18
//// restriction provided that this copyright statement is not    ////
19
//// removed from the file and that any derivative work contains  ////
20
//// the original copyright notice and the associated disclaimer. ////
21
////                                                              ////
22
//// This source file is free software; you can redistribute it   ////
23
//// and/or modify it under the terms of the GNU Lesser General   ////
24
//// Public License as published by the Free Software Foundation; ////
25
//// either version 2.1 of the License, or (at your option) any   ////
26
//// later version.                                               ////
27
////                                                              ////
28
//// This source is distributed in the hope that it will be       ////
29
//// useful, but WITHOUT ANY WARRANTY; without even the implied   ////
30
//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR      ////
31
//// PURPOSE.  See the GNU Lesser General Public License for more ////
32
//// details.                                                     ////
33
////                                                              ////
34
//// You should have received a copy of the GNU Lesser General    ////
35
//// Public License along with this source; if not, download it   ////
36
//// from http://www.opencores.org/lgpl.shtml                     ////
37
////                                                              ////
38
//////////////////////////////////////////////////////////////////////
39
//                                                                    
40
// CVS Revision History                                               
41
//                                                                    
42 6 maverickis
// $Log: not supported by cvs2svn $
43 7 maverickis
// Revision 1.2  2005/12/16 06:44:13  Administrator
44
// replaced tab with space.
45
// passed 9.6k length frame test.
46
//
47 6 maverickis
// Revision 1.1.1.1  2005/12/13 01:51:44  Administrator
48
// no message
49
// 
50 5 maverickis
 
51
module tb_top (
52
);
53
//******************************************************************************
54
//internal signals                                                              
55
//******************************************************************************
56
                                //system signals
57 6 maverickis
reg                             Reset                                   ;
58
reg                             Clk_125M                                ;
59
reg                             Clk_user                                ;
60
reg                             Clk_reg                                 ;
61 5 maverickis
                                //user interface 
62 6 maverickis
wire                    Rx_mac_ra                               ;
63
wire                    Rx_mac_rd                               ;
64
wire    [31:0]   Rx_mac_data                             ;
65
wire    [1:0]    Rx_mac_BE                               ;
66
wire                    Rx_mac_pa                               ;
67
wire                    Rx_mac_sop                              ;
68
wire                    Rx_mac_eop                              ;
69 5 maverickis
                                //user interface 
70 6 maverickis
wire                    Tx_mac_wa                       ;
71
wire                    Tx_mac_wr                       ;
72
wire    [31:0]   Tx_mac_data                     ;
73
wire    [1:0]    Tx_mac_BE                               ;//big endian
74
wire                    Tx_mac_sop                      ;
75
wire                    Tx_mac_eop                              ;
76 5 maverickis
                                //Phy interface          
77
                                //Phy interface                 
78 6 maverickis
wire                    Gtx_clk                                 ;//used only in GMII mode
79
wire                    Rx_clk                                  ;
80
wire                    Tx_clk                                  ;//used only in MII mode
81
wire                    Tx_er                                   ;
82
wire                    Tx_en                                   ;
83
wire    [7:0]    Txd                                             ;
84
wire                    Rx_er                                   ;
85
wire                    Rx_dv                                   ;
86
wire    [7:0]    Rxd                                             ;
87
wire                    Crs                                             ;
88
wire                    Col                                             ;
89 7 maverickis
wire            CSB                     ;
90
wire            WRB                     ;
91
wire    [15:0]  CD_in                   ;
92
wire    [15:0]  CD_out                  ;
93
wire    [7:0]   CA                      ;
94 5 maverickis
                                //Phy int host interface     
95 6 maverickis
wire                    Line_loop_en                    ;
96
wire    [2:0]    Speed                                   ;
97 7 maverickis
                                //mii
98 6 maverickis
wire            Mdio                    ;// MII Management Data In
99
wire            Mdc                             ;// MII Management Data Clock   
100 7 maverickis
wire            CPU_init_end            ;
101 5 maverickis
//******************************************************************************
102
//internal signals                                                              
103
//******************************************************************************
104
 
105 6 maverickis
initial
106
        begin
107
                        Reset   =1;
108
        #20             Reset   =0;
109
        end
110
always
111
        begin
112
        #4              Clk_125M=0;
113
        #4              Clk_125M=1;
114
        end
115
 
116
always
117
        begin
118
        #5              Clk_user=0;
119
        #5              Clk_user=1;
120
        end
121
 
122
always
123
        begin
124
        #10             Clk_reg=0;
125
        #10             Clk_reg=1;
126
        end
127
 
128
 
129
initial
130
        begin
131
        $shm_open("tb_top.shm",,900000000,);
132
        $shm_probe("AS");
133
        end
134
 
135
 
136 5 maverickis
MAC_top U_MAC_top(
137 6 maverickis
 //system signals                       (//system signals           ),
138 5 maverickis
.Reset                                          (Reset                                      ),
139
.Clk_125M                                       (Clk_125M                                   ),
140
.Clk_user                                       (Clk_user                                   ),
141
.Clk_reg                                            (Clk_reg                                    ),
142 7 maverickis
.Speed                          (Speed                      ),
143 6 maverickis
 //user interface               (//user interface           ),
144 5 maverickis
.Rx_mac_ra                                      (Rx_mac_ra                                  ),
145
.Rx_mac_rd                                      (Rx_mac_rd                                  ),
146
.Rx_mac_data                                (Rx_mac_data                                ),
147
.Rx_mac_BE                                      (Rx_mac_BE                                  ),
148
.Rx_mac_pa                                      (Rx_mac_pa                                  ),
149
.Rx_mac_sop                                     (Rx_mac_sop                                 ),
150
.Rx_mac_eop                                     (Rx_mac_eop                                 ),
151 6 maverickis
 //user interface               (//user interface           ),
152 5 maverickis
.Tx_mac_wa                              (Tx_mac_wa                          ),
153
.Tx_mac_wr                              (Tx_mac_wr                          ),
154
.Tx_mac_data                        (Tx_mac_data                        ),
155
.Tx_mac_BE                                      (Tx_mac_BE                                  ),
156
.Tx_mac_sop                             (Tx_mac_sop                         ),
157
.Tx_mac_eop                                     (Tx_mac_eop                                 ),
158 6 maverickis
 //Phy interface                (//Phy interface            ),
159
 //Phy interface                            (//Phy interface                    ),
160 5 maverickis
.Gtx_clk                                            (Gtx_clk                                    ),
161
.Rx_clk                                         (Rx_clk                                     ),
162
.Tx_clk                                         (Tx_clk                                     ),
163
.Tx_er                                          (Tx_er                                      ),
164
.Tx_en                                          (Tx_en                                      ),
165
.Txd                                                (Txd                                                ),
166
.Rx_er                                          (Rx_er                                      ),
167
.Rx_dv                                          (Rx_dv                                      ),
168
.Rxd                                                (Rxd                                                ),
169
.Crs                                                (Crs                                                ),
170
.Col                                                (Col                                                ),
171 7 maverickis
//host interface
172
.CSB                            (CSB                        ),
173
.WRB                            (WRB                        ),
174
.CD_in                          (CD_in                      ),
175
.CD_out                         (CD_out                     ),
176
.CA                             (CA                         ),
177 6 maverickis
 //MII interface signals        (//MII interface signals    ),
178 5 maverickis
.Mdio                           (Mdio                       ),
179
.Mdc                                (Mdc                                )
180 6 maverickis
);
181 5 maverickis
 
182 6 maverickis
Phy_sim U_Phy_sim (
183
.Gtx_clk                                                (Gtx_clk                                ),
184
.Rx_clk                             (Rx_clk                             ),
185
.Tx_clk                             (Tx_clk                             ),
186
.Tx_er                              (Tx_er                              ),
187
.Tx_en                              (Tx_en                              ),
188
.Txd                                    (Txd                                ),
189
.Rx_er                              (Rx_er                              ),
190
.Rx_dv                              (Rx_dv                              ),
191
.Rxd                                    (Rxd                                ),
192
.Crs                                    (Crs                                ),
193
.Col                                    (Col                                ),
194
.Speed                              (Speed                              )
195
);
196 5 maverickis
 
197 6 maverickis
User_int_sim U_User_int_sim(
198
.Reset                                                  (Reset                                          ),
199
.Clk_user                                   (Clk_user                           ),
200 7 maverickis
.CPU_init_end                   (CPU_init_end               ),
201 6 maverickis
 //user inputerface             (//user inputerface         ),
202
.Rx_mac_ra                                  (Rx_mac_ra                          ),
203
.Rx_mac_rd                                  (Rx_mac_rd                          ),
204
.Rx_mac_data                            (Rx_mac_data                        ),
205
.Rx_mac_BE                                  (Rx_mac_BE                          ),
206
.Rx_mac_pa                                  (Rx_mac_pa                          ),
207
.Rx_mac_sop                                 (Rx_mac_sop                         ),
208
.Rx_mac_eop                                 (Rx_mac_eop                         ),
209
 //user inputerface             (//user inputerface         ),
210
.Tx_mac_wa                          (Tx_mac_wa                  ),
211
.Tx_mac_wr                          (Tx_mac_wr                  ),
212
.Tx_mac_data                    (Tx_mac_data                ),
213
.Tx_mac_BE                                  (Tx_mac_BE                          ),
214
.Tx_mac_sop                         (Tx_mac_sop                 ),
215
.Tx_mac_eop                                 (Tx_mac_eop                         )
216 5 maverickis
);
217 6 maverickis
 
218 7 maverickis
host_sim U_host_sim(
219 6 maverickis
.Reset                                  (Reset                          ),
220
.Clk_reg                                (Clk_reg                        ),
221 7 maverickis
.CSB                            (CSB                        ),
222
.WRB                            (WRB                        ),
223
.CD_in                          (CD_in                      ),
224
.CD_out                         (CD_out                     ),
225
.CPU_init_end                   (CPU_init_end               ),
226
.CA                             (CA                         )
227
 
228 6 maverickis
);
229 5 maverickis
endmodule

powered by: WebSVN 2.1.0

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