Initial commit of OpenSPARC T2 design and verification files.
[OpenSPARC-T2-DV] / verif / env / niu / rxc_sat / vera / rxdma / niu_rx_crentry.vr
CommitLineData
86530b38
AT
1// ========== Copyright Header Begin ==========================================
2//
3// OpenSPARC T2 Processor File: niu_rx_crentry.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#include "pcg_defines.vri"
38
39// Completion ring Error defines
40#define CR_NO_ERROR 0
41#define CR_L2_ERROR 1
42#define CR_L4_ERROR 3
43#define CR_FFLP_ERROR 4
44#define CR_ZCP_ERROR 5
45
46// copied from niu_rx_descp_cr.vr
47class Ccr_entry {
48 bit [63:0] entry;
49 bit [63:0] address;
50
51 bit multi;
52 bit [1:0] pkt_type;
53 bit zcp,promis,dcf_error;
54 bit frag;
55 bit no_port;
56 bit dcf_err;
57 bit [2:0] errors;
58 bit[13:0] length;
59 bit [1:0] pktbufsz;
60 bit[63:0] pkt_buf_address;
61
62 task new(){
63 entry = 0;
64 }
65
66 task print() {
67 printf(" CR DEBUG - Entry =%x Address - %x \n",entry,address);
68 printf(" CR DEBUG - multi - %b, promis - %b, errors - %b pkt_type = %b length - %d pktbufsz - %b address - %x \n",entry[63],entry[58],entry[57:55],entry[62:61], entry[53:40], entry[39:38], entry[37:0]);
69 }
70 task set_fields(bit[63:0] data) {
71 pkt_buf_address = 64'h0;
72 multi = data[63];
73 pkt_type = data[62:61];
74 zcp = data[60];
75 no_port = data[59];
76 promis = data[58];
77 errors = data[57:55];
78 dcf_err = data[54];
79 length = data[53:40];
80 pktbufsz = data[39:38];
81 pkt_buf_address[43:6] = data[37:0];
82 }
83 function integer setCRErrorCode(integer error_code) {
84 if ((error_code&PG_CHKSUM_ERR)|( error_code&PG_CHKSUM_USER_DEF)) {
85 if (!frag)
86 setCRErrorCode = CR_L4_ERROR;
87 else
88 setCRErrorCode = CR_NO_ERROR;
89 } else if((error_code&PG_CRC_ERR)|( error_code&PG_TYPE_LEN_ERR)) {
90 setCRErrorCode = CR_L2_ERROR;
91 } else setCRErrorCode = CR_NO_ERROR;
92 // Add more stuff here for FFLP & ZCP ERROR
93 }
94}
95MakeVeraList(Ccr_entry) // list of completion ring entries
96
97
98class Ccr_update {
99 integer dma_no;
100 integer no_of_entries;
101 task new(){}
102}
103class Crcr_update {
104 integer dma_no;
105 integer no_of_entries;
106 integer pkts_checked;
107 integer scatters[*];
108 task new(){}
109}