From e238369e1864ec70f21ad6e9c2f65a63f7c1e43e Mon Sep 17 00:00:00 2001 From: Eyck Jentzsch Date: Sat, 15 Mar 2025 06:54:21 +0100 Subject: [PATCH] cleansup htif call --- src/iss/mmio/memory_with_htif.h | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/iss/mmio/memory_with_htif.h b/src/iss/mmio/memory_with_htif.h index f9c3ebe..2a4d6e1 100644 --- a/src/iss/mmio/memory_with_htif.h +++ b/src/iss/mmio/memory_with_htif.h @@ -40,14 +40,8 @@ private: std::copy(data, data + length, p.data() + (addr & mem.page_addr_mask)); // this->tohost handling in case of riscv-test // according to https://github.com/riscv-software-src/riscv-isa-sim/issues/364#issuecomment-607657754: - if(access && iss::access_type::FUNC) { - if(addr == hart_if.tohost) { - return hart_if.exec_htif(data); - } - if((WORD_LEN == 32 && addr == hart_if.fromhost + 4) || (WORD_LEN == 64 && addr == hart_if.fromhost)) { - uint64_t fhostvar = *reinterpret_cast(p.data() + (hart_if.fromhost & mem.page_addr_mask)); - *reinterpret_cast(p.data() + (hart_if.tohost & mem.page_addr_mask)) = fhostvar; - } + if(access && iss::access_type::FUNC && addr == hart_if.tohost) { + return hart_if.exec_htif(data); } return iss::Ok; } @@ -59,4 +53,4 @@ protected: }; } // namespace mmio } // namespace iss -#endif // _MEMORY_WITH_HTIF_ \ No newline at end of file +#endif // _MEMORY_WITH_HTIF_