io_device.cc (2784:6cff1a1c2935) io_device.cc (2846:89fbe74d8ea8)
1/*
2 * Copyright (c) 2006 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

--- 20 unchanged lines hidden (view full) ---

29 * Nathan Binkert
30 */
31
32#include "base/trace.hh"
33#include "dev/io_device.hh"
34#include "sim/builder.hh"
35
36
1/*
2 * Copyright (c) 2006 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

--- 20 unchanged lines hidden (view full) ---

29 * Nathan Binkert
30 */
31
32#include "base/trace.hh"
33#include "dev/io_device.hh"
34#include "sim/builder.hh"
35
36
37PioPort::PioPort(PioDevice *dev, Platform *p)
38 : Port(dev->name() + "-pioport"), device(dev), platform(p)
37PioPort::PioPort(PioDevice *dev, Platform *p, std::string pname)
38 : Port(dev->name() + pname), device(dev), platform(p)
39{ }
40
41
42Tick
43PioPort::recvAtomic(Packet *pkt)
44{
45 return device->recvAtomic(pkt);
46}

--- 27 unchanged lines hidden (view full) ---

74PioPort::SendEvent::process()
75{
76 if (port->Port::sendTiming(packet))
77 return;
78
79 port->transmitList.push_back(packet);
80}
81
39{ }
40
41
42Tick
43PioPort::recvAtomic(Packet *pkt)
44{
45 return device->recvAtomic(pkt);
46}

--- 27 unchanged lines hidden (view full) ---

74PioPort::SendEvent::process()
75{
76 if (port->Port::sendTiming(packet))
77 return;
78
79 port->transmitList.push_back(packet);
80}
81
82void
83PioPort::resendNacked(Packet *pkt) {
84 pkt->reinitNacked();
85 if (transmitList.size()) {
86 transmitList.push_front(pkt);
87 } else {
88 if (!Port::sendTiming(pkt))
89 transmitList.push_front(pkt);
90 }
91};
82
83
84bool
85PioPort::recvTiming(Packet *pkt)
86{
87 if (pkt->result == Packet::Nacked) {
92
93
94bool
95PioPort::recvTiming(Packet *pkt)
96{
97 if (pkt->result == Packet::Nacked) {
88 pkt->reinitNacked();
89 if (transmitList.size()) {
90 transmitList.push_front(pkt);
91 } else {
92 if (!Port::sendTiming(pkt))
93 transmitList.push_front(pkt);
94 }
98 resendNacked(pkt);
95 } else {
96 Tick latency = device->recvAtomic(pkt);
97 // turn packet around to go back to requester
98 pkt->makeTimingResponse();
99 sendTiming(pkt, latency);
100 }
101 return true;
102}

--- 162 unchanged lines hidden ---
99 } else {
100 Tick latency = device->recvAtomic(pkt);
101 // turn packet around to go back to requester
102 pkt->makeTimingResponse();
103 sendTiming(pkt, latency);
104 }
105 return true;
106}

--- 162 unchanged lines hidden ---