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

Subversion Repositories xge_ll_mac

[/] [xge_ll_mac/] [trunk/] [rtl/] [rx_enqueue.v] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 cleberCAG
//////////////////////////////////////////////////////////////////////
2
////                                                              ////
3
////  This file is part of the "10GE LL MAC" project              ////
4
////  http://www.opencores.org/cores/xge_ll_mac/                  ////
5
////                                                              ////
6
////  This project is derived from the "10GE MAC" project of      ////
7
////  A. Tanguay (antanguay@opencores.org) by Andreas Peters      ////
8
////  for his Diploma Thesis at the University of Heidelberg.     ////
9
////  The Thesis was supervised by Christian Leber                ////
10
////                                                              ////
11
////  Author(s):                                                  ////
12
////      - Andreas Peters                                        ////
13
////                                                              ////
14
//////////////////////////////////////////////////////////////////////
15
////                                                              ////
16
//// Copyright (C) 2008-2012 AUTHORS. All rights reserved.        ////
17
////                                                              ////
18
//// 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
//// from http://www.opencores.org/lgpl.shtml                     ////
38
////                                                              ////
39
//////////////////////////////////////////////////////////////////////
40
 
41
`include "oc_mac.h"
42
`include "oc_mac_crc_func.h"
43
 
44
module rx_enqueue(
45
                input wire              clk,
46
                input wire              res_n,
47
 
48
                input wire [63:0]        xgmii_rxd,
49
                input wire [7:0] xgmii_rxc,
50
 
51
 
52
 
53
                output reg [63:0]        xgmii_data_in,
54
                output reg [7:0] xgmii_data_status,
55
 
56
 
57
                output reg [1:0] local_fault_msg_det,
58
                output reg [1:0] remote_fault_msg_det,
59
 
60
                output reg              status_fragment_error_tog,
61
                output reg              status_pause_frame_rx_tog);
62
 
63
 
64
reg [63:32]     xgmii_rxd_d1;
65
reg [7:4]       xgmii_rxc_d1;
66
 
67
reg [63:0]       xgxs_rxd_barrel;
68
reg [7:0]        xgxs_rxc_barrel;
69
 
70
reg [63:0]       xgxs_rxd_barrel_d1;
71
reg [7:0]        xgxs_rxc_barrel_d1;
72
 
73
reg [63:0]       rx_inc_data;
74
reg [7:0]        rx_inc_status;
75
 
76
reg             barrel_shift;
77
 
78
reg [31:0]       crc32_d64;
79
 
80
`ifdef SIMULATION
81
reg             crc_good;
82
`endif
83
reg             crc_clear;
84
 
85
reg [31:0]       crc_rx;
86
reg [31:0]       next_crc_rx;
87
 
88
reg [2:0]        curr_state;
89
reg [2:0]        next_state;
90
 
91
reg [13:0]       curr_byte_cnt;
92
reg [13:0]       next_byte_cnt;
93
 
94
reg             fragment_error;
95
 
96
 
97
 
98
reg [7:0]        addmask;
99
reg [7:0]        datamask;
100
 
101
reg             pause_frame;
102
reg             next_pause_frame;
103
 
104
 
105
 
106
 
107
 
108
 
109
 
110
parameter [2:0]
111
        SM_IDLE = 3'd0,
112
        SM_RX = 3'd1;
113
 
114
 
115
 
116
 
