arch: Add raw read/writeMem helpers
authorGiacomo Travaglini <giacomo.travaglini@arm.com>
Mon, 9 Dec 2019 14:01:33 +0000 (14:01 +0000)
committerGiacomo Travaglini <giacomo.travaglini@arm.com>
Wed, 30 Sep 2020 08:50:39 +0000 (08:50 +0000)
commit0eab4bf2af73ffd9813eeba961589b0cb969bcfb
tree02a4311a90f06cac2c5ed26c489b9b83dccdbac5
parentd29349ead6384cdc1b28236ca3eeb1d79914a66f
arch: Add raw read/writeMem helpers

With some exceptions (in arm/x86) the standard memory read/write interface
for instructions relies upon the helper functions in

src/arch/generic/memhelpers.hh

which wrap the ExecContext interface.

(readMem, writeMem...)

Those helpers rely on the source/destination data to be provided (as
expected) but not on the size of the transaction. The latter gets
evaluated via the host size of the source/destination data
(sizeof(MemT)).
For this reason some instructions, which are instead using an
incompatible MemT data (as an example, a SIMD operation loading data in
an array of integers), make direct use of the ExecContext interface,
which is simply requesting for a pointer and a number of bytes.
Some other instructions are using the ExecContext interface since the
helpers do not accept a byteEnable argument.

This patch is adding some helpers to address these issues. The idea is
to deprecate direct usage of the ExecContext APIs.
These new wrappers do not work with the type detection mechanism
to evaluate the number of bytes we are accessing.

JIRA: https://gem5.atlassian.net/browse/GEM5-196

Change-Id: I5b822d278bdf325a68a01aa1861b6487c6628245
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23527
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Gabe Black <gabeblack@google.com>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Maintainer: Gabe Black <gabeblack@google.com>
src/arch/generic/memhelpers.hh