Initial commit of OpenSPARC T2 design and verification files.
[OpenSPARC-T2-DV] / verif / env / niu / vera / niu_tokens / niu_rxtoken.vr
CommitLineData
86530b38
AT
1// ========== Copyright Header Begin ==========================================
2//
3// OpenSPARC T2 Processor File: niu_rxtoken.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#include <vera_defines.vrh>
36#include <ListMacros.vrh>
37
38// Check these
39#include "pcg_defines.vri"
40#include "pcg_types.vri"
41#include "pack_db.vrh"
42#include "flow_db.vrh"
43#include "flow_db_tasks.vrh"
44#include "pg_top_pp.vrh"
45#include "pc_top_pp.vrh"
46#include "pcg_token.vrh"
47#include "niu_rxtoken.vri"
48#include "niu_errclass.vrh"
49
50
51class CRxTestClass {
52 integer valid;
53 integer noOfsemIds;
54 integer semId[];
55 integer test_defines;
56 CNiuErrors errors;
57 task new((integer i = 0)) {
58 valid = i;
59 test_defines = 0;
60 errors = new();
61 }
62}
63class CRxErrorInfo {
64 // Members for Network Errors
65 integer error_code;
66 integer error_data;
67 // Members for Internal Errors
68
69 // Members for Host Errors
70
71 task new() {
72 error_code =0; // no error
73 }
74
75}
76
77class CRxToken { // This should be extended from the main token ..
78 integer id;
79 integer dma_num;
80 integer port_num;
81 integer pkt_length;
82 integer pkt_type; // To indicate if this packetis to be dropped by rdmc or not
83 integer valid;
84 CpgToken pgToken;
85 integer last_packet;
86
87 CRxErrorInfo error_info;
88 CRxTestClass rx_test_class;
89
90 // byte array for 18B control header information
91 byte_array rx_cntl_hdr;
92
93 // DMA Related variables
94 integer jumbo_pkt; // To be used for descriptor sche
95 integer header_length;
96 bit [63:0] packet_start_address[3];
97 bit [63:0] packet_virtaddress[3];
98 bit [63:0] packet_end_address[3];
99 bit [63:0] cr_address;
100
101 integer NoOfScatter;
102 bit [1:0] bufsz;
103 integer bytesperchunk[3];
104
105 task new(integer i = -1) {
106 id = i;
107 jumbo_pkt = 0;
108 last_packet = 0;
109 valid = 0;
110 header_length = 0;
111 error_info = new();
112 rx_test_class = new();
113 rx_cntl_hdr = new();
114 }
115
116 task print() {
117 printf(" TOKEN DEBUG id - %d port_num - %d dma_num - %d \n",id,port_num,dma_num);
118 }
119 function integer getPktClass() {
120 // Encoding based upon RDMC completion ring entry
121 integer frame_class;
122 frame_class = pgToken.pack_db.frame.frame_class;
123 getPktClass = frame_class;
124 }
125 function integer getErrorCode() {
126 getErrorCode = error_info.error_code;
127 }
128
129
130}