The packet in question is a ReadReq to the iobus. Below is the Pkt information and the call stack. If you notice, the pkt is created in the function AtomicSimpleCPU::read() and the pkt's static data flag should be set after the "pkt.dataStatic(dataPtr)" call. I'm not sure what is going on. I will investigate further and let you know.
Brad 1653925: testsys.iobus: recvAtomic: packet src 0 dest -1 addr 0x80200000000 cmd ReadReq #0 0x0000002a9628e745 in raise () from /lib64/tls/libc.so.6 #1 0x0000002a9628feb3 in abort () from /lib64/tls/libc.so.6 #2 0x0000002a96287dc9 in __assert_fail () from /lib64/tls/libc.so.6 #3 0x000000000054051d in Packet::allocate (this=0x7fbfffc9d0) at build/ALPHA_FS/mem/packet.hh:711 #4 0x00000000006629e8 in AlphaBackdoor::read (this=0x18d2180, pkt=0x7fbfffc9d0) at build/ALPHA_FS/dev/alpha/backdoor.cc:109 #5 0x00000000005de359 in PioPort::recvAtomic (this=0x1cd96f0, pkt=0x7fbfffc9d0) at build/ALPHA_FS/dev/io_device.cc:46 #6 0x00000000005261a0 in Port::sendAtomic (this=0x1cd9830, pkt=0x7fbfffc9d0) at build/ALPHA_FS/mem/port.hh:194 #7 0x000000000068c8f2 in Bus::recvAtomic (this=0x18dd010, pkt=0x7fbfffc9d0) at build/ALPHA_FS/mem/bus.cc:406 #8 0x00000000006987b8 in Bus::BusPort::recvAtomic (this=0x1cd88c0, pkt=0x7fbfffc9d0) at build/ALPHA_FS/mem/bus.hh:94 #9 0x00000000005261a0 in Port::sendAtomic (this=0x18ade70, pkt=0x7fbfffc9d0) at build/ALPHA_FS/mem/port.hh:194 #10 0x000000000067f4d5 in Bridge::BridgePort::recvAtomic (this=0x18adf40, pkt=0x7fbfffc9d0) at build/ALPHA_FS/mem/bridge.cc:313 #11 0x00000000005261a0 in Port::sendAtomic (this=0x1cd8320, pkt=0x7fbfffc9d0) at build/ALPHA_FS/mem/port.hh:194 #12 0x000000000068c8f2 in Bus::recvAtomic (this=0x18a0ea0, pkt=0x7fbfffc9d0) at build/ALPHA_FS/mem/bus.cc:406 #13 0x00000000006987b8 in Bus::BusPort::recvAtomic (this=0x1cd8650, pkt=0x7fbfffc9d0) at build/ALPHA_FS/mem/bus.hh:94 #14 0x00000000005261a0 in Port::sendAtomic (this=0x18d0298, pkt=0x7fbfffc9d0) at build/ALPHA_FS/mem/port.hh:194 #15 0x00000000005388b7 in AtomicSimpleCPU::read<unsigned int> (this=0x18d0000, addr=18446740783764602880, [EMAIL PROTECTED], flags=0) at build/ALPHA_FS/cpu/simple/atomic.cc:332 #16 0x0000000000780b88 in AlphaISAInst::Ldl::execute (this=0x1d4d540, xc=0x18d0000, traceData=0x0) at build/ALPHA_FS/arch/alpha/atomic_simple_cpu_exec.cc:1269 #17 0x000000000052f130 in AtomicSimpleCPU::tick (this=0x18d0000) at build/ALPHA_FS/cpu/simple/atomic.cc:759 #18 0x000000000052f4bb in AtomicSimpleCPU::TickEvent::process (this=0x18d0210) at build/ALPHA_FS/cpu/simple/atomic.cc:54 #19 0x00000000006e8e25 in EventQueue::serviceOne (this=0xcc1100) at build/ALPHA_FS/sim/eventq.cc:186 #20 0x000000000071525e in simulate (num_cycles=9223372036854775807) at build/ALPHA_FS/sim/simulate.cc:73 > -----Original Message----- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of nathan > binkert > Sent: Wednesday, November 12, 2008 4:54 PM > To: Beckmann, Brad > Cc: M5 Developer List > Subject: Re: [m5-dev] changeset in m5: style: clean up the Packet stuff > > It's true that I added some extra assertions, but I worry that this > assertion actually caught a real bug, not a bogus assertion. > > If you're calling allocate and data is nonzero but there is no valid > data flag, I assert that something else is going wrong. > > Or does my logic not make sense? > > On Wed, Nov 12, 2008 at 4:48 PM, Beckmann, Brad <[EMAIL PROTECTED]> > wrote: > > The allocate() change implements the previous logic of allocate() > before > > your update. I'm not certain whether my allocate change is what you > had > > intended. I just know that I needed the previous behavior of > allocate() > > to run NetperfMaerts. Otherwise I encountered the following > assertion > > error: > > > > build/ALPHA_FS/mem/packet.hh:705: void Packet::allocate(): Assertion > > `flags.none(STATIC_DATA|DYNAMIC_DATA)' failed. > > > > Brad > > > >> -----Original Message----- > >> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of > nathan > >> binkert > >> Sent: Wednesday, November 12, 2008 4:42 PM > >> To: Beckmann, Brad > >> Cc: M5 Developer List > >> Subject: Re: [m5-dev] changeset in m5: style: clean up the Packet > > stuff > >> > >> The VALID_DST change is correct, but I don't quite understand the > >> allocate() change. You got rid of the assertion that there is valid > >> data if data is true. You also added an assertion to make sure that > >> there is no static data if data is false. > >> Why are those checks better? Are you not allowed to switch from > >> static data to dynamic data? > >> > >> Please go ahead and commit the VALID_DST change. Sorry about that. > If > >> you're certain about the allocate() change, that's fine with me. > >> > >> Interestingly, I passed all of the regressions. Don't you love > that? > >> > >> Nate > >> > >> On Wed, Nov 12, 2008 at 4:33 PM, Beckmann, Brad > > <[EMAIL PROTECTED]> > >> wrote: > >> > Hi Nate, > >> > > >> > I noticed that these changes introduced a couple bugs. I believe > > the > >> > Packet constructors should set the VALID_DST flag and the logic of > >> the > >> > allocate function is incorrect. I believe we should make the > >> following > >> > changes to packet.hh. Would you like me to go ahead and update > the > >> > m5-dev repository? > >> > > >> > Brad > >> > > >> > > >> > diff -r 4f5d99098862 src/mem/packet.hh > >> > --- a/src/mem/packet.hh Tue Nov 11 11:41:19 2008 -0800 > >> > +++ b/src/mem/packet.hh Wed Nov 12 16:31:55 2008 -0800 > >> > @@ -461,8 +461,8 @@ class Packet : public FastAlloc, public > >> > * supplied. > >> > */ > >> > Packet(Request *_req, MemCmd _cmd, NodeID _dest) > >> > - : cmd(_cmd), req(_req), data(NULL), addr(_req->paddr), > >> > - size(_req->size), dest(_dest), time(curTick), > >> > senderState(NULL) > >> > + : flags(VALID_DST), cmd(_cmd), req(_req), data(NULL), > >> > addr(_req->paddr), > >> > + size(_req->size), dest(_dest), time(curTick), > >> > senderState(NULL) > >> > { > >> > } > >> > > >> > @@ -472,7 +472,7 @@ class Packet : public FastAlloc, public > >> > * req. this allows for overriding the size/addr of the req. > >> > */ > >> > Packet(Request *_req, MemCmd _cmd, NodeID _dest, int _blkSize) > >> > - : cmd(_cmd), req(_req), data(NULL), > >> > + : flags(VALID_DST), cmd(_cmd), req(_req), data(NULL), > >> > addr(_req->paddr & ~(_blkSize - 1)), size(_blkSize), > >> > dest(_dest), > >> > time(curTick), senderState(NULL) > >> > { > >> > @@ -701,12 +701,11 @@ class Packet : public FastAlloc, public > >> > void > >> > allocate() > >> > { > >> > - if (data) { > >> > - assert(flags.none(STATIC_DATA|DYNAMIC_DATA)); > >> > - } else { > >> > - flags.set(DYNAMIC_DATA|ARRAY_DATA); > >> > - data = new uint8_t[getSize()]; > >> > - } > >> > + if (data) > >> > + return; > >> > + assert(flags.none(STATIC_DATA)); > >> > + flags.set(DYNAMIC_DATA|ARRAY_DATA); > >> > + data = new uint8_t[getSize()]; > >> > } > >> > > >> > > >> >> -----Original Message----- > >> >> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > On > >> >> Behalf Of nathan binkert > >> >> Sent: Monday, November 10, 2008 6:55 PM > >> >> To: m5-dev@m5sim.org > >> >> Subject: Re: [m5-dev] changeset in m5: style: clean up the Packet > >> > stuff > >> >> > >> >> This diff went way beyond style cleanup. Unfortunately, I didn't > >> >> remember to update the commit message. One of the big things I > did > >> >> was get rid of all of the individual boolean variable flags and > >> create > >> >> a single flags variable. I also made all of the flag values > static > >> >> members of their classes instead of globals. > >> >> > >> >> Nate > >> >> > >> >> On Mon, Nov 10, 2008 at 6:49 PM, Nathan Binkert > <[EMAIL PROTECTED]> > >> >> wrote: > >> >> > changeset a88e8e7dec75 in /z/repo/m5 > >> >> > details: > http://repo.m5sim.org/m5?cmd=changeset;node=a88e8e7dec75 > >> >> > description: > >> >> > style: clean up the Packet stuff > >> >> > > >> >> > diffstat: > >> >> > > >> >> > 3 files changed, 24 insertions(+), 32 deletions(-) > >> >> > src/mem/packet.cc | 1 > >> >> > src/mem/packet.hh | 1 > >> >> > src/mem/request.hh | 54 > >> > +++++++++++++++++++++---------------------- > >> >> --------- > >> >> > > >> >> > diffs (truncated from 1501 to 300 lines): > >> >> > > >> >> > diff -r f3733e2b19d5 -r a88e8e7dec75 src/mem/packet.cc > >> >> > --- a/src/mem/packet.cc Mon Nov 10 11:51:17 2008 -0800 > >> >> > +++ b/src/mem/packet.cc Mon Nov 10 11:51:17 2008 -0800 > >> >> > @@ -41,6 +41,8 @@ > >> >> > #include "base/misc.hh" > >> >> > #include "base/trace.hh" > >> >> > #include "mem/packet.hh" > >> >> > + > >> >> > +using namespace std; > >> >> > > >> >> > // The one downside to bitsets is that static initializers can > >> get > >> >> ugly. > >> >> > #define SET1(a1) (1 << (a1)) > >> >> > @@ -133,35 +135,6 @@ > >> >> > { SET2(IsRequest, IsPrint), InvalidCmd, "PrintReq" } > >> >> > }; > >> >> > > >> >> > - > >> >> > -/** delete the data pointed to in the data pointer. Ok to call > > to > >> >> matter how > >> >> > - * data was allocted. */ > >> >> > -void > >> >> > -Packet::deleteData() > >> >> > -{ > >> >> > - assert(staticData || dynamicData); > >> >> > - if (staticData) > >> >> > - return; > >> >> > - > >> >> > - if (arrayData) > >> >> > - delete [] data; > >> >> > - else > >> >> > - delete data; > >> >> > -} > >> >> > - > >> >> > -/** If there isn't data in the packet, allocate some. */ > >> >> > -void > >> >> > -Packet::allocate() > >> >> > -{ > >> >> > - if (data) > >> >> > - return; > >> >> > - assert(!staticData); > >> >> > - dynamicData = true; > >> >> > - arrayData = true; > >> >> > - data = new uint8_t[getSize()]; > >> >> > -} > >> >> > - > >> >> > - > >> >> > bool > >> >> > Packet::checkFunctional(Printable *obj, Addr addr, int size, > >> > uint8_t > >> >> *data) > >> >> > { > >> >> > @@ -193,7 +166,7 @@ > >> >> > if (isRead()) { > >> >> > if (func_start >= val_start && func_end <= val_end) { > >> >> > allocate(); > >> >> > - std::memcpy(getPtr<uint8_t>(), data + offset, > >> >> getSize()); > >> >> > + memcpy(getPtr<uint8_t>(), data + offset, > getSize()); > >> >> > makeResponse(); > >> >> > return true; > >> >> > } else { > >> >> > @@ -208,11 +181,12 @@ > >> >> > } > >> >> > } else if (isWrite()) { > >> >> > if (offset >= 0) { > >> >> > - std::memcpy(data + offset, getPtr<uint8_t>(), > >> >> > - (std::min(func_end, val_end) - > >> func_start) > >> > + > >> >> 1); > >> >> > - } else { // val_start > func_start > >> >> > - std::memcpy(data, getPtr<uint8_t>() - offset, > >> >> > - (std::min(func_end, val_end) - > > val_start) > >> + > >> >> 1); > >> >> > + memcpy(data + offset, getPtr<uint8_t>(), > >> >> > + (min(func_end, val_end) - func_start) + 1); > >> >> > + } else { > >> >> > + // val_start > func_start > >> >> > + memcpy(data, getPtr<uint8_t>() - offset, > >> >> > + (min(func_end, val_end) - val_start) + 1); > >> >> > } > >> >> > } else { > >> >> > panic("Don't know how to handle command %s\n", > >> cmdString()); > >> >> > @@ -222,22 +196,18 @@ > >> >> > return false; > >> >> > } > >> >> > > >> >> > - > >> >> > void > >> >> > -Packet::print(std::ostream &o, const int verbosity, > >> >> > - const std::string &prefix) const > >> >> > +Packet::print(ostream &o, const int verbosity, const string > >> > &prefix) > >> >> const > >> >> > { > >> >> > ccprintf(o, "%s[%x:%x] %s\n", prefix, > >> >> > getAddr(), getAddr() + getSize() - 1, > cmdString()); > >> >> > } > >> >> > > >> >> > - > >> >> > -Packet::PrintReqState::PrintReqState(std::ostream &_os, int > >> >> _verbosity) > >> >> > - : curPrefixPtr(new std::string("")), os(_os), > >> >> verbosity(_verbosity) > >> >> > +Packet::PrintReqState::PrintReqState(ostream &_os, int > >> _verbosity) > >> >> > + : curPrefixPtr(new string("")), os(_os), > >> verbosity(_verbosity) > >> >> > { > >> >> > labelStack.push_back(LabelStackEntry("", curPrefixPtr)); > >> >> > } > >> >> > - > >> >> > > >> >> > Packet::PrintReqState::~PrintReqState() > >> >> > { > >> >> > @@ -246,21 +216,17 @@ > >> >> > delete curPrefixPtr; > >> >> > } > >> >> > > >> >> > - > >> >> > Packet::PrintReqState:: > >> >> > -LabelStackEntry::LabelStackEntry(const std::string &_label, > >> >> > - std::string *_prefix) > >> >> > +LabelStackEntry::LabelStackEntry(const string &_label, string > >> >> *_prefix) > >> >> > : label(_label), prefix(_prefix), labelPrinted(false) > >> >> > { > >> >> > } > >> >> > > >> >> > - > >> >> > void > >> >> > -Packet::PrintReqState::pushLabel(const std::string &lbl, > >> >> > - const std::string &prefix) > >> >> > +Packet::PrintReqState::pushLabel(const string &lbl, const > string > >> >> &prefix) > >> >> > { > >> >> > labelStack.push_back(LabelStackEntry(lbl, curPrefixPtr)); > >> >> > - curPrefixPtr = new std::string(*curPrefixPtr); > >> >> > + curPrefixPtr = new string(*curPrefixPtr); > >> >> > *curPrefixPtr += prefix; > >> >> > } > >> >> > > >> >> > diff -r f3733e2b19d5 -r a88e8e7dec75 src/mem/packet.hh > >> >> > --- a/src/mem/packet.hh Mon Nov 10 11:51:17 2008 -0800 > >> >> > +++ b/src/mem/packet.hh Mon Nov 10 11:51:17 2008 -0800 > >> >> > @@ -42,8 +42,10 @@ > >> >> > #include <list> > >> >> > #include <bitset> > >> >> > > >> >> > +#include "base/cast.hh" > >> >> > #include "base/compiler.hh" > >> >> > #include "base/fast_alloc.hh" > >> >> > +#include "base/flags.hh" > >> >> > #include "base/misc.hh" > >> >> > #include "base/printable.hh" > >> >> > #include "mem/request.hh" > >> >> > @@ -58,9 +60,12 @@ > >> >> > > >> >> > class MemCmd > >> >> > { > >> >> > + friend class Packet; > >> >> > + > >> >> > public: > >> >> > - > >> >> > - /** List of all commands associated with a packet. */ > >> >> > + /** > >> >> > + * List of all commands associated with a packet. > >> >> > + */ > >> >> > enum Command > >> >> > { > >> >> > InvalidCmd, > >> >> > @@ -100,7 +105,9 @@ > >> >> > }; > >> >> > > >> >> > private: > >> >> > - /** List of command attributes. */ > >> >> > + /** > >> >> > + * List of command attributes. > >> >> > + */ > >> >> > enum Attribute > >> >> > { > >> >> > IsRead, //!< Data flows from responder to > >> requester > >> >> > @@ -120,26 +127,31 @@ > >> >> > NUM_COMMAND_ATTRIBUTES > >> >> > }; > >> >> > > >> >> > - /** Structure that defines attributes and other data > >> associated > >> >> > - * with a Command. */ > >> >> > - struct CommandInfo { > >> >> > - /** Set of attribute flags. */ > >> >> > + /** > >> >> > + * Structure that defines attributes and other data > >> associated > >> >> > + * with a Command. > >> >> > + */ > >> >> > + struct CommandInfo > >> >> > + { > >> >> > + /// Set of attribute flags. > >> >> > const std::bitset<NUM_COMMAND_ATTRIBUTES> attributes; > >> >> > - /** Corresponding response for requests; InvalidCmd if > > no > >> >> > - * response is applicable. */ > >> >> > + /// Corresponding response for requests; InvalidCmd if > > no > >> >> > + /// response is applicable. > >> >> > const Command response; > >> >> > - /** String representation (for printing) */ > >> >> > + /// String representation (for printing) > >> >> > const std::string str; > >> >> > }; > >> >> > > >> >> > - /** Array to map Command enum to associated info. */ > >> >> > + /// Array to map Command enum to associated info. > >> >> > static const CommandInfo commandInfo[]; > >> >> > > >> >> > private: > >> >> > > >> >> > Command cmd; > >> >> > > >> >> > - bool testCmdAttrib(MemCmd::Attribute attrib) const { > >> >> > + bool > >> >> > + testCmdAttrib(MemCmd::Attribute attrib) const > >> >> > + { > >> >> > return commandInfo[cmd].attributes[attrib] != 0; > >> >> > } > >> >> > > >> >> > @@ -158,33 +170,22 @@ > >> >> > bool isError() const { return > testCmdAttrib(IsError); > > } > >> >> > bool isPrint() const { return > testCmdAttrib(IsPrint); > > } > >> >> > > >> >> > - const Command responseCommand() const { > >> >> > + const Command > >> >> > + responseCommand() const > >> >> > + { > >> >> > return commandInfo[cmd].response; > >> >> > } > >> >> > > >> >> > - /** Return the string to a cmd given by idx. */ > >> >> > - const std::string &toString() const { > >> >> > - return commandInfo[cmd].str; > >> >> > - } > >> >> > - > >> >> > + /// Return the string to a cmd given by idx. > >> >> > + const std::string &toString() const { return > >> >> commandInfo[cmd].str; } > >> >> > int toInt() const { return (int)cmd; } > >> >> > > >> >> > - MemCmd(Command _cmd) > >> >> > - : cmd(_cmd) > >> >> > - { } > >> >> > + MemCmd(Command _cmd) : cmd(_cmd) { } > >> >> > + MemCmd(int _cmd) : cmd((Command)_cmd) { } > >> >> > + MemCmd() : cmd(InvalidCmd) { } > >> >> > > >> >> > - MemCmd(int _cmd) > >> >> > - : cmd((Command)_cmd) > >> >> > - { } > >> >> > - > >> >> > - MemCmd() > >> >> > - : cmd(InvalidCmd) > >> >> > - { } > >> >> > - > >> >> > - bool operator==(MemCmd c2) { return (cmd == c2.cmd); } > >> >> > - bool operator!=(MemCmd c2) { return (cmd != c2.cmd); } > >> >> > - > >> >> > - friend class Packet; > >> >> > + bool operator==(MemCmd c2) const { return (cmd == c2.cmd); > } > >> >> > + bool operator!=(MemCmd c2) const { return (cmd != c2.cmd); > } > >> >> > }; > >> >> > > >> >> > /** > >> >> > @@ -197,107 +198,118 @@ > >> >> > class Packet : public FastAlloc, public Printable > >> >> > { > >> >> > public: > >> >> > + typedef uint32_t FlagsType; > >> >> > + typedef ::Flags<FlagsType> Flags; > >> >> > + typedef short NodeID; > >> >> > > >> >> > + private: > >> >> > + static const FlagsType PUBLIC_FLAGS = > 0x00000000; > >> >> > + static const FlagsType PRIVATE_FLAGS = > 0x00007F0F; > >> >> > + static const FlagsType COPY_FLAGS = > 0x0000000F; > >> >> > + > >> >> > + static const FlagsType SHARED = > 0x00000001; > >> >> > + // Special control flags > >> >> > + /// Special timing-mode atomic snoop for multi-level > >> coherence. > >> >> > + static const FlagsType EXPRESS_SNOOP = > 0x00000002; > >> >> > + /// Does supplier have exclusive copy? > >> >> > + /// Useful for multi-level coherence. > >> >> > + static const FlagsType SUPPLY_EXCLUSIVE = > 0x00000004; > >> >> > + // Snoop response flags > >> >> > + static const FlagsType MEM_INHIBIT = > 0x00000008; > >> >> > + /// Are the 'addr' and 'size' fields valid? > >> >> > + static const FlagsType VALID_ADDR = > 0x00000100; > >> >> > + static const FlagsType VALID_SIZE = > 0x00000200; > >> >> > + /// Is the 'src' field valid? > >> >> > + static const FlagsType VALID_SRC = > 0x00000400; > >> >> > + static const FlagsType VALID_DST = > 0x00000800; > >> >> > + /// Is the data pointer set to a value that shouldn't be > >> freed > >> >> > + /// when the packet is destroyed? > >> >> > + static const FlagsType STATIC_DATA = > 0x00001000; > >> >> > + /// The data pointer points to a value that should be > freed > >> > when > >> >> > + /// the packet is destroyed. > >> >> > + static const FlagsType DYNAMIC_DATA = > 0x00002000; > >> >> > + /// the data pointer points to an array (thus delete []) > >> needs > >> >> to > >> >> > + /// be called on it rather than simply delete. > >> >> > + static const FlagsType ARRAY_DATA = > 0x00004000; > >> >> > + > >> >> > + Flags flags; > >> >> > + > >> >> > + public: > >> >> > typedef MemCmd::Command Command; > >> >> > > >> >> > - /** The command field of the packet. */ > >> >> > + /// The command field of the packet. > >> >> > MemCmd cmd; > >> >> > > >> >> > - /** A pointer to the original request. */ > >> >> > + /// A pointer to the original request. > >> >> > _______________________________________________ > >> >> > m5-dev mailing list > >> >> > m5-dev@m5sim.org > >> >> > http://m5sim.org/mailman/listinfo/m5-dev > >> >> > > >> >> > > >> >> _______________________________________________ > >> >> m5-dev mailing list > >> >> m5-dev@m5sim.org > >> >> http://m5sim.org/mailman/listinfo/m5-dev > >> > > >> > > >> > > > > > > > _______________________________________________ m5-dev mailing list m5-dev@m5sim.org http://m5sim.org/mailman/listinfo/m5-dev