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 HasData = 1 << 9 |
179 }; 180 181 public: 182 /** List of all commands associated with a packet. */ 183 enum Command 184 { 185 InvalidCmd = 0, 186 ReadReq = IsRead | IsRequest | NeedsResponse, |
187 WriteReq = IsWrite | IsRequest | NeedsResponse,// | HasData, 188 WriteReqNoAck = IsWrite | IsRequest,// | HasData, 189 ReadResp = IsRead | IsResponse | NeedsResponse,// | HasData, |
190 WriteResp = IsWrite | IsResponse | NeedsResponse, |
191 Writeback = IsWrite | IsRequest,// | HasData, |
192 SoftPFReq = IsRead | IsRequest | IsSWPrefetch | NeedsResponse, 193 HardPFReq = IsRead | IsRequest | IsHWPrefetch | NeedsResponse, |
194 SoftPFResp = IsRead | IsResponse | IsSWPrefetch 195 | NeedsResponse,// | HasData, 196 HardPFResp = IsRead | IsResponse | IsHWPrefetch 197 | NeedsResponse,// | HasData, |
198 InvalidateReq = IsInvalidate | IsRequest, |
199 WriteInvalidateReq = IsWrite | IsInvalidate | IsRequest,// | HasData, |
200 UpgradeReq = IsInvalidate | IsRequest | NeedsResponse, 201 UpgradeResp = IsInvalidate | IsResponse | NeedsResponse, 202 ReadExReq = IsRead | IsInvalidate | IsRequest | NeedsResponse, |
203 ReadExResp = IsRead | IsInvalidate | IsResponse 204 | NeedsResponse,// | HasData |
205 }; 206 207 /** Return the string name of the cmd field (for debugging and 208 * tracing). */ 209 const std::string &cmdString() const; 210 211 /** Reutrn the string to a cmd given by idx. */ 212 const std::string &cmdIdxToString(Command idx); --- 5 unchanged lines hidden (view full) --- 218 Command cmd; 219 220 bool isRead() { return (cmd & IsRead) != 0; } 221 bool isWrite() { return (cmd & IsWrite) != 0; } 222 bool isRequest() { return (cmd & IsRequest) != 0; } 223 bool isResponse() { return (cmd & IsResponse) != 0; } 224 bool needsResponse() { return (cmd & NeedsResponse) != 0; } 225 bool isInvalidate() { return (cmd & IsInvalidate) != 0; } |
226 bool hasData() { return (cmd & HasData) != 0; } |
227 228 bool isCacheFill() { return (flags & CACHE_LINE_FILL) != 0; } 229 bool isNoAllocate() { return (flags & NO_ALLOCATE) != 0; } 230 bool isCompressed() { return (flags & COMPRESSED) != 0; } 231 232 bool nic_pkt() { assert("Unimplemented\n" && 0); return false; } 233 234 /** Possible results of a packet's request. */ --- 77 unchanged lines hidden (view full) --- 312 arrayData = false; 313 } 314 } 315 316 /** Take a request packet and modify it in place to be suitable 317 * for returning as a response to that request. Used for timing 318 * accesses only. For atomic and functional accesses, the 319 * request packet is always implicitly passed back *without* |
320 * modifying the command or destination fields, so this function |
321 * should not be called. */ 322 void makeTimingResponse() { 323 assert(needsResponse()); 324 assert(isRequest()); 325 int icmd = (int)cmd; 326 icmd &= ~(IsRequest); 327 icmd |= IsResponse; 328 cmd = (Command)icmd; 329 dest = src; 330 srcValid = false; 331 } 332 |
333 /** Take a request packet that has been returned as NACKED and modify it so 334 * that it can be sent out again. Only packets that need a response can be 335 * NACKED, so verify that that is true. */ 336 void reinitNacked() { 337 assert(needsResponse() && result == Nacked); 338 dest = Broadcast; 339 result = Unknown; 340 } --- 40 unchanged lines hidden --- |