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; --- 238 unchanged lines hidden (view full) --- 247 248 /** Are the 'addr' and 'size' fields valid? */ 249 bool addrSizeValid; 250 /** Is the 'src' field valid? */ 251 bool srcValid; 252 bool destValid; 253 254 enum Flag { |
255 // Snoop response flags |
256 MemInhibit, 257 Shared, |
258 // Special control flags 259 ExpressSnoop, |
260 NUM_PACKET_FLAGS 261 }; 262 263 /** Status flags */ 264 std::bitset<NUM_PACKET_FLAGS> flags; 265 266 public: 267 --- 46 unchanged lines hidden (view full) --- 314 bool isError() const { return cmd.isError(); } 315 316 // Snoop flags 317 void assertMemInhibit() { flags[MemInhibit] = true; } 318 void assertShared() { flags[Shared] = true; } 319 bool memInhibitAsserted() { return flags[MemInhibit]; } 320 bool sharedAsserted() { return flags[Shared]; } 321 |
322 // Special control flags 323 void setExpressSnoop() { flags[ExpressSnoop] = true; } 324 bool isExpressSnoop() { return flags[ExpressSnoop]; } 325 |
326 // Network error conditions... encapsulate them as methods since 327 // their encoding keeps changing (from result field to command 328 // field, etc.) 329 void setNacked() { origCmd = cmd; cmd = MemCmd::NetworkNackError; } 330 void setBadAddress() { origCmd = cmd; cmd = MemCmd::BadAddressError; } 331 bool wasNacked() { return cmd == MemCmd::NetworkNackError; } 332 bool hadBadAddress() { return cmd == MemCmd::BadAddressError; } 333 --- 39 unchanged lines hidden (view full) --- 373 { 374 } 375 376 /** Alternate constructor for copying a packet. Copy all fields 377 * *except* if the original packet's data was dynamic, don't copy 378 * that, as we can't guarantee that the new packet's lifetime is 379 * less than that of the original packet. In this case the new 380 * packet should allocate its own data. */ |
381 Packet(Packet *origPkt, bool clearFlags = false) |
382 : cmd(origPkt->cmd), req(origPkt->req), 383 data(origPkt->staticData ? origPkt->data : NULL), 384 staticData(origPkt->staticData), 385 dynamicData(false), arrayData(false), 386 addr(origPkt->addr), size(origPkt->size), 387 src(origPkt->src), dest(origPkt->dest), 388 addrSizeValid(origPkt->addrSizeValid), 389 srcValid(origPkt->srcValid), destValid(origPkt->destValid), |
390 flags(clearFlags ? 0 : origPkt->flags), |
391 time(curTick), senderState(origPkt->senderState) 392 { 393 } 394 395 /** Destructor. */ 396 ~Packet() 397 { if (staticData || dynamicData) deleteData(); } 398 --- 188 unchanged lines hidden --- |