addr_mapper.cc (9279:8b16c3804bda) addr_mapper.cc (9294:8fb03b13de02)
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

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

54
55 if ((slavePort.peerBlockSize() != masterPort.peerBlockSize()) &&
56 slavePort.peerBlockSize() && masterPort.peerBlockSize())
57 fatal("Slave port size %d, master port size %d \n "
58 "don't have the same block size... Not supported.\n",
59 slavePort.peerBlockSize(), masterPort.peerBlockSize());
60}
61
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

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

54
55 if ((slavePort.peerBlockSize() != masterPort.peerBlockSize()) &&
56 slavePort.peerBlockSize() && masterPort.peerBlockSize())
57 fatal("Slave port size %d, master port size %d \n "
58 "don't have the same block size... Not supported.\n",
59 slavePort.peerBlockSize(), masterPort.peerBlockSize());
60}
61
62MasterPort&
63AddrMapper::getMasterPort(const std::string& if_name, int idx)
62BaseMasterPort&
63AddrMapper::getMasterPort(const std::string& if_name, PortID idx)
64{
65 if (if_name == "master") {
66 return masterPort;
67 } else {
68 return MemObject::getMasterPort(if_name, idx);
69 }
70}
71
64{
65 if (if_name == "master") {
66 return masterPort;
67 } else {
68 return MemObject::getMasterPort(if_name, idx);
69 }
70}
71
72SlavePort&
73AddrMapper::getSlavePort(const std::string& if_name, int idx)
72BaseSlavePort&
73AddrMapper::getSlavePort(const std::string& if_name, PortID idx)
74{
75 if (if_name == "slave") {
76 return slavePort;
77 } else {
78 return MemObject::getSlavePort(if_name, idx);
79 }
80}
81

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

187AddrMapper::recvTimingSnoopResp(PacketPtr pkt)
188{
189 return masterPort.sendTimingSnoopResp(pkt);
190}
191
192bool
193AddrMapper::isSnooping() const
194{
74{
75 if (if_name == "slave") {
76 return slavePort;
77 } else {
78 return MemObject::getSlavePort(if_name, idx);
79 }
80}
81

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

187AddrMapper::recvTimingSnoopResp(PacketPtr pkt)
188{
189 return masterPort.sendTimingSnoopResp(pkt);
190}
191
192bool
193AddrMapper::isSnooping() const
194{
195 if (slavePort.getMasterPort().isSnooping())
195 if (slavePort.isSnooping())
196 fatal("AddrMapper doesn't support remapping of snooping requests\n");
197 return false;
198}
199
200unsigned
201AddrMapper::deviceBlockSizeMaster()
202{
203 return slavePort.peerBlockSize();

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

261
262 return addr;
263}
264
265AddrRangeList
266RangeAddrMapper::getAddrRanges() const
267{
268 AddrRangeList ranges;
196 fatal("AddrMapper doesn't support remapping of snooping requests\n");
197 return false;
198}
199
200unsigned
201AddrMapper::deviceBlockSizeMaster()
202{
203 return slavePort.peerBlockSize();

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

261
262 return addr;
263}
264
265AddrRangeList
266RangeAddrMapper::getAddrRanges() const
267{
268 AddrRangeList ranges;
269 AddrRangeList actualRanges = masterPort.getSlavePort().getAddrRanges();
269 AddrRangeList actualRanges = masterPort.getAddrRanges();
270
271 for (AddrRangeIter r = actualRanges.begin(); r != actualRanges.end(); ++r) {
272 AddrRange range = *r;
273
274 for (int j = 0; j < originalRanges.size(); ++j) {
275 if (range.intersects(originalRanges[j]))
276 fatal("Cannot remap range that intersects the original"
277 " ranges but are not a subset.\n");

--- 14 unchanged lines hidden ---
270
271 for (AddrRangeIter r = actualRanges.begin(); r != actualRanges.end(); ++r) {
272 AddrRange range = *r;
273
274 for (int j = 0; j < originalRanges.size(); ++j) {
275 if (range.intersects(originalRanges[j]))
276 fatal("Cannot remap range that intersects the original"
277 " ranges but are not a subset.\n");

--- 14 unchanged lines hidden ---