cpu: Add byteEnable assertions to readMem and initateMemRead

Those are already present in writeMem; looking for consistency

Change-Id: Ib85e0db228bc73e3ac64155d1290444cf6864a8c
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23281
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
This commit is contained in:
Giacomo Travaglini
2019-11-27 15:45:57 +00:00
parent 390a74f599
commit f73caae20f
4 changed files with 7 additions and 0 deletions

View File

@@ -965,6 +965,7 @@ BaseDynInst<Impl>::initiateMemRead(Addr addr, unsigned size,
Request::Flags flags,
const std::vector<bool>& byteEnable)
{
assert(byteEnable.empty() || byteEnable.size() == size);
return cpu->pushRequest(
dynamic_cast<typename DynInstPtr::PtrType>(this),
/* ld */ true, nullptr, size, addr, flags, nullptr, nullptr,
@@ -977,6 +978,7 @@ BaseDynInst<Impl>::writeMem(uint8_t *data, unsigned size, Addr addr,
Request::Flags flags, uint64_t *res,
const std::vector<bool>& byteEnable)
{
assert(byteEnable.empty() || byteEnable.size() == size);
return cpu->pushRequest(
dynamic_cast<typename DynInstPtr::PtrType>(this),
/* st */ false, data, size, addr, flags, res, nullptr, byteEnable);

View File

@@ -178,6 +178,8 @@ CheckerCPU::readMem(Addr addr, uint8_t *data, unsigned size,
Request::Flags flags,
const std::vector<bool>& byteEnable)
{
assert(byteEnable.empty() || byteEnable.size() == size);
Fault fault = NoFault;
bool checked_flags = false;
bool flags_match = true;

View File

@@ -116,6 +116,7 @@ class ExecContext : public ::ExecContext
const std::vector<bool>& byteEnable = std::vector<bool>())
override
{
assert(byteEnable.empty() || byteEnable.size() == size);
return execute.getLSQ().pushRequest(inst, true /* load */, nullptr,
size, addr, flags, nullptr, nullptr, byteEnable);
}

View File

@@ -440,6 +440,7 @@ class SimpleExecContext : public ExecContext {
const std::vector<bool>& byteEnable = std::vector<bool>())
override
{
assert(byteEnable.empty() || byteEnable.size() == size);
return cpu->readMem(addr, data, size, flags, byteEnable);
}
@@ -449,6 +450,7 @@ class SimpleExecContext : public ExecContext {
const std::vector<bool>& byteEnable = std::vector<bool>())
override
{
assert(byteEnable.empty() || byteEnable.size() == size);
return cpu->initiateMemRead(addr, size, flags, byteEnable);
}