117
`ifdef ASYNC_RES
118
always @(posedge clk or negedge res_n) `else
119
always @(posedge clk) `endif
120
begin
121
        if (res_n == 1'b0) begin
122
 
123
 
124
                xgmii_data_in <= 64'b0;
125
                xgmii_data_status <= 8'b0;
126
                xgmii_rxd_d1 <= 32'b0;
127
                xgmii_rxc_d1 <= 4'b0;
128
 
129
                xgxs_rxd_barrel <= 64'b0;
130
                xgxs_rxc_barrel <= 8'b0;
131
 
132
                xgxs_rxd_barrel_d1 <= 64'b0;
133
                xgxs_rxc_barrel_d1 <= 8'b0;
134
 
135
                barrel_shift <= 1'b0;
136
 
137
                local_fault_msg_det <= 2'b0;
138
                remote_fault_msg_det <= 2'b0;
139
 
140
                crc32_d64 <= 32'b0;
141
 
142
                crc_rx <= 32'b0;
143
 
144
                status_fragment_error_tog <= 1'b0;
145
 
146
                status_pause_frame_rx_tog <= 1'b0;
147
 
148
 
149
                //sm
150
                curr_state <= SM_IDLE;
151
                curr_byte_cnt <= 14'b0;
152
                pause_frame <= 1'b0;
153
 
154
 
155
        end
156
        else begin
157
                //sm
158
 
159
                xgmii_data_in <= rx_inc_data;
160
                xgmii_data_status <= rx_inc_status;
161
 
162
 
163
                curr_state <= next_state;
164
                curr_byte_cnt <= next_byte_cnt;
165
                pause_frame <= next_pause_frame;
166
 
167
 
168
                //---
169
                // Link status RC layer
170
                // Look for local/remote messages on lower 4 lanes and upper
171
                // 4 lanes. This is a 64-bit interface but look at each 32-bit
172
                // independantly.
173
 
174
                local_fault_msg_det[1] <= (xgmii_rxd[63:32] ==
175
                                        {`LOCAL_FAULT, 8'h0, 8'h0, `SEQUENCE} &&
176
                                        xgmii_rxc[7:4] == 4'b0001);
177
 
178
                local_fault_msg_det[0] <= (xgmii_rxd[31:0] ==
179
                                        {`LOCAL_FAULT, 8'h0, 8'h0, `SEQUENCE} &&
180
                                        xgmii_rxc[3:0] == 4'b0001);
181
 
182
                remote_fault_msg_det[1] <= (xgmii_rxd[63:32] ==
183
                                        {`REMOTE_FAULT, 8'h0, 8'h0, `SEQUENCE} &&
184
                                        xgmii_rxc[7:4] == 4'b0001);
185
 
186
                remote_fault_msg_det[0] <= (xgmii_rxd[31:0] ==
187
                                        {`REMOTE_FAULT, 8'h0, 8'h0, `SEQUENCE} &&
188
                                        xgmii_rxc[3:0] == 4'b0001);
189
 
190
 
191
 
192
 
193
 
194
                //---
195
                // Rotating barrel. This function allow us to always align the start of
196
                // a frame with LANE0. If frame starts in LANE4, it will be shifted 4 bytes
197
                // to LANE0, thus reducing the amount of logic needed at the next stage.
198
 
199
                xgmii_rxd_d1[63:32] <= xgmii_rxd[63:32];
200
                xgmii_rxc_d1[7:4] <= xgmii_rxc[7:4];
201
 
202
                if (xgmii_rxd[`LANE0] == `START && xgmii_rxc[0]) begin
203
 
204
                        xgxs_rxd_barrel <= xgmii_rxd;
205
                        xgxs_rxc_barrel <= xgmii_rxc;
206
 
207
                        barrel_shift <= 1'b0;
208
 
209
                end
210
                else if (xgmii_rxd[`LANE4] == `START && xgmii_rxc[4]) begin
211
 
212
                        xgxs_rxd_barrel <= {xgmii_rxd[31:0], xgmii_rxd_d1[63:32]};
213
                        xgxs_rxc_barrel <= {xgmii_rxc[3:0], xgmii_rxc_d1[7:4]};
214
 
215
                        barrel_shift <= 1'b1;
216
 
217
                end
218
                else if (barrel_shift) begin
219
 
220
                        xgxs_rxd_barrel <= {xgmii_rxd[31:0], xgmii_rxd_d1[63:32]};
221
                        xgxs_rxc_barrel <= {xgmii_rxc[3:0], xgmii_rxc_d1[7:4]};
222
 
223
                end
224
                else begin
225
 
226
                        xgxs_rxd_barrel <= xgmii_rxd;
227
                        xgxs_rxc_barrel <= xgmii_rxc;
228
 
229
                end
230
 
231
                xgxs_rxd_barrel_d1 <= xgxs_rxd_barrel;
232
                xgxs_rxc_barrel_d1 <= xgxs_rxc_barrel;
233
 
234
 
235
                crc_rx <= next_crc_rx;
236
 
237
                if (crc_clear) begin
238
 
239
                // CRC is cleared at the beginning of the frame, calculate
240
                // 64-bit at a time otherwise
241
 
242
                        crc32_d64 <= 32'hffffffff;
243
 
244
                end
245
                else begin
246
 
247
                        crc32_d64 <= next_crc32_data64_be(reverse_64b(xgxs_rxd_barrel_d1), crc32_d64, 3'b0);
248
 
249
                end
250
 
251
                //---
252
                // Error detection
253
 
254
 
255
                if (fragment_error) begin
256
                        status_fragment_error_tog <= ~status_fragment_error_tog;
257
                end
258
 
259
 
260
                //---
261
                // Frame receive indication
262
 
263
//              if (good_pause_frame) begin
264
//              status_pause_frame_rx_tog <= ~status_pause_frame_rx_tog;
265
//              end
266
 
267
        end
268
 
269
        end
270
 
271
 
272
 
273
always @(/*AS*/crc_rx or curr_byte_cnt or curr_state
274
        or pause_frame or xgxs_rxc_barrel or xgxs_rxc_barrel_d1
275
        or xgxs_rxd_barrel or xgxs_rxd_barrel_d1)
276
begin
277
 
278
        next_state = curr_state;
279
 
280
        rx_inc_data = xgxs_rxd_barrel_d1;
281
        rx_inc_status = `RXSTATUS_NONE;
