Skip to content

Commit

Permalink
Merge branch 'fix/message-log' into maintainer/bryan
Browse files Browse the repository at this point in the history
  • Loading branch information
branylagaffe committed Sep 24, 2024
2 parents 0acfbca + 57c8841 commit 124f266
Show file tree
Hide file tree
Showing 7 changed files with 129 additions and 128 deletions.
5 changes: 4 additions & 1 deletion components/CMPCache/AbstractCacheController.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,9 @@ class AbstractCacheController

inline void reserveSnoopOut(ProcessEntry_p process, uint8_t n)
{

DBG_(Trace, (<< "reserve | Snoop(Out){"<<n<<"} | "<< theName));

DBG_(Trace, (<< theName << "reserveSnoopOut(" << (int)n << "): " << *process));
DBG_Assert(n > 0);
SnoopOut.reserve(n);
Expand Down Expand Up @@ -272,4 +275,4 @@ class AbstractCacheController

}; // namespace nCMPCache

#endif // !__CMPCACHE_ABSTRACT_CACHE_CONTROLLER_HPP__
#endif // !__CMPCACHE_ABSTRACT_CACHE_CONTROLLER_HPP__
73 changes: 35 additions & 38 deletions components/CMPCache/CMPCacheImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,16 +138,14 @@ class FLEXUS_COMPONENT(CMPCache)
void push(interface::Request_In const&, MemoryTransport& aMessage)
{
DBG_Assert(!theController->RequestIn.full());
DBG_(Trace,
Comp(*this)(<< "Received on Port Request_In : " << *(aMessage[MemoryMessageTag]) << " from node "
<< aMessage[DestinationTag]->requester) Addr(aMessage[MemoryMessageTag]->address()));

DBG_(Trace, (<< "received | Request(In){FromNode("<<aMessage[DestinationTag]->requester<<")} | "<<*(aMessage[MemoryMessageTag])));

if (aMessage[TransactionTrackerTag]) {
aMessage[TransactionTrackerTag]->setDelayCause(name(), "Directory Rx Req");
}

DBG_Assert(aMessage[DestinationTag],
(<< "Received Message with NO Dest Tag: " << *(aMessage[MemoryMessageTag])));

DBG_Assert(aMessage[DestinationTag], (<< "received | ERROR(NoTag) | Request(In){FromNode("<<aMessage[DestinationTag]->requester<<")} | "<<*(aMessage[MemoryMessageTag])));
theController->RequestIn.enqueue(aMessage);
}

Expand All @@ -161,14 +159,12 @@ class FLEXUS_COMPONENT(CMPCache)
void push(interface::Snoop_In const&, MemoryTransport& aMessage)
{
DBG_Assert(!theController->SnoopIn.full());
DBG_(Trace,
Comp(*this)(<< "Received on Port Snoop_In : " << *(aMessage[MemoryMessageTag]))
Addr(aMessage[MemoryMessageTag]->address()));
DBG_(Trace, (<< "received | Snoop(In){} | "<<*(aMessage[MemoryMessageTag])));

if (aMessage[TransactionTrackerTag]) {
aMessage[TransactionTrackerTag]->setDelayCause(name(), "Directory Rx Snoop");
}
DBG_Assert(aMessage[DestinationTag],
(<< "Received Message with NO Dest Tag: " << *(aMessage[MemoryMessageTag])));
DBG_Assert(aMessage[DestinationTag], (<< "received | ERROR(NoTag) | Snoop(In){FromNode("<<aMessage[DestinationTag]->requester<<")} | "<<*(aMessage[MemoryMessageTag])));

theController->SnoopIn.enqueue(aMessage);
}
Expand All @@ -183,14 +179,11 @@ class FLEXUS_COMPONENT(CMPCache)
void push(interface::Reply_In const&, MemoryTransport& aMessage)
{
DBG_Assert(!theController->ReplyIn.full());
DBG_(Trace,
Comp(*this)(<< "Received on Port Reply_In : " << *(aMessage[MemoryMessageTag]))
Addr(aMessage[MemoryMessageTag]->address()));
DBG_(Trace, (<< "received | Reply(In){} | "<<*(aMessage[MemoryMessageTag])));
if (aMessage[TransactionTrackerTag]) {
aMessage[TransactionTrackerTag]->setDelayCause(name(), "Directory Rx Reply");
}
DBG_Assert(aMessage[DestinationTag],
(<< "Received Message with NO Dest Tag: " << *(aMessage[MemoryMessageTag])));
DBG_Assert(aMessage[DestinationTag], (<< "received | ERROR(NoTag) | Reply(In){FromNode("<<aMessage[DestinationTag]->requester<<")} | "<<*(aMessage[MemoryMessageTag])));

theController->ReplyIn.enqueue(aMessage);
}
Expand All @@ -199,56 +192,60 @@ class FLEXUS_COMPONENT(CMPCache)
//----------
void drive(interface::CMPCacheDrive const&)
{
DBG_(VVerb, Comp(*this)(<< "DirectoryDrive"));
DBG_(VVerb, Comp(*this)(<< "drive()"));
theController->processMessages();
busCycle();
}

