Initial commit of OpenSPARC T2 design and verification files.
[OpenSPARC-T2-DV] / verif / env / fnx / vlib / CCCXactor / vera / CCCXactorTransaction.vr
CommitLineData
86530b38
AT
1// ========== Copyright Header Begin ==========================================
2//
3// OpenSPARC T2 Processor File: CCCXactorTransaction.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 "CTTransactionID.vrh"
37//#include "CTSupportClasses.vrh"
38
39
40//------------------------------------------------------------------------------
41// Class Definition
42//
43//
44//
45//------------------------------------------------------------------------------
46
47class CCCXactorTransaction {
48
49 CTTransactionID RingXactionID;
50 bit error;
51 bit wr_rd_cmd;
52 bit [26:0] address;
53 bit [63:0] csr_data;
54 bit [1:0] src_bus_id;
55
56 task new();
57
58 function string toString();
59
60}
61
62
63 //***************************************************************
64 // Constructor
65 //
66 // - Initailize Transaction
67 // - read/write and scr bus id = x
68 // - Address and Data = 0
69 //
70 //***************************************************************
71
72task CCCXactorTransaction::new() {
73
74 RingXactionID = new;
75 error = 1'b0;
76 wr_rd_cmd = 1'bx;
77 address = 0;
78 csr_data = 0;
79 src_bus_id = 2'bxx;
80}
81
82
83 //***************************************************************
84 // toString Function
85 //
86 // - Returns a String
87 //
88 //***************************************************************
89
90
91function string CCCXactorTransaction::toString()
92{
93 string tmp;
94
95 sprintf( tmp, "[%0d %0d %0d]", RingXactionID.GetContextID(),
96 RingXactionID.GetStrategyID(),RingXactionID.GetTransID() );
97 toString = { tmp," ring transaction:\ncommand=" };
98
99 if( wr_rd_cmd === 1'b1 )
100 toString = { toString,"write " };
101 else
102 toString = { toString,"read " };
103
104 sprintf( tmp, "address=%h data=%h src bus id=%h error=%h\n",
105 address, csr_data, src_bus_id, error );
106 toString = { toString,tmp };
107}