Deleted Added
sdiff udiff text old ( 9259:fc28f3ca5b21 ) new ( 9542:683991c46ac8 )
full compact
1/*
2 * Copyright (c) 2012-2013 ARM Limited
3 * All rights reserved
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software
9 * licensed hereunder. You may use the software subject to the license
10 * terms below provided that you ensure that this notice is replicated

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

335 /// The time at which the packet will be fully transmitted
336 Tick finishTime;
337
338 /// The time at which the first chunk of the packet will be transmitted
339 Tick firstWordTime;
340
341 /**
342 * A virtual base opaque structure used to hold state associated
343 * with the packet (e.g., an MSHR), specific to a MemObject that
344 * sees the packet. A pointer to this state is returned in the
345 * packet's response so that the MemObject in question can quickly
346 * look up the state needed to process it. A specific subclass
347 * would be derived from this to carry state specific to a
348 * particular sending device.
349 *
350 * As multiple MemObjects may add their SenderState throughout the
351 * memory system, the SenderStates create a stack, where a
352 * MemObject can add a new Senderstate, as long as the
353 * predecessing SenderState is restored when the response comes
354 * back. For this reason, the predecessor should always be
355 * populated with the current SenderState of a packet before
356 * modifying the senderState field in the request packet.
357 */
358 struct SenderState
359 {
360 SenderState* predecessor;
361 SenderState() : predecessor(NULL) {}
362 virtual ~SenderState() {}
363 };
364
365 /**
366 * Object used to maintain state of a PrintReq. The senderState
367 * field of a PrintReq should always be of this type.
368 */
369 class PrintReqState : public SenderState

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

423 */
424 void printObj(Printable *obj);
425 };
426
427 /**
428 * This packet's sender state. Devices should use dynamic_cast<>
429 * to cast to the state appropriate to the sender. The intent of
430 * this variable is to allow a device to attach extra information
431 * to a request. A response packet must return the sender state
432 * that was attached to the original request (even if a new packet
433 * is created).
434 */
435 SenderState *senderState;
436
437 /**
438 * Push a new sender state to the packet and make the current
439 * sender state the predecessor of the new one. This should be
440 * prefered over direct manipulation of the senderState member
441 * variable.
442 *
443 * @param sender_state SenderState to push at the top of the stack
444 */
445 void pushSenderState(SenderState *sender_state);
446
447 /**
448 * Pop the top of the state stack and return a pointer to it. This
449 * assumes the current sender state is not NULL. This should be
450 * preferred over direct manipulation of the senderState member
451 * variable.
452 *
453 * @return The current top of the stack
454 */
455 SenderState *popSenderState();
456
457 /// Return the string name of the cmd field (for debugging and
458 /// tracing).
459 const std::string &cmdString() const { return cmd.toString(); }
460
461 /// Return the index of this command.
462 inline int cmdToIndex() const { return cmd.toInt(); }
463
464 bool isRead() const { return cmd.isRead(); }

--- 424 unchanged lines hidden ---