42c42
< #include "params/Bridge.hh"
---
> #include "sim/builder.hh"
115,118d114
< if (!(pkt->flags & SNOOP_COMMIT))
< return true;
<
<
128,129c124
< if (pkt->isRequest() && otherPort->reqQueueFull() && pkt->result !=
< Packet::Nacked) {
---
> if (pkt->isRequest() && otherPort->reqQueueFull() && !pkt->wasNacked()) {
135c130
< if (pkt->needsResponse() && pkt->result != Packet::Nacked)
---
> if (pkt->needsResponse() && !pkt->wasNacked())
156c151
< pkt->result = Packet::Nacked;
---
> pkt->setNacked();
201c196
< if (pkt->isResponse() || pkt->result == Packet::Nacked) {
---
> if (pkt->isResponse() || pkt->wasNacked()) {
213c208
< if (buf->expectResponse && pkt->result == Packet::Nacked)
---
> if (buf->expectResponse && pkt->wasNacked())
216c211,214
< DPRINTF(BusBridge, "response, new dest %d\n", pkt->getDest());
---
>
> DPRINTF(BusBridge, "restoring sender state: %#X, from packet buffer: %#X\n",
> pkt->senderState, buf);
> DPRINTF(BusBridge, " is response, new dest %d\n", pkt->getDest());
221c219
< if (pkt->isRequest() && pkt->result != Packet::Nacked) {
---
> if (pkt->isRequest() && !pkt->wasNacked()) {
228a227,228
> DPRINTF(BusBridge, "old sender state: %#X, new sender state: %#X\n",
> buf->origSenderState, buf);
251,252d250
< pkt->flags &= ~SNOOP_COMMIT; //CLear it if it was set
<
255c253
< pkt->result != Packet::Nacked) {
---
> !pkt->wasNacked()) {
268c266
< bool wasNacked = pkt->result == Packet::Nacked;
---
> bool wasNacked = pkt->wasNacked();
343d340
< bool pktContinue = true;
346,348c343,344
< if (pkt->intersect((*i)->pkt)) {
< pktContinue &= fixPacket(pkt, (*i)->pkt);
< }
---
> if (pkt->checkFunctional((*i)->pkt))
> return;
351,353c347,348
< if (pktContinue) {
< otherPort->sendFunctional(pkt);
< }
---
> // fall through if pkt still not satisfied
> otherPort->sendFunctional(pkt);
370,371c365,393
< Bridge *
< BridgeParams::create()
---
> BEGIN_DECLARE_SIM_OBJECT_PARAMS(Bridge)
>
> Param<int> req_size_a;
> Param<int> req_size_b;
> Param<int> resp_size_a;
> Param<int> resp_size_b;
> Param<Tick> delay;
> Param<Tick> nack_delay;
> Param<bool> write_ack;
> Param<bool> fix_partial_write_a;
> Param<bool> fix_partial_write_b;
>
> END_DECLARE_SIM_OBJECT_PARAMS(Bridge)
>
> BEGIN_INIT_SIM_OBJECT_PARAMS(Bridge)
>
> INIT_PARAM(req_size_a, "The size of the queue for requests coming into side a"),
> INIT_PARAM(req_size_b, "The size of the queue for requests coming into side b"),
> INIT_PARAM(resp_size_a, "The size of the queue for responses coming into side a"),
> INIT_PARAM(resp_size_b, "The size of the queue for responses coming into side b"),
> INIT_PARAM(delay, "The miminum delay to cross this bridge"),
> INIT_PARAM(nack_delay, "The minimum delay to nack a packet"),
> INIT_PARAM(write_ack, "Acknowledge any writes that are received."),
> INIT_PARAM(fix_partial_write_a, "Fixup any partial block writes that are received"),
> INIT_PARAM(fix_partial_write_b, "Fixup any partial block writes that are received")
>
> END_INIT_SIM_OBJECT_PARAMS(Bridge)
>
> CREATE_SIM_OBJECT(Bridge)
373c395,406
< return new Bridge(this);
---
> Bridge::Params *p = new Bridge::Params;
> p->name = getInstanceName();
> p->req_size_a = req_size_a;
> p->req_size_b = req_size_b;
> p->resp_size_a = resp_size_a;
> p->resp_size_b = resp_size_b;
> p->delay = delay;
> p->nack_delay = nack_delay;
> p->write_ack = write_ack;
> p->fix_partial_write_a = fix_partial_write_a;
> p->fix_partial_write_b = fix_partial_write_b;
> return new Bridge(p);
374a408,411
>
> REGISTER_SIM_OBJECT("Bridge", Bridge)
>
>