void busCycle()
{
FLEXUS_PROFILE();
DBG_(VVerb, Comp(*this)(<< "bus cycle"));
DBG_(VVerb, Comp(*this)(<< "busCycle()"));

while (!theController->ReplyOut.empty() && FLEXUS_CHANNEL(Reply_Out).available()) {
DBG_(Trace, (<< statName() << " Removing item from Reply queue."));

DBG_(Trace, (<< "dequeue | Reply(Out){} | " << statName()));

MemoryTransport transport = theController->ReplyOut.dequeue();
DBG_(Trace,
Comp(*this)(<< "Sent on Port ReplyOut: " << *(transport[MemoryMessageTag]))
Addr(transport[MemoryMessageTag]->address()));

DBG_(Trace, (<< "sent | Reply(Out){} | "<<*(transport[MemoryMessageTag])));

FLEXUS_CHANNEL(Reply_Out) << transport;
}
while (!theController->SnoopOut.empty() && FLEXUS_CHANNEL(Snoop_Out).available()) {
if (theController->SnoopOut.peek()[DestinationTag]->isMultipleMsgs()) {
MemoryTransport transport = theController->SnoopOut.peek();
DBG_(Trace, (<< statName() << " Removing Multicast from Snoop queue."));

DBG_(Trace, (<< "remove multicast | Snoop(Out){} | " << statName()));

transport.set(DestinationTag, transport[DestinationTag]->removeFirstMulticastDest());
transport.set(MemoryMessageTag, new MemoryMessage(*(transport[MemoryMessageTag])));
DBG_(Trace,
Comp(*this)(<< "Sent on Port SnoopOut: " << *(transport[MemoryMessageTag]))
Addr(transport[MemoryMessageTag]->address()));

DBG_(Trace, (<< "sent | Snoop(Out){} | "<<*(transport[MemoryMessageTag])));

FLEXUS_CHANNEL(Snoop_Out) << transport;
} else {
DBG_(Trace, (<< statName() << " Removing item from Snoop queue."));
DBG_(Trace, (<< "dequeue | Snoop(Out){} | " << statName()));

MemoryTransport transport = theController->SnoopOut.dequeue();
DBG_Assert(transport[MemoryMessageTag]);
DBG_Assert(transport[DestinationTag],
(<< statName() << " no dest for msg: " << *transport[MemoryMessageTag]));
DBG_Assert(transport[DestinationTag], (<< statName() << " no dest for msg: " << *transport[MemoryMessageTag]));

if (transport[DestinationTag]->type == DestinationMessage::Multicast) {
DBG_(Trace, (<< statName() << " Converting multicast message: " << *transport[MemoryMessageTag]));

DBG_(Trace, (<< "convert multicast | Snoop(Out){} | " << statName()));
transport[DestinationTag]->convertMulticast();
}
DBG_(Trace,
Comp(*this)(<< "Sent on Port SnoopOut: " << *(transport[MemoryMessageTag]))
Addr(transport[MemoryMessageTag]->address()));
DBG_(Trace, (<< "sent | Snoop(Out){} | "<<*(transport[MemoryMessageTag])));
FLEXUS_CHANNEL(Snoop_Out) << transport;
}
}
while (!theController->RequestOut.empty() && FLEXUS_CHANNEL(Request_Out).available()) {
DBG_(Trace, (<< "Removing item from request queue."));

DBG_(Trace, (<< "dequeue | Request(Out){} | " << statName()));
MemoryTransport transport = theController->RequestOut.dequeue();
DBG_(Trace,
Comp(*this)(<< "Sent on Port RequestOut: " << *(transport[MemoryMessageTag]))
Addr(transport[MemoryMessageTag]->address()));

DBG_(Trace, (<< "sent | Request(Out){} | "<<*(transport[MemoryMessageTag])));
FLEXUS_CHANNEL(Request_Out) << transport;
}
}
Expand All @@ -262,4 +259,4 @@ FLEXUS_COMPONENT_INSTANTIATOR(CMPCache, nCMPCache);
#define FLEXUS_END_COMPONENT CMPCache

