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

Subversion Repositories srdydrdy_lib

[/] [srdydrdy_lib/] [trunk/] [examples/] [bridge/] [rtl/] [bridge.vh] - Blame information for rev 31

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 4 ghutchis
 
2
// Address size for number of ports.  Default value 4,
3
// which will allow design to scale up to 16 ports
4
`define PORT_ASZ    4
5
 
6
// We will have only 4 ports in our sample design
7
`define NUM_PORTS   4
8
 
9 31 ghutchis
// Data structure from parser to Allocator/FIB.  Contains MAC DA,
10 4 ghutchis
// MAC SA, and source port
11
`define PAR_DATA_SZ (48+48+4)
12
`define PAR_MACDA    47:0
13
`define PAR_MACSA    95:48
14
`define PAR_SRCPORT  99:96
15
 
16 31 ghutchis
// additional information from allocator to FIB
17
`define A2F_STARTPG  111:100
18
`define A2F_ENDPG    123:112
19
 
20
// total size of parser+allocator structure to FIB
21
`define PM2F_SZ      124
22
 
23 4 ghutchis
// number of entries in FIB table
24
`define FIB_ENTRIES   256
25
`define FIB_ASZ       $clog2(`FIB_ENTRIES)
26
 
27
// FIB entry definition
28
`define FIB_ENTRY_SZ  60
29
`define FIB_MACADDR   47:0     // MAC address
30
`define FIB_AGE       55:48    // 8 bit age counter
31
`define FIB_PORT      59:56    // associated port
32
 
33
`define FIB_MAX_AGE   255      // maximum value of age timer
34
 
35 5 ghutchis
`define MULTICAST     48'h0100000000  // multicast bit
36
 
37
// Packet control codes
38
`define PCC_SOP     2'b01    // Start of packet
39
`define PCC_DATA    2'b00    // data word
40
`define PCC_EOP     2'b10    // End of packet
41
`define PCC_BADEOP  2'b11    // End of packet w/ error
42
 
43 31 ghutchis
`define ANY_EOP(x)   (( (x) == `PCC_EOP) || ( (x) == `PCC_BADEOP))
44
 
45 8 ghutchis
// Packet FIFO Word
46 31 ghutchis
`define PRW_DATA     63:0      // 64 bits of packet data
47
`define PRW_PCC      65:64     // packet control code
48
`define PRW_VALID    68:66     // # of valid bytes modulo 8
49
`define PFW_SZ       69
50 8 ghutchis
 
51
// Port FIFO sizes
52 13 ghutchis
`define RX_FIFO_DEPTH 256
53
`define TX_FIFO_DEPTH 1024
54 8 ghutchis
 
55
`define RX_USG_SZ     $clog2(`RX_FIFO_DEPTH)+1
56
`define TX_USG_SZ     $clog2(`TX_FIFO_DEPTH)+1
57
 
58 31 ghutchis
// Linked List Definitions
59
`define LL_PAGES     4096
60
`define LL_PG_ASZ    $clog2(`LL_PAGES)
61 5 ghutchis
 
62 31 ghutchis
`define LL_ENDPAGE   { 1'b1, {`LL_PG_ASZ{1'b0}} }
63 8 ghutchis
 
64 31 ghutchis
`define LL_MAX_REF   16
65
`define LL_REFSZ     4
66
 
67
`define LL_LNP_SZ    (`LL_PG_ASZ*2+1)
68
 
69
 
70
// Packet buffer size
71
`define PB_LINES_PER_PAGE 4
72
`define PB_DEPTH     (`LL_PAGES*`PB_LINES_PER_PAGE)
73
`define PB_ASZ       $clog2(`PB_DEPTH)
74
 
75
// Packet buffer request structure
76
`define PBR_DATA     68:0    // only valid for writes
77
`define PBR_ADDR     82:69
78
`define PBR_WRITE    83
79
`define PBR_PORT     87:84   // only valid for reads
80
`define PBR_SZ       88
81
 
82 8 ghutchis
// GMII definitions
83
`define GMII_PRE     8'h55
84
`define GMII_SFD     8'hD5

powered by: WebSVN 2.1.0

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