Skip to content

Commit 69b253b

Browse files
committed
adds void logger for systemc
Traps are logged using disass too, so without this fix they segfault
1 parent f1d65b5 commit 69b253b

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/sysc/core2sc_adapter.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,7 @@ template <typename PLAT> class core2sc_adapter : public PLAT, public sc2core_if
9999
this->disass_func =
100100
util::delegate<void(uint64_t, std::string const&, bool)>::from<this_class, &this_class::record_n_print_disass>(this);
101101
else
102-
this->disass_func =
103-
util::delegate<void(uint64_t, std::string const&, bool)>::from<this_class, &this_class::record_n_print_disass>(nullptr);
102+
this->disass_func = util::delegate<void(uint64_t, std::string const&, bool)>::from<this_class, &this_class::no_disass>(this);
104103
}
105104

106105
void set_clint_irq_count(size_t num) override { this->set_clint_irq_num(num); }
@@ -177,7 +176,7 @@ template <typename PLAT> class core2sc_adapter : public PLAT, public sc2core_if
177176
SCCINFO(owner->hier_name()) << "[disass] " << str;
178177
}
179178
};
180-
179+
void no_disass(uint64_t pc, std::string const& str, bool printpc) { return; };
181180
iss::mem::memory_if get_mem_if() {
182181
return iss::mem::memory_if{.rd_mem{util::delegate<iss::mem::rd_mem_func_sig>::from<this_class, &this_class::read_mem>(this)},
183182
.wr_mem{util::delegate<iss::mem::wr_mem_func_sig>::from<this_class, &this_class::write_mem>(this)}};

0 commit comments

Comments
 (0)