Deleted Added
sdiff udiff text old ( 3135:8e008e281579 ) new ( 3156:2e6fc95d9ccf )
full compact
1/*
2 * Copyright (c) 2006 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

--- 160 unchanged lines hidden (view full) ---

169 IsRead = 1 << 0,
170 IsWrite = 1 << 1,
171 IsPrefetch = 1 << 2,
172 IsInvalidate = 1 << 3,
173 IsRequest = 1 << 4,
174 IsResponse = 1 << 5,
175 NeedsResponse = 1 << 6,
176 IsSWPrefetch = 1 << 7,
177 IsHWPrefetch = 1 << 8
178 };
179
180 public:
181 /** List of all commands associated with a packet. */
182 enum Command
183 {
184 InvalidCmd = 0,
185 ReadReq = IsRead | IsRequest | NeedsResponse,
186 WriteReq = IsWrite | IsRequest | NeedsResponse,
187 WriteReqNoAck = IsWrite | IsRequest,
188 ReadResp = IsRead | IsResponse | NeedsResponse,
189 WriteResp = IsWrite | IsResponse | NeedsResponse,
190 Writeback = IsWrite | IsRequest,
191 SoftPFReq = IsRead | IsRequest | IsSWPrefetch | NeedsResponse,
192 HardPFReq = IsRead | IsRequest | IsHWPrefetch | NeedsResponse,
193 SoftPFResp = IsRead | IsResponse | IsSWPrefetch | NeedsResponse,
194 HardPFResp = IsRead | IsResponse | IsHWPrefetch | NeedsResponse,
195 InvalidateReq = IsInvalidate | IsRequest,
196 WriteInvalidateReq = IsWrite | IsInvalidate | IsRequest,
197 UpgradeReq = IsInvalidate | IsRequest | NeedsResponse,
198 UpgradeResp = IsInvalidate | IsResponse | NeedsResponse,
199 ReadExReq = IsRead | IsInvalidate | IsRequest | NeedsResponse,
200 ReadExResp = IsRead | IsInvalidate | IsResponse | NeedsResponse
201 };
202
203 /** Return the string name of the cmd field (for debugging and
204 * tracing). */
205 const std::string &cmdString() const;
206
207 /** Reutrn the string to a cmd given by idx. */
208 const std::string &cmdIdxToString(Command idx);

--- 5 unchanged lines hidden (view full) ---

214 Command cmd;
215
216 bool isRead() { return (cmd & IsRead) != 0; }
217 bool isWrite() { return (cmd & IsWrite) != 0; }
218 bool isRequest() { return (cmd & IsRequest) != 0; }
219 bool isResponse() { return (cmd & IsResponse) != 0; }
220 bool needsResponse() { return (cmd & NeedsResponse) != 0; }
221 bool isInvalidate() { return (cmd & IsInvalidate) != 0; }
222
223 bool isCacheFill() { return (flags & CACHE_LINE_FILL) != 0; }
224 bool isNoAllocate() { return (flags & NO_ALLOCATE) != 0; }
225 bool isCompressed() { return (flags & COMPRESSED) != 0; }
226
227 bool nic_pkt() { assert("Unimplemented\n" && 0); return false; }
228
229 /** Possible results of a packet's request. */

--- 77 unchanged lines hidden (view full) ---

307 arrayData = false;
308 }
309 }
310
311 /** Take a request packet and modify it in place to be suitable
312 * for returning as a response to that request. Used for timing
313 * accesses only. For atomic and functional accesses, the
314 * request packet is always implicitly passed back *without*
315 * modifying the destination fields, so this function
316 * should not be called. */
317 void makeTimingResponse() {
318 assert(needsResponse());
319 assert(isRequest());
320 int icmd = (int)cmd;
321 icmd &= ~(IsRequest);
322 icmd |= IsResponse;
323 cmd = (Command)icmd;
324 dest = src;
325 srcValid = false;
326 }
327
328 /** Take a request packet and modify it in place to be suitable
329 * for returning as a response to that request.
330 */
331 void makeAtomicResponse() {
332 assert(needsResponse());
333 assert(isRequest());
334 int icmd = (int)cmd;
335 icmd &= ~(IsRequest);
336 icmd |= IsResponse;
337 cmd = (Command)icmd;
338 }
339
340 /** Take a request packet that has been returned as NACKED and modify it so
341 * that it can be sent out again. Only packets that need a response can be
342 * NACKED, so verify that that is true. */
343 void reinitNacked() {
344 assert(needsResponse() && result == Nacked);
345 dest = Broadcast;
346 result = Unknown;
347 }

--- 40 unchanged lines hidden ---