282
 
283
 
284
        addmask[0] = !(xgxs_rxd_barrel_d1[`LANE0] == `TERMINATE && xgxs_rxc_barrel_d1[0]);
285
        addmask[1] = !(xgxs_rxd_barrel_d1[`LANE1] == `TERMINATE && xgxs_rxc_barrel_d1[1]);
286
        addmask[2] = !(xgxs_rxd_barrel_d1[`LANE2] == `TERMINATE && xgxs_rxc_barrel_d1[2]);
287
        addmask[3] = !(xgxs_rxd_barrel_d1[`LANE3] == `TERMINATE && xgxs_rxc_barrel_d1[3]);
288
        addmask[4] = !(xgxs_rxd_barrel_d1[`LANE4] == `TERMINATE && xgxs_rxc_barrel_d1[4]);
289
        addmask[5] = !(xgxs_rxd_barrel_d1[`LANE5] == `TERMINATE && xgxs_rxc_barrel_d1[5]);
290
        addmask[6] = !(xgxs_rxd_barrel_d1[`LANE6] == `TERMINATE && xgxs_rxc_barrel_d1[6]);
291
        addmask[7] = !(xgxs_rxd_barrel_d1[`LANE7] == `TERMINATE && xgxs_rxc_barrel_d1[7]);
292
 
293
        datamask[0] = addmask[0];
294
        datamask[1] = &addmask[1:0];
295
        datamask[2] = &addmask[2:0];
296
        datamask[3] = &addmask[3:0];
297
        datamask[4] = &addmask[4:0];
298
        datamask[5] = &addmask[5:0];
299
        datamask[6] = &addmask[6:0];
300
        datamask[7] = &addmask[7:0];
301
 
302
 
303
        next_crc_rx = crc_rx;
304
        crc_clear = 1'b0;
305
        `ifdef SIMULATION
306
        crc_good = 1'b0;
307
        `endif
308
 
309
 
310
        next_byte_cnt = curr_byte_cnt;
311
 
312
        fragment_error = 1'b0;
313
 
314
        next_pause_frame = pause_frame;
315
 
316
        case (curr_state)
317
 
318
                SM_IDLE: begin
319
                        next_byte_cnt = 14'b0;
320
                        crc_clear = 1'b1;
321
                        next_pause_frame = 1'b0;
322
 
323
 
324
                        // Detect the start of a frame
325
 
326
                        if (xgxs_rxd_barrel_d1[`LANE0] == `START && xgxs_rxc_barrel_d1[0] &&
327
                                xgxs_rxd_barrel_d1[`LANE1] == `PREAMBLE && !xgxs_rxc_barrel_d1[1] &&
328
                                xgxs_rxd_barrel_d1[`LANE2] == `PREAMBLE && !xgxs_rxc_barrel_d1[2] &&
329
                                xgxs_rxd_barrel_d1[`LANE3] == `PREAMBLE && !xgxs_rxc_barrel_d1[3] &&
330
                                xgxs_rxd_barrel_d1[`LANE4] == `PREAMBLE && !xgxs_rxc_barrel_d1[4] &&
331
                                xgxs_rxd_barrel_d1[`LANE5] == `PREAMBLE && !xgxs_rxc_barrel_d1[5] &&
332
                                xgxs_rxd_barrel_d1[`LANE6] == `PREAMBLE && !xgxs_rxc_barrel_d1[6] &&
333
                                xgxs_rxd_barrel_d1[`LANE7] == `SFD && !xgxs_rxc_barrel_d1[7])
334
                        begin
335
                                next_state = SM_RX;
336
                        end
337
 
338
                end
339
 
340
                SM_RX:  begin
341
 
342
                        rx_inc_status[`RXSTATUS_VALID] = 1'b1;
343
 
344
                        if (xgxs_rxd_barrel_d1[`LANE0] == `START && xgxs_rxc_barrel_d1[0] &&
345
                                xgxs_rxd_barrel_d1[`LANE7] == `SFD && !xgxs_rxc_barrel_d1[7]) begin
346
 
347
                                // Fragment received, if we are still at SOP stage don't store
348
                                // the frame. If not, write a fake EOP and flag frame as bad.
349
 
350
                                next_byte_cnt = 14'b0;
351
                                crc_clear = 1'b1;
352
 
353
                                fragment_error = 1'b1;
354
                                rx_inc_status[`RXSTATUS_ERR] = 1'b1;
355
 
356
                                if (curr_byte_cnt == 14'b0) begin
357
                                        //rxhfifo_wen = 1'b0;
358
                                end
359
                                else begin
360
                                        rx_inc_status[`RXSTATUS_EOP] = 1'b1;
361
                                end
362
 
363
                        end
364
                        else if (curr_byte_cnt +datamask[0] + datamask[1] + datamask[2] + datamask[3] +
365
                                                datamask[4] + datamask[5] + datamask[6] + datamask[7] > 14'd1518) begin //6 da + 6 sa +2 typelength, +1500 payload +4 crc
366
 
367
                                // Frame too long, TERMMINATE must have been corrupted.
368
                                // Abort transfer, write a fake EOP, report as fragment.
369
 
370
                                fragment_error = 1'b1;
371
                                rx_inc_status[`RXSTATUS_ERR] = 1'b1;
372
 
373
                                rx_inc_status[`RXSTATUS_EOP] = 1'b1;
374
                                next_state = SM_IDLE;
375
 
376
                        end
377
                        else begin
378
 
379
                                // Pause frame receive, these frame will be filtered
380
                                //- TODO
381
                                if (curr_byte_cnt == 14'd0 && xgxs_rxd_barrel_d1[47:0] == `PAUSE_FRAME) begin
382
 
383
                                //rxhfifo_wen = 1'b0; 
384
                                        next_pause_frame = 1'b1;
385
                                end
386
 
387
 
388
 
389
                                // Write SOP to status bits during first byte
390
 
391
                                if (curr_byte_cnt == 14'b0) begin
392
                                        rx_inc_status[`RXSTATUS_SOP] = 1'b1;
393
                                end
394
 
395
                                next_byte_cnt = curr_byte_cnt +
396
                                                addmask[0] + addmask[1] + addmask[2] + addmask[3] +
397
                                                addmask[4] + addmask[5] + addmask[6] + addmask[7];
398
 
399
 
400
 
401
 
402
 
403
 
404
                                // Look one cycle ahead for TERMINATE in lanes 0 to 4
405
                                if (curr_byte_cnt + datamask[0] + datamask[1] + datamask[2] + datamask[3] +
406
                                                datamask[4] + datamask[5] + datamask[6] + datamask[7] < 14'd64 && |(xgxs_rxc_barrel_d1 & datamask) ) begin // ethernet min. 64 byte check
407
 
408
                                        next_state = SM_IDLE;
409
                                        rx_inc_status[`RXSTATUS_ERR] = 1'b1;
410
                                        rx_inc_status[`RXSTATUS_EOP] = 1'b1;
411
 
412
 
413
 
414
                                end
415
                                else if (xgxs_rxd_barrel[`LANE4] == `TERMINATE && xgxs_rxc_barrel[4]) begin
416
 
417
                                        rx_inc_status[`RXSTATUS_EOP] = 1'b1;
418
                                        rx_inc_status[2:0] = 3'd0;
419
 
420
                                        if (  xgxs_rxd_barrel[31:0] !=  ~reverse_32b(next_crc32_data64_be(reverse_64b(xgxs_rxd_barrel_d1), crc32_d64, 3'b000))) begin
421
                                                rx_inc_status[`RXSTATUS_ERR] = 1'b1;
422
                                                `ifdef SIMULATION
423
                                                crc_good = 1'b0;
424
                                                `endif
425
                                        end
426
                                        `ifdef SIMULATION
427
                                        else begin
428
                                                crc_good = 1'b1;
429
                                        end
430
                                        `endif
431
                                        next_state = SM_IDLE;
432
 
433
                                end
434
 
435
                                else if (xgxs_rxd_barrel[`LANE3] == `TERMINATE && xgxs_rxc_barrel[3]) begin
436
 
437
                                        rx_inc_status[`RXSTATUS_EOP] = 1'b1;
438
                                        rx_inc_status[2:0] = 3'd7;
439
 
440
                                        if (  {xgxs_rxd_barrel[23:0], xgxs_rxd_barrel_d1[63:56]} !=  ~reverse_32b(next_crc32_data64_be(reverse_64b(xgxs_rxd_barrel_d1), crc32_d64, 3'b111))) begin
441
                                                rx_inc_status[`RXSTATUS_ERR] = 1'b1;
442
                                                `ifdef SIMULATION
443
                                                crc_good = 1'b0;
444
                                                `endif
445
                                        end
446
                                        `ifdef SIMULATION
447
                                        else begin
448
                                                crc_good = 1'b1;
449
                                        end
450
                                        `endif
451
                                        next_state = SM_IDLE;
452
 
453
                                end
454
 
455
                                else if (xgxs_rxd_barrel[`LANE2] == `TERMINATE && xgxs_rxc_barrel[2]) begin
456
 
457
                                        rx_inc_status[`RXSTATUS_EOP] = 1'b1;
458
                                        rx_inc_status[2:0] = 3'd6;
459
 
460
                                        if (  {xgxs_rxd_barrel[15:0], xgxs_rxd_barrel_d1[63:48]} !=  ~reverse_32b(next_crc32_data64_be(reverse_64b(xgxs_rxd_barrel_d1), crc32_d64, 3'b110))) begin
461
                                                rx_inc_status[`RXSTATUS_ERR] = 1'b1;
462
                                                `ifdef SIMULATION
463
                                                crc_good = 1'b0;
464
                                                `endif
465
                                        end
466
                                        `ifdef SIMULATION
467
                                        else begin
468
                                                crc_good = 1'b1;
469
                                        end
470
                                        `endif
471
                                        next_state = SM_IDLE;
472
 
473
                                end
474
 
475
                                else if (xgxs_rxd_barrel[`LANE1] == `TERMINATE && xgxs_rxc_barrel[1]) begin
476
 
477
                                        rx_inc_status[`RXSTATUS_EOP] = 1'b1;
478
                                        rx_inc_status[2:0] = 3'd5;
479
 
480
                                        if ( {xgxs_rxd_barrel[7:0], xgxs_rxd_barrel_d1[63:40]} !=  ~reverse_32b(next_crc32_data64_be(reverse_64b(xgxs_rxd_barrel_d1), crc32_d64, 3'b101))) begin
481
                                                rx_inc_status[`RXSTATUS_ERR] = 1'b1;
482
                                                `ifdef SIMULATION
483
                                                crc_good = 1'b0;
484
                                                `endif
485
                                        end
486
                                        `ifdef SIMULATION
487
                                        else begin
488
                                                crc_good = 1'b1;
489
                                        end
490
                                        `endif
491
                                        next_state = SM_IDLE;
492
 
493
                                end
494
 
495
                                else if (xgxs_rxd_barrel[`LANE0] == `TERMINATE && xgxs_rxc_barrel[0]) begin
496
 
497
                                        rx_inc_status[`RXSTATUS_EOP] = 1'b1;
498
                                        rx_inc_status[2:0] = 3'd4;
499
 
500
                                        if ( xgxs_rxd_barrel_d1[63:32] !=  ~reverse_32b(next_crc32_data64_be(reverse_64b(xgxs_rxd_barrel_d1), crc32_d64, 3'b100))) begin
501
                                                rx_inc_status[`RXSTATUS_ERR] = 1'b1;
502
                                                `ifdef SIMULATION
503
                                                crc_good = 1'b0;
504
                                                `endif
505
                                        end
506
                                        `ifdef SIMULATION
507
                                        else begin
508
                                                crc_good = 1'b1;
509
                                        end
510
                                        `endif
511
                                        next_state = SM_IDLE;
512
 
513
                                end
514
 
515
                                // Look at current cycle for TERMINATE in lanes 5 to 7
516
 
517
                                else if (xgxs_rxd_barrel_d1[`LANE7] == `TERMINATE &&
518
                                        xgxs_rxc_barrel_d1[7]) begin
519
 
520
                                        rx_inc_status[`RXSTATUS_EOP] = 1'b1;
521
                                        rx_inc_status[2:0] = 3'd3;
522
 
523
                                        if ( xgxs_rxd_barrel_d1[55:24] !=  ~reverse_32b(next_crc32_data64_be(reverse_64b(xgxs_rxd_barrel_d1), crc32_d64, 3'b011))) begin
524
                                                rx_inc_status[`RXSTATUS_ERR] = 1'b1;
525
                                                `ifdef SIMULATION
526
                                                crc_good = 1'b0;
527
                                                `endif
528
                                        end
529
                                        `ifdef SIMULATION
530
                                        else begin
531
                                                crc_good = 1'b1;
532
                                        end
533
                                        `endif
534
                                        next_state = SM_IDLE;
535
 
536
                                end
537
 
538
                                else if (xgxs_rxd_barrel_d1[`LANE6] == `TERMINATE &&
539
                                        xgxs_rxc_barrel_d1[6]) begin
540
 
541
                                        rx_inc_status[`RXSTATUS_EOP] = 1'b1;
542
                                        rx_inc_status[2:0] = 3'd2;
543
 
544
                                        if ( xgxs_rxd_barrel_d1[47:16] != ~reverse_32b(next_crc32_data64_be(reverse_64b(xgxs_rxd_barrel_d1), crc32_d64, 3'b010))) begin
545
                                                rx_inc_status[`RXSTATUS_ERR] = 1'b1;
546
                                                `ifdef SIMULATION
547
                                                crc_good = 1'b0;
548
                                                `endif
549
                                        end
550
                                        `ifdef SIMULATION
551
                                        else begin
552
                                                crc_good = 1'b1;
553
                                        end
554
                                        `endif
555
                                        next_state = SM_IDLE;
556
 
557
                                end
558
 
559
                                else if (xgxs_rxd_barrel_d1[`LANE5] == `TERMINATE &&
560
                                        xgxs_rxc_barrel_d1[5]) begin
561
 
562
                                        rx_inc_status[`RXSTATUS_EOP] = 1'b1;
563
                                        rx_inc_status[2:0] = 3'd1;
564
                                        if ( xgxs_rxd_barrel_d1[39:8] != ~reverse_32b(next_crc32_data64_be(reverse_64b(xgxs_rxd_barrel_d1), crc32_d64, 3'b001))) begin
565
                                                rx_inc_status[`RXSTATUS_ERR] = 1'b1;
566
                                                `ifdef SIMULATION
567
                                                crc_good = 1'b0;
568
                                                `endif
569
                                        end
570
                                        `ifdef SIMULATION
571
                                        else begin
572
                                                crc_good = 1'b1;
573
                                        end
574
                                        `endif
575
 
576
                                        next_state = SM_IDLE;
577
 
578
                                end
579
                                else if(|(xgxs_rxc_barrel_d1 & datamask)) begin // no terminate signal, but cmd != 0
580
                                        `ifdef SIMULATION
581
                                        crc_good = 1'b0;
582
                                        `endif
583
                                        rx_inc_status[`RXSTATUS_ERR] = 1'b1;
584
                                        rx_inc_status[`RXSTATUS_EOP] = 1'b1;
585
                                        next_state = SM_IDLE;
586
 
587
 
588
                                end
589
                                `ifdef SIMULATION
590
                                else begin
591
                                        crc_good = 1'b0;
592
                                end
593
                                `endif
594
 
595
                        end
596
                end
597
 
598
                default: begin
599
                        next_state = SM_IDLE;
600
                end
601
 
602
        endcase
603
 
604
end
605
 
606
 
607
endmodule
608
 

powered by: WebSVN 2.1.0

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