OpenCores
URL https://opencores.org/ocsvn/fpga-cf/fpga-cf/trunk

Subversion Repositories fpga-cf

[/] [fpga-cf/] [trunk/] [hdl/] [topv5_pr.v] - Blame information for rev 10

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

Line No. Rev Author Line
1 2 peteralieb
// Top Module
2
 
3
module top
4
(
5
   // SGMII Interface - EMAC0
6
   TXP_0,
7
   TXN_0,
8
   RXP_0,
9
   RXN_0,
10
 
11
   // SGMII MGT Clock buffer inputs 
12
   MGTCLK_N,
13
   MGTCLK_P,
14
 
15
   // reset for ethernet phy
16
   PHY_RESET_0,
17
 
18
   // GTP link status
19
   GTP_READY,
20
 
21
   // Asynchronous Reset
22
   RESET,
23
 
24
        // LED Status
25
        LEDS,
26
 
27
        // DIP Switch
28
        DIP,
29
 
30
        // CPU RESET
31
        RESET_CPU
32
);
33
 
34
//-----------------------------------------------------------------------------
35
// Port Declarations 
36
//-----------------------------------------------------------------------------
37
 
38
   // SGMII Interface - EMAC0
39
   output          TXP_0;
40
   output          TXN_0;
41
   input           RXP_0;
42
   input           RXN_0;
43
 
44
   // SGMII MGT Clock buffer inputs 
45
   input           MGTCLK_N;
46
   input           MGTCLK_P;
47
 
48
   // reset for ethernet phy
49
   output          PHY_RESET_0;
50
 
51
   // GTP link status
52
   output          GTP_READY;
53
 
54
   // Asynchronous Reset
55
   input           RESET;
56
 
57
        // LED Status
58
        output  [7:0]            LEDS;
59
 
60
        // DIP Switches
61
        input   [7:0]            DIP;
62
 
63
        // CPU RESET
64
        input                           RESET_CPU;
65
 
66
//-----------------------------------------------------------------------------
67
 
68
 
69
//-------------------------------------------------------------------------------------
70
//-------------------------------------------------------------------------------------
71
//                                                       User Signals
72
//-------------------------------------------------------------------------------------
73
//-------------------------------------------------------------------------------------
74
 
75
reg [7:0] DIP_r;
76
wire reset_cpu_p;
77
wire reset_cpu_i;
78
reg [7:0] LEDr;
79
 
80
IBUF cpu_reset_ibuf (.I(RESET_CPU), .O(reset_cpu_i));
81
 
82
assign reset_cpu_p = ~reset_cpu_i;
83
 
84
 
85
//-----------------------------------------------------------------------------
86
// Ethernet Platform Instance
87
//-----------------------------------------------------------------------------
88
 
89
wire in_src_rdy_usr;
90
wire out_dst_rdy_usr;
91
wire [7:0] in_data_usr;
92
wire in_sof_usr;
93
wire in_eof_usr;
94
wire in_dst_rdy_usr;
95
wire out_src_rdy_usr;
96
wire [7:0] out_data_usr;
97
wire out_sof_usr;
98
wire out_eof_usr;
99
wire [3:0] outport_usr;
100
wire [3:0] inport_usr;
101
wire clk_local;
102
wire rst_local;
103
 
104
 
105
enetplatform enet_inst
106
(
107
   .TXP_0(TXP_0),
108
   .TXN_0(TXN_0),
109
   .RXP_0(RXP_0),
110
   .RXN_0(RXN_0),
111
   .MGTCLK_N(MGTCLK_N),
112
   .MGTCLK_P(MGTCLK_P),
113
   .PHY_RESET_0(PHY_RESET_0),
114
   .GTP_READY(GTP_READY),
115
   .RESET(RESET),
116
        .RESET_CPU(reset_cpu_p),
117
        .in_src_rdy_usr(in_src_rdy_usr),
118
        .out_dst_rdy_usr(out_dst_rdy_usr),
119
        .in_data_usr(in_data_usr),
120
        .in_sof_usr(in_sof_usr),
121
        .in_eof_usr(in_eof_usr),
122
        .in_dst_rdy_usr(in_dst_rdy_usr),
123
        .out_src_rdy_usr(out_src_rdy_usr),
124
        .out_data_usr(out_data_usr),
125
        .out_sof_usr(out_sof_usr),
126
        .out_eof_usr(out_eof_usr),
127
        .outport_usr(outport_usr),
128
        .inport_usr(inport_usr),
129
        .clk_local(clk_local),
130
        .rst_local(rst_local)
131
);
132
 
133
//-------------------------------------------------------------------------------------
134
//-------------------------------------------------------------------------------------
135
 
136
 
137
 
138
 
139
//-------------------------------------------------------------------------------------
140
//-------------------------------------------------------------------------------------
141
//                                                       Channel Routing
142
//-------------------------------------------------------------------------------------
143
//-------------------------------------------------------------------------------------
144
 
145
wire ch1_in_sof;
146
wire ch1_in_eof;
147
wire ch1_in_src_rdy;
148
wire ch1_in_dst_rdy;
149
wire [7:0] ch1_in_data;
150
wire ch1_out_sof;
151
wire ch1_out_eof;
152
wire ch1_out_src_rdy;
153
wire ch1_out_dst_rdy;
154
wire [7:0] ch1_out_data;
155
wire ch1_wen;
156
wire ch1_ren;
157
 