#define DBG_Reset
#include DBG_Control()
#include DBG_Control()
4 changes: 2 additions & 2 deletions components/CMPCache/EvictBuffer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ class DirEvictBuffer : public AbstractDirEvictBuffer
virtual bool freeSlotsPending() const
{
bool ret = ((thePendingInvalidates > 0) || ((theCurSize + theReserve) < theSize));
DBG_(Iface, (<< "In DirEvictBuffer<_State>::freeSlotsPending(), return value = " << std::boolalpha << ret));
//DBG_(Iface, (<< "In DirEvictBuffer<_State>::freeSlotsPending(), return value = " << std::boolalpha << ret));
return ((thePendingInvalidates > 0) || ((theCurSize + theReserve) < theSize));
}
virtual int32_t size() const { return theSize; }
Expand All @@ -235,7 +235,7 @@ class DirEvictBuffer : public AbstractDirEvictBuffer
seq_iterator iter = (theDirEvictBuffer.template get<1>()).begin();
seq_iterator end = (theDirEvictBuffer.template get<1>()).end();
for (; iter != end; iter++) {
if (iter->invalidatesPending()) aList << " 0x" << iter->address();
if (iter->invalidatesPending()) aList << iter->address();
}
return aList.str();
}
Expand Down
74 changes: 43 additions & 31 deletions components/CMPCache/ProcessEntry.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -378,44 +378,56 @@ typedef boost::intrusive_ptr<ProcessEntry> ProcessEntry_p;
inline std::ostream&
operator<<(std::ostream& os, const ProcessEntry& p)
{
os << "Proc(";
switch (p.type()) {
case eProcWakeMAF: os << "ProcWakeMAF: "; break;
case eProcCacheEvict: os << "ProcCacheEvict: "; break;
case eProcDirEvict: os << "ProcDirEvict: "; break;
case eProcReply: os << "ProcReply: "; break;
case eProcSnoop: os << "ProcSnoop: "; break;
case eProcRequest: os << "ProcRequest: "; break;
case eProcIdleWork: os << "ProcIdleWork: "; break;
}

case eProcWakeMAF: os << "WakeMAF"; break;
case eProcCacheEvict: os << "CacheEvict"; break;
case eProcDirEvict: os << "DirEvict"; break;
case eProcReply: os << "Reply"; break;
case eProcSnoop: os << "Snoop"; break;
case eProcRequest: os << "Request"; break;
case eProcIdleWork: os << "IdleWork"; break; }
os << ")";

os << "{";
switch (p.action()) {
case eFwdAndWaitAck: os << "FwdAndWaitAck, "; break;
case eNotifyAndWaitAck: os << "NotifyAndWaitAck, "; break;
case eFwdAndWakeEvictMAF: os << "FwdAndWakeEvictMAF, "; break;
case eWakeEvictMAF: os << "WakeEvictMAF, "; break;
case eForward: os << "Forward, "; break;
case eFwdRequest: os << "FwdRequest, "; break;
case eFwdAndReply: os << "FwdAndReply, "; break;
case eReply: os << "Reply, "; break;
case eReplyAndRemoveMAF: os << "ReplyAndRemoveMAF, "; break;
case eRemoveMAF: os << "RemoveMAF, "; break;
case eRemoveAndWakeMAF: os << "RemoveAndWakeMAF, "; break;
case eStall: os << "Stall, "; break;
case eNoAction: os << "NoAction, "; break;
case eFwdAndWaitAck: os << "FwdAndWaitAck"; break;
case eNotifyAndWaitAck: os << "NotifyAndWaitAck"; break;
case eFwdAndWakeEvictMAF: os << "FwdAndWakeEvictMAF"; break;
case eWakeEvictMAF: os << "WakeEvictMAF"; break;
case eForward: os << "Forward"; break;
case eFwdRequest: os << "FwdRequest"; break;
case eFwdAndReply: os << "FwdAndReply"; break;
case eReply: os << "Reply"; break;
case eReplyAndRemoveMAF: os << "ReplyAndRemoveMAF"; break;
case eRemoveMAF: os << "RemoveMAF"; break;
case eRemoveAndWakeMAF: os << "RemoveAndWakeMAF"; break;
case eStall: os << "Stall"; break;
case eNoAction: os << "NoAction"; break;
}
os << "}";

os << " | Reservation:";
if (p.getSnoopReservations() > 0) os << " Snoop="<<p.getSnoopReservations();
if (p.getRequestReservations() > 0) os << " Request="<<p.getRequestReservations();
if (p.getReplyReservations() > 0) os << " Reply="<<p.getReplyReservations();
if (p.getMAFReserved()) os << " MAF";
if (p.getCacheEBReserved()) os << " CacheEB="<<p.getCacheEBReserved();
if (p.getDirEBReserved()) os << " DirEB";
os << " | ";

os << "snoop reservations: " << p.getSnoopReservations() << ", ";
os << "request reservations: " << p.getRequestReservations() << ", ";
os << "reply reservations: " << p.getReplyReservations() << ", ";
if (p.getMAFReserved()) { os << "MAF reserved, "; }
if (p.getCacheEBReserved()) { os << "Cache EB reserved (" << p.getCacheEBReserved() << "), "; }
if (p.getDirEBReserved()) { os << "Dir EB reserved, "; }
if (p.transport()[MemoryMessageTag] != nullptr) { os << *(p.transport()[MemoryMessageTag]); }

ActionSet::iterator iter = p.theScheduledActions.begin();
ActionSet::iterator end = p.theScheduledActions.end();
os << " Scheduled Tag Reads = " << p.tagReadsScheduled() << " ";
for (; iter != end; iter++) {
os << "[" << *iter << "]";

if (iter != end)
{
os << "Scheduled("<<p.tagReadsScheduled()<<"): ";
for (; iter != end; iter++) {
os << "[" << *iter << "]";
}
os << " | ";
}

return os;
Expand Down
Loading

0 comments on commit 124f266

Please sign in to comment.