45a46
> #include "debug/Drain.hh"
54c55
< params()->max_backoff),
---
> params()->max_backoff), drainEvent(NULL),
66a68,79
> void
> TableWalker::completeDrain()
> {
> if (drainEvent && stateQueueL1.empty() && stateQueueL2.empty() &&
> pendingQueue.empty()) {
> changeState(Drained);
> DPRINTF(Drain, "TableWalker done draining, processing drain event\n");
> drainEvent->process();
> drainEvent = NULL;
> }
> }
>
70,71c83,93
< if (stateQueueL1.size() || stateQueueL2.size() || pendingQueue.size())
< {
---
> unsigned int count = port.drain(de);
>
> if (stateQueueL1.empty() && stateQueueL2.empty() &&
> pendingQueue.empty()) {
> changeState(Drained);
> DPRINTF(Drain, "TableWalker free, no need to drain\n");
>
> // table walker is drained, but its ports may still need to be drained
> return count;
> } else {
> drainEvent = de;
73,74c95,99
< DPRINTF(Checkpoint, "TableWalker busy, wait to drain\n");
< return 1;
---
> DPRINTF(Drain, "TableWalker not drained\n");
>
> // return port drain count plus the table walker itself needs to drain
> return count + 1;
>
76,81d100
< else
< {
< changeState(Drained);
< DPRINTF(Checkpoint, "TableWalker free, no need to drain\n");
< return 0;
< }
89,90c108,109
< delete currState;
< currState = NULL;
---
> delete currState;
> currState = NULL;
669a689
> completeDrain();
725a746
> completeDrain();