fastmodel: Use Iris API to access memory

Memory space is not always outside of the CPU. For example the tightly
coupled memory (TCM) is inside of the core. To make gdb access those
kind of memory, we should use Iris memory API to read and write memory.
If we access a memory address not inside the CPU with Iris memory API.
The CPU would fire a request via amba transport_dbg. So the change also
covers the original behavior.

Change-Id: Ie223ab12f9a746ebafa21026a8680222f6ebd593
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/45581
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
Yu-hsin Wang
2021-05-17 10:44:59 +08:00
parent a4b3db0b9e
commit 8b53b8bcdf

View File

@@ -503,9 +503,15 @@ ThreadContext::getCurrentInstCount()
void
ThreadContext::sendFunctional(PacketPtr pkt)
{
auto *iris_cpu = dynamic_cast<Iris::BaseCPU *>(getCpuPtr());
assert(iris_cpu);
iris_cpu->evs_base_cpu->sendFunc(pkt);
auto addr = pkt->getAddr();
auto size = pkt->getSize();
auto data = pkt->getPtr<uint8_t>();
pkt->makeResponse();
if (pkt->isRead())
readMem(addr, data, size);
else
writeMem(addr, data, size);
}
ThreadContext::Status