Skip to content

Commit b5d367d

Browse files
committed
fixes clint irq count propagation
1 parent c9b5b07 commit b5d367d

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

src/sysc/core2sc_adapter.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,8 @@ template <typename PLAT> class core2sc_adapter : public PLAT, public sc2core_if
103103
util::delegate<void(uint64_t, std::string const&, bool)>::from<this_class, &this_class::record_n_print_disass>(nullptr);
104104
}
105105

106+
void set_clint_irq_count(size_t num) override { this->set_clint_irq_num(num); }
107+
106108
void register_unknown_instr_handler(util::delegate<iss::arch_if::unknown_instr_cb_t> handler) override {
107109
PLAT::unknown_instr_cb = handler;
108110
};
@@ -260,7 +262,8 @@ template <typename PLAT> class core2sc_adapter : public PLAT, public sc2core_if
260262
while((this->csr[iss::arch::mip] & this->csr[iss::arch::mie]) == 0) {
261263
sc_core::wait(this->wfi_evt | this->debugger_stop_evt);
262264
bool is_debugger_stop_evt = this->debugger_stop_evt.triggered();
263-
if(is_debugger_stop_evt) break;
265+
if(is_debugger_stop_evt)
266+
break;
264267
}
265268
SCCINFO(this->owner->hier_name()) << "Got WFI event";
266269
};

src/sysc/core_complex.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ void core_complex<BUSWIDTH, QK>::create_cpu(std::string const& type, std::string
166166
SCCFATAL() << "Could not create vm for isa " << type << " and backend " << backend;
167167
} else {
168168
core->set_hartid(hart_id);
169+
core->set_clint_irq_count(clint_irq_i.size());
169170
auto* srv = debugger::server<debugger::gdb_session>::get();
170171
if(srv)
171172
tgt_adapter = srv->get_target(0); // FIXME: add core_id

src/sysc/sc2core_if.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ struct sc2core_if {
6565
using wr_csr_f = std::function<iss::status(unsigned addr, uint64_t)>;
6666
util::delegate<void(unsigned, wr_csr_f)> register_csr_wr;
6767
virtual void register_unknown_instr_handler(util::delegate<iss::arch_if::unknown_instr_cb_t>) = 0;
68+
virtual void set_clint_irq_count(size_t) = 0;
6869
};
6970
} // namespace sysc
7071
#endif /* _SYSC_SC2CORE_IF_H_ */

0 commit comments

Comments
 (0)