port.cc (9031:32ecc0217c5e) port.cc (9087:b5a084a6159b)
1/*
2 * Copyright (c) 2012 ARM Limited
3 * All rights reserved
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software

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

46 * @file
47 * Port object definitions.
48 */
49#include "base/trace.hh"
50#include "mem/mem_object.hh"
51#include "mem/port.hh"
52
53Port::Port(const std::string &_name, MemObject& _owner, PortID _id)
1/*
2 * Copyright (c) 2012 ARM Limited
3 * All rights reserved
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software

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

46 * @file
47 * Port object definitions.
48 */
49#include "base/trace.hh"
50#include "mem/mem_object.hh"
51#include "mem/port.hh"
52
53Port::Port(const std::string &_name, MemObject& _owner, PortID _id)
54 : portName(_name), id(_id), peer(NULL), owner(_owner)
54 : portName(_name), id(_id), owner(_owner)
55{
56}
57
58Port::~Port()
59{
60}
61
62/**

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

81 return *_slavePort;
82}
83
84void
85MasterPort::bind(SlavePort& slave_port)
86{
87 // master port keeps track of the slave port
88 _slavePort = &slave_port;
55{
56}
57
58Port::~Port()
59{
60}
61
62/**

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

81 return *_slavePort;
82}
83
84void
85MasterPort::bind(SlavePort& slave_port)
86{
87 // master port keeps track of the slave port
88 _slavePort = &slave_port;
89 peer = &slave_port;
90
91 // slave port also keeps track of master port
92 _slavePort->bind(*this);
93}
94
95bool
96MasterPort::isConnected() const
97{

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

128bool
129MasterPort::sendTimingSnoopResp(PacketPtr pkt)
130{
131 assert(pkt->isResponse());
132 return _slavePort->recvTimingSnoopResp(pkt);
133}
134
135void
89
90 // slave port also keeps track of master port
91 _slavePort->bind(*this);
92}
93
94bool
95MasterPort::isConnected() const
96{

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

127bool
128MasterPort::sendTimingSnoopResp(PacketPtr pkt)
129{
130 assert(pkt->isResponse());
131 return _slavePort->recvTimingSnoopResp(pkt);
132}
133
134void
135MasterPort::sendRetry()
136{
137 _slavePort->recvRetry();
138}
139
140void
136MasterPort::printAddr(Addr a)
137{
138 Request req(a, 1, 0, Request::funcMasterId);
139 Packet pkt(&req, MemCmd::PrintReq);
140 Packet::PrintReqState prs(std::cerr);
141 pkt.senderState = &prs;
142
143 sendFunctional(&pkt);

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

154SlavePort::~SlavePort()
155{
156}
157
158void
159SlavePort::bind(MasterPort& master_port)
160{
161 _masterPort = &master_port;
141MasterPort::printAddr(Addr a)
142{
143 Request req(a, 1, 0, Request::funcMasterId);
144 Packet pkt(&req, MemCmd::PrintReq);
145 Packet::PrintReqState prs(std::cerr);
146 pkt.senderState = &prs;
147
148 sendFunctional(&pkt);

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

159SlavePort::~SlavePort()
160{
161}
162
163void
164SlavePort::bind(MasterPort& master_port)
165{
166 _masterPort = &master_port;
162 peer = &master_port;
163}
164
165MasterPort&
166SlavePort::getMasterPort() const
167{
168 if (_masterPort == NULL)
169 panic("Cannot getMasterPort on slave port %s that is not connected\n",
170 name());

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

206}
207
208void
209SlavePort::sendTimingSnoopReq(PacketPtr pkt)
210{
211 assert(pkt->isRequest());
212 _masterPort->recvTimingSnoopReq(pkt);
213}
167}
168
169MasterPort&
170SlavePort::getMasterPort() const
171{
172 if (_masterPort == NULL)
173 panic("Cannot getMasterPort on slave port %s that is not connected\n",
174 name());

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

210}
211
212void
213SlavePort::sendTimingSnoopReq(PacketPtr pkt)
214{
215 assert(pkt->isRequest());
216 _masterPort->recvTimingSnoopReq(pkt);
217}
218
219void
220SlavePort::sendRetry()
221{
222 _masterPort->recvRetry();
223}