4 Commits

Author SHA1 Message Date
eyck e238369e18 cleansup htif call 2025-03-15 06:54:21 +01:00
eyck cfc980a069 Merge branch 'feature/privilege_refactor' into develop 2025-03-14 20:00:07 +01:00
eyck 71260a3ef4 Merge remote-tracking branch 'origin/feature/htif' into develop 2025-03-14 11:32:36 +01:00
hongyu aaebeaf023 changes the io_buf 2025-03-11 12:00:31 +01:00
2 changed files with 4 additions and 9 deletions
+1
View File
@@ -399,6 +399,7 @@ template <typename BASE, typename LOGCAT = logging::disass> struct riscv_hart_co
CPPLOG(INFO) << "tohost send '" << io_buf.str() << "'";
}
}
std::unordered_map<std::string, uint64_t> symbol_table;
uint64_t entry_address{0};
uint64_t tohost = std::numeric_limits<uint64_t>::max();
+2 -8
View File
@@ -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<uint64_t*>(p.data() + (hart_if.fromhost & mem.page_addr_mask));
*reinterpret_cast<uint64_t*>(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;
}