Commit | Line | Data |
---|---|---|
86530b38 AT |
1 | // ========== Copyright Header Begin ========================================== |
2 | // | |
3 | // OpenSPARC T2 Processor File: pcg_classes.vr | |
4 | // Copyright (C) 1995-2007 Sun Microsystems, Inc. All Rights Reserved | |
5 | // 4150 Network Circle, Santa Clara, California 95054, U.S.A. | |
6 | // | |
7 | // * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | |
8 | // | |
9 | // This program is free software; you can redistribute it and/or modify | |
10 | // it under the terms of the GNU General Public License as published by | |
11 | // the Free Software Foundation; version 2 of the License. | |
12 | // | |
13 | // This program is distributed in the hope that it will be useful, | |
14 | // but WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
16 | // GNU General Public License for more details. | |
17 | // | |
18 | // You should have received a copy of the GNU General Public License | |
19 | // along with this program; if not, write to the Free Software | |
20 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
21 | // | |
22 | // For the avoidance of doubt, and except that if any non-GPL license | |
23 | // choice is available it will apply instead, Sun elects to use only | |
24 | // the General Public License version 2 (GPLv2) at this time for any | |
25 | // software where a choice of GPL license versions is made | |
26 | // available with the language indicating that GPLv2 or any later version | |
27 | // may be used, or where a choice of which version of the GPL is applied is | |
28 | // otherwise unspecified. | |
29 | // | |
30 | // Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, | |
31 | // CA 95054 USA or visit www.sun.com if you need additional information or | |
32 | // have any questions. | |
33 | // | |
34 | // ========== Copyright Header End ============================================ | |
35 | class byte_array { | |
36 | bit [7:0] val[]; | |
37 | } | |
38 | ||
39 | ||
40 | // ----- Node Descriptor ----- | |
41 | class node_desc { | |
42 | bit [47:0] l2_addr; // L2 address for this station | |
43 | bit [15:0] tci; // Tag Control Information | |
44 | bit [31:0] ip_addr; // IPv4 address of this substation | |
45 | bit [128:0] ipv6_addr; // IPv6 address of this substation | |
46 | bit [7:0] tos =0; // TOS v4/Frame Class v6 | |
47 | bit [19:0] src_port; // Which ports may use this node as source | |
48 | bit [31:0] spi = 0; // Security Parameter Index for AH /ESP | |
49 | bit [7:0] nxthdr = 06; | |
50 | ||
51 | } | |
52 | ||
53 | // ----- TCP/UDP Ports Descriptor ----- | |
54 | class tup_descr { | |
55 | bit [15:0] src_tcp_udp_port; // Source TCP/UDP Port | |
56 | bit [15:0] dst_tcp_udp_port; // Destination TCP/UDP Port | |
57 | ||
58 | } | |
59 | ||
60 | // ----- Frame Descriptor ----- | |
61 | class frame_desc { | |
62 | bit [4:0] frame_type = 0; // Frame Type (bit 3: 0=IPv4 Header 1=IPv6 Header) | |
63 | // bit 4: 0=Tunneling off | |
64 | bit [1:0] tunnel_type = 0;// selects between different tunneling combinations | |
65 | // 00: IPv4/IPv4 (default) | |
66 | // 01: IPv4/IPv6 | |
67 | // 10: IPv6/IPv4 | |
68 | // 11: IPv6/IPv6 | |
69 | integer frame_class; // L3 IP class | |
70 | integer type; // L3 IP class type (-1 = auto: length or type from class); | |
71 | integer tpid; // L2 Tagged frames custopm TPID value (-1 = use default) | |
72 | integer class_mask; // Mask to be applied to class | |
73 | integer class_funct; // Mask Operation (0-AND, 1-OR) | |
74 | integer data_type; // Type of payload | |
75 | integer data_seed; // Seed for random data | |
76 | //integer data_length; // Length of payload (-1=make exactly 64 byte packets) | |
77 | ||
78 | task new() { | |
79 | frame_type = 0; | |
80 | tunnel_type = 0; | |
81 | frame_class = 0; | |
82 | type = -1; | |
83 | tpid = -1; | |
84 | class_mask = 0; | |
85 | class_funct = 0; | |
86 | data_type = 0; | |
87 | data_seed = 0; | |
88 | //data_length = 0; | |
89 | } | |
90 | } | |
91 | ||
92 | ||
93 | // ----- TCP Tx Parameters ----- | |
94 | class tmt_param { | |
95 | bit [31:0] adv_isn; | |
96 | bit [31:0] last_seqno; | |
97 | bit retr_timeout; //Initialize to zero | |
98 | bit [15:0] adv_window_size;//Initialize to zero | |
99 | ||
100 | task new() { | |
101 | retr_timeout = 0; | |
102 | adv_window_size = 0; | |
103 | last_seqno = 0; | |
104 | } | |
105 | ||
106 | ||
107 | } | |
108 | ||
109 | // ----- TCP Rx Parameters ----- | |
110 | class rcv_param { | |
111 | bit [31:0] rcv_isn;//User Programs while Setting "SYN" | |
112 | bit [31:0] last_ackno; | |
113 | bit timeout; //Initialize to zero | |
114 | bit [15:0] rmt_window_size;//Initialize to zero | |
115 | ||
116 | task new() { | |
117 | timeout = 0; | |
118 | rmt_window_size = 0; | |
119 | } | |
120 | } | |
121 | ||
122 | ||
123 | // ----- TCP State Parameters ----- | |
124 | ||
125 | class tcp_state { | |
126 | bit [5:0] tcp_flags; | |
127 | bit [3:0] tcp_st;//Initialise to zero now | |
128 | ||
129 | task new() { | |
130 | //tcp_flags = 6'b00_0010;//{(URG,ACK,PSH,RST,SYN,FIN} | |
131 | tcp_st = 0; | |
132 | } | |
133 | } | |
134 | ||
135 | ||
136 | // ----- FLow Descriptor To Generate Packets of Various Flows ----- | |
137 | class flow_desc { | |
138 | ||
139 | frame_desc frame = new; | |
140 | node_desc src_node = new; | |
141 | node_desc dst_node = new; | |
142 | ||
143 | tup_descr tup = new; | |
144 | rcv_param rx_param = new; | |
145 | tmt_param tx_param = new; | |
146 | tcp_state fl_state = new ; | |
147 | integer flow_no; | |
148 | ||
149 | ||
150 | } | |
151 | ||
152 | ||
153 | // ----- Forwarding Descriptor ----- | |
154 | class fwd_desc { | |
155 | // Forwarding Decision from FFLP | |
156 | bit [23:0] fwd_decision[5]; | |
157 | } | |
158 | ||
159 | // ----- Class Descriptor ----- | |
160 | class l3_class_desc { | |
161 | bit [7:0] val[14]; | |
162 | } | |
163 | ||
164 | // ----- Class Mask Descriptor ----- | |
165 | class l3_class_mask { | |
166 | bit [7:0] val[14]; | |
167 | } |