158
wire ch2_in_sof;
159
wire ch2_in_eof;
160
wire ch2_in_src_rdy;
161
wire ch2_in_dst_rdy;
162
wire [7:0] ch2_in_data;
163
wire ch2_out_sof;
164
wire ch2_out_eof;
165
wire ch2_out_src_rdy;
166
wire ch2_out_dst_rdy;
167
wire [7:0] ch2_out_data;
168
wire ch2_wen;
169
wire ch2_ren;
170
 
171
channelif2 channelif_inst
172
(
173
        .in_sof(out_sof_usr),
174
        .in_eof(out_eof_usr),
175
        .in_src_rdy(out_src_rdy_usr),
176
        .in_dst_rdy(out_dst_rdy_usr),
177
        .in_data(out_data_usr),
178
        .inport_addr(outport_usr),
179
        .out_sof(in_sof_usr),
180
        .out_eof(in_eof_usr),
181
        .out_src_rdy(in_src_rdy_usr),
182
        .out_dst_rdy(in_dst_rdy_usr),
183
        .out_data(in_data_usr),
184
        .outport_addr(inport_usr),
185
        .wenables(),
186
        .renables(),
187
 
188
        .ch1_in_sof(ch1_in_sof),
189
        .ch1_in_eof(ch1_in_eof),
190
        .ch1_in_src_rdy(ch1_in_src_rdy),
191
        .ch1_in_dst_rdy(ch1_in_dst_rdy),
192
        .ch1_in_data(ch1_in_data),
193
        .ch1_out_sof(ch1_out_sof),
194
        .ch1_out_eof(ch1_out_eof),
195
        .ch1_out_src_rdy(ch1_out_src_rdy),
196
        .ch1_out_dst_rdy(ch1_out_dst_rdy),
197
        .ch1_out_data(ch1_out_data),
198
        .ch1_wen(ch1_wen),
199
        .ch1_ren(ch1_ren),
200
 
201
        .ch2_in_sof(ch2_in_sof),
202
        .ch2_in_eof(ch2_in_eof),
203
        .ch2_in_src_rdy(ch2_in_src_rdy),
204
        .ch2_in_dst_rdy(ch2_in_dst_rdy),
205
        .ch2_in_data(ch2_in_data),
206
        .ch2_out_sof(ch2_out_sof),
207
        .ch2_out_eof(ch2_out_eof),
208
        .ch2_out_src_rdy(ch2_out_src_rdy),
209
        .ch2_out_dst_rdy(ch2_out_dst_rdy),
210
        .ch2_out_data(ch2_out_data),
211
        .ch2_wen(ch2_wen),
212
        .ch2_ren(ch2_ren)
213
);
214
 
215
 
216
//-------------------------------------------------------------------------------------
217
//-------------------------------------------------------------------------------------
218
//                                                       User Logic
219
//-------------------------------------------------------------------------------------
220
//-------------------------------------------------------------------------------------
221
 
222
wire [7:0] LEDnext;
223
 
224
assign LEDS = LEDr;
225
 
226
always @(posedge clk_local)
227
begin
228
        DIP_r <= DIP;
229
end
230
 
231
always @(posedge clk_local)
232
begin
233
        if (rst_local)
234
                LEDr <= 0;
235
        else if (ch1_wen & ch1_out_src_rdy)
236
                LEDr <= LEDnext;
237
end
238
 
239
port_blank pr_channel_2 (
240
        .clk(clk_local),
241
        .rst(rst_local),
242
        .wen ( ch2_wen ),
243
        .ren ( ch2_ren ),
244
        .in_data ( ch2_out_data ),      // Inport
245
        .in_sof ( ch2_out_sof ),        // Inport
246
        .in_eof ( ch2_out_eof ),        // Inport
247
        .in_src_rdy ( ch2_out_src_rdy ),        // Inport
248
        .out_dst_rdy ( ch2_in_dst_rdy ),        // Outport
249
 
250
        // Outputs:
251
        .out_data ( ch2_in_data ),      // Outport
252
        .out_sof ( ch2_in_sof ),        // Outport
253
        .out_eof ( ch2_in_eof ),        // Outport
254
        .out_src_rdy ( ch2_in_src_rdy ),        // Outport
255
        .in_dst_rdy ( ch2_out_dst_rdy ) // Inport
256
);
257
 
258
 
259
//-------------------------------------------------------------------------------------
260
//-------------------------------------------------------------------------------------
261
//                                                       Channel Assignments
262
//-------------------------------------------------------------------------------------
263
//-------------------------------------------------------------------------------------
264
 
265
assign ch1_in_sof = 1;
266
assign ch1_in_eof = 1;
267
assign ch1_in_src_rdy = 1;
268
assign ch1_out_dst_rdy = 1;
269
assign ch1_in_data = DIP_r;
270
assign LEDnext = ch1_out_data;
271
 
272
 
273
 
274
 
275
endmodule

powered by: WebSVN 2.1.0

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