Fix address range calculation. Still need bus to handle snoop ranges.

On the way towards multi-level caches (L2)

src/mem/cache/base_cache.cc:
src/mem/cache/base_cache.hh:
    Fix address range calculation.  Still need bus to handle snoop ranges.

--HG--
extra : convert_revision : 800078d88aab5e563f4a9bb599f91cd44f36e625
This commit is contained in:
Ron Dreslinski 2006-07-07 16:02:22 -04:00
parent 76c110d924
commit 7811500eef
2 changed files with 34 additions and 5 deletions

View file

@ -59,7 +59,7 @@ void
BaseCache::CachePort::getDeviceAddressRanges(AddrRangeList &resp, BaseCache::CachePort::getDeviceAddressRanges(AddrRangeList &resp,
AddrRangeList &snoop) AddrRangeList &snoop)
{ {
cache->getAddressRanges(resp, snoop); cache->getAddressRanges(resp, snoop, isCpuSide);
} }
int int
@ -166,6 +166,14 @@ BaseCache::getPort(const std::string &if_name, int idx)
else panic("Port name %s unrecognized\n", if_name); else panic("Port name %s unrecognized\n", if_name);
} }
void
BaseCache::init()
{
if (!cpuSidePort || !memSidePort)
panic("Cache not hooked up on both sides\n");
cpuSidePort->sendStatusChange(Port::RangeChange);
}
void void
BaseCache::regStats() BaseCache::regStats()
{ {

View file

@ -143,9 +143,19 @@ class BaseCache : public MemObject
fatal("No implementation"); fatal("No implementation");
} }
virtual void recvStatusChange(Port::Status status, bool isCpuSide) void recvStatusChange(Port::Status status, bool isCpuSide)
{ {
fatal("No implementation"); if (status == Port::RangeChange)
{
if (!isCpuSide)
{
cpuSidePort->sendStatusChange(Port::RangeChange);
}
else
{
memSidePort->sendStatusChange(Port::RangeChange);
}
}
} }
virtual Packet *getPacket() virtual Packet *getPacket()
@ -320,6 +330,8 @@ class BaseCache : public MemObject
memSidePort = NULL; memSidePort = NULL;
} }
virtual void init();
/** /**
* Query block size of a cache. * Query block size of a cache.
* @return The block size * @return The block size
@ -519,9 +531,18 @@ class BaseCache : public MemObject
*/ */
void rangeChange() {} void rangeChange() {}
void getAddressRanges(AddrRangeList &resp, AddrRangeList &snoop) void getAddressRanges(AddrRangeList &resp, AddrRangeList &snoop, bool isCpuSide)
{ {
panic("Unimplimented\n"); if (isCpuSide)
{
AddrRangeList dummy;
memSidePort->getPeerAddressRanges(resp, dummy);
}
else
{
//This is where snoops get updated
return;
}
} }
}; };