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

Subversion Repositories loadbalancer

[/] [loadbalancer/] [trunk/] [ethernet_parser.v.bak] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 atalla
///////////////////////////////////////////////////////////////////////////////
2
// $Id: ethernet_parser.v 1976 2007-07-20 00:59:57Z grg $
3
//
4
// Module: ethernet_parser.v
5
// Project: NF2.1
6
// Description: parses the Ethernet header for a 32 or 64 bit datapath
7
//
8
///////////////////////////////////////////////////////////////////////////////
9
`timescale 1ns/1ps
10
  module ethernet_parser
11
    #(parameter DATA_WIDTH = 64,
12
      parameter CTRL_WIDTH=DATA_WIDTH/8,
13
      parameter NUM_IQ_BITS = 3,
14
      parameter INPUT_ARBITER_STAGE_NUM = 2
15
      )
16
   (// --- Interface to the previous stage
17
    input  [DATA_WIDTH-1:0]            in_data,
18
    input  [CTRL_WIDTH-1:0]            in_ctrl,
19
    input                              in_wr,
20
 
21
    // --- Interface to output_port_lookup
22
    output [47:0]                      dst_mac,
23
    output [47:0]                      src_mac,
24
    output [15:0]                      ethertype,
25
    output                             eth_done,
26
    output [NUM_IQ_BITS-1:0]           src_port,
27
 
28
    // --- Misc
29
 
30
    input                              reset,
31
    input                              clk
32
   );
33
 
34
   generate
35
   genvar i;
36
   if(DATA_WIDTH==64) begin: eth_parser_64bit
37
      ethernet_parser_64bit
38
        #(
39
          .NUM_IQ_BITS(NUM_IQ_BITS),
40
          .INPUT_ARBITER_STAGE_NUM(INPUT_ARBITER_STAGE_NUM))
41
         eth_parser
42
           (.in_data(in_data),
43
            .in_ctrl(in_ctrl),
44
            .in_wr(in_wr),
45
            .eth_done (eth_done),
46
            .src_port(src_port),
47
            .reset(reset),
48
            .clk(clk));
49
   end // block: eth_parser_64bit
50
   else if(DATA_WIDTH==32) begin: eth_parser_32bit
51
      ethernet_parser_32bit
52
        #(
53
          .NUM_IQ_BITS(NUM_IQ_BITS),
54
          .INPUT_ARBITER_STAGE_NUM(INPUT_ARBITER_STAGE_NUM))
55
         eth_parser
56
           (.in_data(in_data),
57
            .in_ctrl(in_ctrl),
58
            .in_wr(in_wr),
59
            .dst_mac (dst_mac),
60
            .src_mac(src_mac),
61
            .ethertype (ethertype),
62
            .eth_done (eth_done),
63
            .src_port(src_port),
64
            .reset(reset),
65
            .clk(clk));
66
   end // block: eth_parser_32bit
67
   endgenerate
68
 
69
 
70
 
71
endmodule // ethernet_parser_64bit

powered by: WebSVN 2.1.0

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