1 |
2 |
acastong |
//synth_datatypes.cpp
|
2 |
|
|
|
3 |
|
|
/* ***** BEGIN LICENSE BLOCK *****
|
4 |
|
|
* Version: MPL 1.1
|
5 |
|
|
*
|
6 |
|
|
* The contents of this file are subject to the Mozilla Public License Version
|
7 |
|
|
* 1.1 (the "License"); you may not use this file except in compliance with
|
8 |
|
|
* the License. You may obtain a copy of the License at
|
9 |
|
|
* http://www.mozilla.org/MPL/
|
10 |
|
|
*
|
11 |
|
|
* Software distributed under the License is distributed on an "AS IS" basis,
|
12 |
|
|
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
13 |
|
|
* for the specific language governing rights and limitations under the
|
14 |
|
|
* License.
|
15 |
|
|
*
|
16 |
|
|
* The Original Code is HyperTransport Tunnel IP Core.
|
17 |
|
|
*
|
18 |
|
|
* The Initial Developer of the Original Code is
|
19 |
|
|
* Ecole Polytechnique de Montreal.
|
20 |
|
|
* Portions created by the Initial Developer are Copyright (C) 2005
|
21 |
|
|
* the Initial Developer. All Rights Reserved.
|
22 |
|
|
*
|
23 |
|
|
* Contributor(s):
|
24 |
|
|
* Ami Castonguay <acastong@grm.polymtl.ca>
|
25 |
|
|
*
|
26 |
|
|
* Alternatively, the contents of this file may be used under the terms
|
27 |
|
|
* of the Polytechnique HyperTransport Tunnel IP Core Source Code License
|
28 |
|
|
* (the "PHTICSCL License", see the file PHTICSCL.txt), in which case the
|
29 |
|
|
* provisions of PHTICSCL License are applicable instead of those
|
30 |
|
|
* above. If you wish to allow use of your version of this file only
|
31 |
|
|
* under the terms of the PHTICSCL License and not to allow others to use
|
32 |
|
|
* your version of this file under the MPL, indicate your decision by
|
33 |
|
|
* deleting the provisions above and replace them with the notice and
|
34 |
|
|
* other provisions required by the PHTICSCL License. If you do not delete
|
35 |
|
|
* the provisions above, a recipient may use your version of this file
|
36 |
|
|
* under either the MPL or the PHTICSCL License."
|
37 |
|
|
*
|
38 |
|
|
* ***** END LICENSE BLOCK ***** */
|
39 |
|
|
|
40 |
|
|
#include "synth_datatypes.h"
|
41 |
|
|
|
42 |
|
|
void sc_trace(sc_trace_file *tf, const syn_ControlPacketComplete& v,
|
43 |
|
|
const sc_string& NAME) {
|
44 |
|
|
sc_trace(tf,v.packet, NAME + ".packet");
|
45 |
|
|
sc_trace(tf,v.data_address, NAME + ".data_address");
|
46 |
|
|
sc_trace(tf,v.error64BitExtension, NAME + ".error64BitExtension");
|
47 |
|
|
//sc_trace(tf,v.testingTrackingNumber, NAME + ".testingTrackingNumber");
|
48 |
|
|
}
|
49 |
|
|
|
50 |
|
|
ostream &operator<<(ostream& out, const syn_ControlPacketComplete &pkt){
|
51 |
|
|
out << "Packet: " << pkt.packet << "\n";
|
52 |
|
|
out << "DataAddress: " << pkt.data_address << "\n";
|
53 |
|
|
out << "Error64BitExtension: " << pkt.error64BitExtension << "\n";
|
54 |
|
|
//out << "TestingTrackingNumber: " << pkt.testingTrackingNumber << "\n";
|
55 |
|
|
return out;
|
56 |
|
|
}
|
57 |
|
|
|
58 |
|
|
void sc_trace(sc_trace_file *tf, const syn_ResponseControlPacketComplete& v,
|
59 |
|
|
const sc_string& NAME) {
|
60 |
|
|
sc_trace(tf,v.packet, NAME + ".packet");
|
61 |
|
|
sc_trace(tf,v.data_address, NAME + ".data_address");
|
62 |
|
|
//sc_trace(tf,v.error64BitExtension, NAME + ".error64BitExtension");
|
63 |
|
|
//sc_trace(tf,v.testingTrackingNumber, NAME + ".testingTrackingNumber");
|
64 |
|
|
}
|
65 |
|
|
|
66 |
|
|
ostream &operator<<(ostream& out, const syn_ResponseControlPacketComplete &pkt){
|
67 |
|
|
out << "Packet: " << pkt.packet << "\n";
|
68 |
|
|
out << "DataAddress: " << pkt.data_address << "\n";
|
69 |
|
|
//out << "Error64BitExtension: " << pkt.error64BitExtension << "\n";
|
70 |
|
|
//out << "TestingTrackingNumber: " << pkt.testingTrackingNumber << "\n";
|
71 |
|
|
return out;
|
72 |
|
|
}
|
73 |
|
|
/*
|
74 |
|
|
ostream &operator<<(ostream &out,const PacketCommand &cmd){
|
75 |
|
|
switch(cmd){
|
76 |
|
|
case FLUSH :
|
77 |
|
|
out << "FLUSH";
|
78 |
|
|
break;
|
79 |
|
|
case WRITE :
|
80 |
|
|
out << "WRITE";
|
81 |
|
|
break;
|
82 |
|
|
case READ :
|
83 |
|
|
out << "READ";
|
84 |
|
|
break;
|
85 |
|
|
case RD_RESPONSE :
|
86 |
|
|
out << "RD_RESPONSE";
|
87 |
|
|
break;
|
88 |
|
|
case BROADCAST :
|
89 |
|
|
out << "BROADCAST";
|
90 |
|
|
break;
|
91 |
|
|
case FENCE :
|
92 |
|
|
out << "FENCE";
|
93 |
|
|
break;
|
94 |
|
|
case ATOMIC :
|
95 |
|
|
out << "ATOMIC";
|
96 |
|
|
break;
|
97 |
|
|
case TGTDONE :
|
98 |
|
|
out << "TGTDONE";
|
99 |
|
|
break;
|
100 |
|
|
case NOP :
|
101 |
|
|
out << "NOP";
|
102 |
|
|
break;
|
103 |
|
|
case SYNC :
|
104 |
|
|
out << "SYNC";
|
105 |
|
|
break;
|
106 |
|
|
default :
|
107 |
|
|
out << "RESERVED_CMD";
|
108 |
|
|
}
|
109 |
|
|
return out;
|
110 |
|
|
}
|
111 |
|
|
|
112 |
|
|
|
113 |
|
|
ostream &operator<<(ostream &out,const PacketType &type){
|
114 |
|
|
switch(type){
|
115 |
|
|
case INFO :
|
116 |
|
|
out << "INFO";
|
117 |
|
|
break;
|
118 |
|
|
case REQUEST :
|
119 |
|
|
out << "REQUEST";
|
120 |
|
|
break;
|
121 |
|
|
case RESPONSE :
|
122 |
|
|
out << "RESPONSE";
|
123 |
|
|
break;
|
124 |
|
|
default :
|
125 |
|
|
out << "RESERVED_TYPE";
|
126 |
|
|
}
|
127 |
|
|
return out;
|
128 |
|
|
}
|
129 |
|
|
|
130 |
|
|
ostream &operator<<(ostream &out,const VirtualChannel &vc){
|
131 |
|
|
switch(vc){
|
132 |
|
|
case VC_POSTED :
|
133 |
|
|
out << "VC_POSTED";
|
134 |
|
|
break;
|
135 |
|
|
case VC_NON_POSTED :
|
136 |
|
|
out << "VC_NON_POSTED";
|
137 |
|
|
break;
|
138 |
|
|
case VC_RESPONSE :
|
139 |
|
|
out << "VC_RESPONSE";
|
140 |
|
|
break;
|
141 |
|
|
default :
|
142 |
|
|
out << "VC_NONE";
|
143 |
|
|
}
|
144 |
|
|
return out;
|
145 |
|
|
}
|
146 |
|
|
|
147 |
|
|
ostream &operator<<(ostream &out,const ResponseError &re){
|
148 |
|
|
switch(re){
|
149 |
|
|
case RE_NORMAL :
|
150 |
|
|
out << "RE_NORMAL";
|
151 |
|
|
break;
|
152 |
|
|
case RE_TARGET_ABORT :
|
153 |
|
|
out << "RE_TARGET_ABORT";
|
154 |
|
|
break;
|
155 |
|
|
case RE_DATA_ERROR :
|
156 |
|
|
out << "RE_DATA_ERROR";
|
157 |
|
|
break;
|
158 |
|
|
case RE_MASTER_ABORT :
|
159 |
|
|
out << "RE_MASTER_ABORT";
|
160 |
|
|
}
|
161 |
|
|
return out;
|
162 |
|
|
}
|
163 |
|
|
*/
|
164 |
|
|
|
165 |
|
|
bool syn_ControlPacketComplete::operator== (const syn_ControlPacketComplete &pkt) const{
|
166 |
|
|
return (this->packet == pkt.packet &&
|
167 |
|
|
this->error64BitExtension == pkt.error64BitExtension &&
|
168 |
|
|
this->data_address == pkt.data_address /*&&
|
169 |
|
|
this->testingTrackingNumber == pkt.testingTrackingNumber*/);
|
170 |
|
|
}
|
171 |
|
|
|
172 |
|
|
syn_ControlPacketComplete::syn_ControlPacketComplete() :
|
173 |
|
|
error64BitExtension(0),
|
174 |
|
|
data_address(0),
|
175 |
|
|
packet(0)
|
176 |
|
|
|
177 |
|
|
{}
|
178 |
|
|
|
179 |
|
|
bool syn_ResponseControlPacketComplete::operator== (const syn_ResponseControlPacketComplete &pkt) const{
|
180 |
|
|
return (this->packet == pkt.packet &&
|
181 |
|
|
//this->error64BitExtension == pkt.error64BitExtension &&
|
182 |
|
|
this->data_address == pkt.data_address /*&&
|
183 |
|
|
this->testingTrackingNumber == pkt.testingTrackingNumber*/);
|
184 |
|
|
}
|
185 |
|
|
|
186 |
|
|
|
187 |
|
|
syn_ResponseControlPacketComplete::syn_ResponseControlPacketComplete() :
|
188 |
|
|
/*error64BitExtension(0),*/
|
189 |
|
|
data_address(0),
|
190 |
|
|
packet(0)
|
191 |
|
|
|
192 |
|
|
{}
|
193 |
|
|
|
194 |
|
|
void initialize_syn_ControlPacketComplete(syn_ControlPacketComplete &pkt){
|
195 |
|
|
pkt.packet = 0;
|
196 |
|
|
pkt.error64BitExtension = false;
|
197 |
|
|
pkt.isPartOfChain = false;
|
198 |
|
|
pkt.data_address = 0;
|
199 |
|
|
}
|
200 |
|
|
|
201 |
|
|
void initialize_syn_ResponseControlPacketComplete(syn_ResponseControlPacketComplete &pkt){
|
202 |
|
|
pkt.packet = 0;
|
203 |
|
|
pkt.data_address = 0;
|
204 |
|
|
}
|