mem: Remove a check that the memory size is a multiple of the page size.
There are a few problems with this check. 1. Many ISAs support multiple page sizes. 2. Memories (particularly small ROMs) may not actually be in multiples of the page size. 3. In a heterogenous environment, there won't be a single page size even if each ISA picks a canonical page size. 4. Other than catching some egregious configuration mistakes, there's nothing functionally wrong/different about a memory that isn't evenly coverable in pages, especially in systems or configurations that don't even use paging. Change-Id: I3cd241657318d2e3fd5a1226cb54fdebbf172788 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/26423 Maintainer: Gabe Black <gabeblack@google.com> Maintainer: Jason Lowe-Power <power.jg@gmail.com> Reviewed-by: Jason Lowe-Power <power.jg@gmail.com> Tested-by: Gem5 Cloud Project GCB service account <345032938727@cloudbuild.gserviceaccount.com>
This commit is contained in:
@@ -61,15 +61,9 @@ AbstractMemory::AbstractMemory(const Params *p) :
|
||||
kvmMap(p->kvm_map), _system(NULL),
|
||||
stats(*this)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
AbstractMemory::init()
|
||||
{
|
||||
assert(system());
|
||||
|
||||
if (size() % _system->getPageBytes() != 0)
|
||||
panic("Memory Size not divisible by page size\n");
|
||||
panic_if(!range.valid() || !range.size(),
|
||||
"Memory range %s must be valid with non-zero size.",
|
||||
range.to_string());
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -209,11 +209,6 @@ class AbstractMemory : public ClockedObject
|
||||
AbstractMemory(const Params* p);
|
||||
virtual ~AbstractMemory() {}
|
||||
|
||||
/**
|
||||
* Initialise this memory.
|
||||
*/
|
||||
void init() override;
|
||||
|
||||
/**
|
||||
* See if this is a null memory that should never store data and
|
||||
* always return zero.
|
||||
|
||||
Reference in New Issue
Block a user