feat(npc): ebreak support through external inst matching

This commit is contained in:
xinyangli 2024-04-11 11:44:54 +08:00
parent 55230247b2
commit e99236f711
Signed by: xin
SSH key fingerprint: SHA256:qZ/tzd8lYRtUFSrfBDBMcUqV4GHKxqeqRA3huItgvbk
8 changed files with 97 additions and 25 deletions

View file

@ -49,8 +49,10 @@ vpiHandle pc = nullptr;
namespace NPC {
void npc_memcpy(paddr_t addr, void *buf, size_t sz, bool direction) {
if (direction == TRM_FROM_MACHINE) {
memcpy(buf, static_cast<Memory<int, 128 * 1024> *>(pmem_get())->mem.data(),
sz);
memcpy(
buf,
static_cast<Memory<int, 128 * 1024> *>(pmem_get())->guest_to_host(addr),
sz);
}
};