47a48
> #include "base/printable.hh"
93a95,96
> // Fake simulator-only commands
> PrintReq, // Print state matching address
113a117
> IsPrint, //!< Print state matching address (for debugging)
152a157
> bool isPrint() const { return testCmdAttrib(IsPrint); }
190c195
< class Packet : public FastAlloc
---
> class Packet : public FastAlloc, public Printable
296a302,331
> class PrintReqState : public SenderState {
> class LabelStackEntry {
> public:
> const std::string label;
> std::string *prefix;
> bool labelPrinted;
> LabelStackEntry(const std::string &_label,
> std::string *_prefix);
> };
>
> typedef std::list<LabelStackEntry> LabelStack;
> LabelStack labelStack;
>
> std::string *curPrefixPtr;
>
> public:
> std::ostream &os;
> const int verbosity;
>
> PrintReqState(std::ostream &os, int verbosity = 0);
> ~PrintReqState();
>
> const std::string &curPrefix() { return *curPrefixPtr; }
> void pushLabel(const std::string &lbl,
> const std::string &prefix = " ");
> void popLabel();
> void printLabels();
> void printObj(Printable *obj);
> };
>
318a354
> bool isPrint() const { return cmd.isPrint(); }
576c612
< bool checkFunctional(Addr base, int size, uint8_t *data);
---
> bool checkFunctional(Printable *obj, Addr base, int size, uint8_t *data);
580c616,622
< * another packet (i.e. an in-transit request or response).
---
> * another packet (i.e. an in-transit request or response). If
> * possible, the request will be satisfied and transformed
> * in-place into a response (at which point no further checking
> * need be done).
> *
> * @return True if the memory location addressed by the request
> * overlaps with the location addressed by otherPkt.
583,585c625,628
< return (otherPkt->hasData() &&
< checkFunctional(otherPkt->getAddr(), otherPkt->getSize(),
< otherPkt->getPtr<uint8_t>()));
---
> return checkFunctional(otherPkt,
> otherPkt->getAddr(), otherPkt->getSize(),
> otherPkt->hasData() ?
> otherPkt->getPtr<uint8_t>() : NULL);
587d629
< };
589c631,635
< std::ostream & operator<<(std::ostream &o, const Packet &p);
---
> void pushLabel(const std::string &lbl) {
> if (isPrint()) {
> dynamic_cast<PrintReqState*>(senderState)->pushLabel(lbl);
> }
> }
590a637,646
> void popLabel() {
> if (isPrint()) {
> dynamic_cast<PrintReqState*>(senderState)->popLabel();
> }
> }
>
> void print(std::ostream &o, int verbosity = 0,
> const std::string &prefix = "") const;
> };
>