Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ if(NOT TARGET dbt-rise-core)
FetchContent_Declare(
dbt_rise_core_git
GIT_REPOSITORY "https://github.com/Minres/DBT-RISE-Core.git"
GIT_TAG 7cd010c
GIT_TAG 29e97c02
GIT_SHALLOW OFF
UPDATE_DISCONNECTED NOT ${UPDATE_EXTERNAL_PROJECT} # When enabled, this option causes the update step to be skipped.
)
Expand Down
2 changes: 1 addition & 1 deletion src/decoder_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ int main(int argc, char* argv[]) {
}());

std::ofstream json_out{"idecode_tree.json"};
json_out << instr_decoder.print_tree_as_pretty_json();
json_out << instr_decoder.print_tree_as_json();

auto inst_index1 = instr_decoder.decode_instr(0x8440);
auto inst_index2 = instr_decoder.decode_instr(0x86b0);
Expand Down
7 changes: 7 additions & 0 deletions src/sysc/core2sc_adapter.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
#include <scc/async_event.h>
#include <scc/report.h>
#include <shared_mutex>
#include <sysc/kernel/sc_simcontext.h>
#include <sysc/kernel/sc_time.h>
#include <util/instance_logger.h>
#include <util/ities.h>
Expand Down Expand Up @@ -262,13 +263,19 @@ template <typename PLAT> class core2sc_adapter : public PLAT, public sc2core_if
SCCDEBUG(owner->hier_name()) << "Sleeping until interrupt";
wfi_inst.store(true, std::memory_order_relaxed);
std::function<void(void)> f = [this]() {
auto start = sc_core::sc_time_stamp();
while((this->mip_csr & this->mie_csr) == 0) {
sc_core::wait(this->wfi_evt | this->debugger_stop_evt);
bool is_debugger_stop_evt = this->debugger_stop_evt.triggered();
if(is_debugger_stop_evt)
break;
}
SCCINFO(this->owner->hier_name()) << "Got WFI event";
auto duration = sc_core::sc_time_stamp() - start;
if(clk_if && duration > sc_core::SC_ZERO_TIME) {
auto cycles = duration.value() / clk_if->read().value();
this->reg.cycle += cycles;
}
};
owner->exec_on_sysc(f);
wfi_inst.store(false, std::memory_order_relaxed);
Expand Down
1 change: 1 addition & 0 deletions src/sysc/core_complex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ void core_complex<BUSWIDTH, QK>::create_cpu(std::string const& type, std::string
SCCFATAL() << "Could not create vm for isa " << type << " and backend " << backend;
} else {
core->set_hartid(hart_id);
core->set_clk_if(clk_i.get_interface(0));
core->set_clint_irq_count(clint_irq_i.size());
auto* srv = debugger::server<debugger::gdb_session>::get();
if(srv)
Expand Down
4 changes: 4 additions & 0 deletions src/sysc/sc2core_if.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ struct sc2core_if {
util::delegate<void(unsigned, wr_csr_f)> register_csr_wr;
virtual void register_unknown_instr_handler(util::delegate<iss::arch_if::unknown_instr_cb_t>) = 0;
virtual void set_clint_irq_count(size_t) = 0;
void set_clk_if(sc_core::sc_signal_in_if<sc_core::sc_time>* clk_if) { this->clk_if = clk_if; };

protected:
sc_core::sc_signal_in_if<sc_core::sc_time>* clk_if{nullptr};
};
} // namespace sysc
#endif /* _SYSC_SC2CORE_IF_H_ */
Loading