mem: Ensure that RangeAddrMapper publishes its address range.

This class, because it inherits from AddrMapper, would only poke its
upstream port to let it know to request its address range if it's
downstream port had asked it to. This doesn't make sense, since the
RangeAddrMapper has a fixed range it will respond to. Also, when the
RangeAddrMapper is notified that it's downstream port has an updated
range, the mapper should request that range and make sure all of the
addresses it will output are in the range the other object expects.

Change-Id: I57b558644b103822a9af53733bdb8518836ef5de
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/43346
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
Gabe Black
2021-03-20 04:04:59 -07:00
committed by Gabe Black
parent 34c82f7266
commit 68423ea20d

View File

@@ -226,7 +226,7 @@ class AddrMapper : public SimObject
void recvRespRetry();
void recvRangeChange();
virtual void recvRangeChange();
};
/**
@@ -244,6 +244,13 @@ class RangeAddrMapper : public AddrMapper
AddrRangeList getAddrRanges() const override;
void
init() override
{
AddrMapper::init();
cpuSidePort.sendRangeChange();
}
protected:
/**
* This contains a list of ranges the should be remapped. It must
@@ -259,6 +266,12 @@ class RangeAddrMapper : public AddrMapper
std::vector<AddrRange> remappedRanges;
Addr remapAddr(Addr addr) const override;
void
recvRangeChange() override
{
// TODO Check that our peer is actually expecting to receive accesses
// in our output range(s).
}
};
#endif //__MEM_ADDR_MAPPER_HH__