fixes tohost handling

This commit is contained in:
Eyck-Alexander Jentzsch 2024-05-31 10:43:38 +02:00
parent 2a7449fa1e
commit 41051f8f34
1 changed files with 2 additions and 5 deletions

View File

@ -293,7 +293,7 @@ public:
void set_irq_num(unsigned i) { mcause_max_irq = 1 << util::ilog2(i); } void set_irq_num(unsigned i) { mcause_max_irq = 1 << util::ilog2(i); }
void set_semihosting_callback(semihosting_cb_t<reg_t> cb) { semihosting_cb = cb; }; void set_semihosting_callback(semihosting_cb_t<reg_t> cb) { semihosting_cb = cb; };
protected: protected:
struct riscv_instrumentation_if : public iss::instrumentation_if { struct riscv_instrumentation_if : public iss::instrumentation_if {
@ -354,7 +354,7 @@ protected:
bool tohost_lower_written = false; bool tohost_lower_written = false;
riscv_instrumentation_if instr_if; riscv_instrumentation_if instr_if;
semihosting_cb_t<reg_t> semihosting_cb; semihosting_cb_t<reg_t> semihosting_cb;
using mem_type = util::sparse_array<uint8_t, 1ULL << 32>; using mem_type = util::sparse_array<uint8_t, 1ULL << 32>;
using csr_type = util::sparse_array<typename traits<BASE>::reg_t, 1ULL << 12, 12>; using csr_type = util::sparse_array<typename traits<BASE>::reg_t, 1ULL << 12, 12>;
@ -1125,9 +1125,6 @@ iss::status riscv_hart_m_p<BASE, FEAT>::write_mem(phys_addr_t paddr, unsigned le
} }
this->reg.trap_state = std::numeric_limits<uint32_t>::max(); this->reg.trap_state = std::numeric_limits<uint32_t>::max();
this->interrupt_sim = hostvar; this->interrupt_sim = hostvar;
#ifndef WITH_TCC
// throw(iss::simulation_stopped(hostvar));
#endif
break; break;
case 0x0101: { case 0x0101: {
char c = static_cast<char>(hostvar & 0xff); char c = static_cast<char>(hostvar & 0xff);