fixes SystemC wrapper wrt. templated core_complex
This commit is contained in:
parent
a45fcd28db
commit
0473aa5344
|
@ -125,7 +125,7 @@ using vm_ptr = std::unique_ptr<iss::vm_if>;
|
||||||
|
|
||||||
class core_wrapper {
|
class core_wrapper {
|
||||||
public:
|
public:
|
||||||
core_wrapper(core_complex* owner)
|
core_wrapper(core_complex_if* owner)
|
||||||
: owner(owner) {}
|
: owner(owner) {}
|
||||||
|
|
||||||
void reset(uint64_t addr) { vm->reset(addr); }
|
void reset(uint64_t addr) { vm->reset(addr); }
|
||||||
|
@ -181,7 +181,7 @@ public:
|
||||||
"SystemC sub-commands: break <time>, print_time"});
|
"SystemC sub-commands: break <time>, print_time"});
|
||||||
}
|
}
|
||||||
|
|
||||||
core_complex* const owner;
|
core_complex_if* const owner;
|
||||||
vm_ptr vm{nullptr};
|
vm_ptr vm{nullptr};
|
||||||
sc_cpu_ptr cpu{nullptr};
|
sc_cpu_ptr cpu{nullptr};
|
||||||
iss::debugger::target_adapter_if* tgt_adapter{nullptr};
|
iss::debugger::target_adapter_if* tgt_adapter{nullptr};
|
||||||
|
@ -197,7 +197,6 @@ struct core_trace {
|
||||||
scv_tr_handle tr_handle;
|
scv_tr_handle tr_handle;
|
||||||
};
|
};
|
||||||
|
|
||||||
SC_HAS_PROCESS(core_complex); // NOLINT
|
|
||||||
#ifndef CWR_SYSTEMC
|
#ifndef CWR_SYSTEMC
|
||||||
template <unsigned int BUSWIDTH>
|
template <unsigned int BUSWIDTH>
|
||||||
core_complex<BUSWIDTH>::core_complex(sc_module_name const& name)
|
core_complex<BUSWIDTH>::core_complex(sc_module_name const& name)
|
||||||
|
|
|
@ -83,6 +83,7 @@ struct core_complex_if {
|
||||||
|
|
||||||
virtual unsigned get_last_bus_cycles() =0;
|
virtual unsigned get_last_bus_cycles() =0;
|
||||||
|
|
||||||
|
//! Allow quantum keeper handling
|
||||||
virtual void sync(uint64_t) =0;
|
virtual void sync(uint64_t) =0;
|
||||||
|
|
||||||
virtual char const* hier_name() = 0;
|
virtual char const* hier_name() = 0;
|
||||||
|
|
|
@ -46,12 +46,12 @@ using namespace sysc;
|
||||||
volatile std::array<bool, 2> tgc_init = {
|
volatile std::array<bool, 2> tgc_init = {
|
||||||
iss_factory::instance().register_creator("tgc5c|m_p|interp",
|
iss_factory::instance().register_creator("tgc5c|m_p|interp",
|
||||||
[](unsigned gdb_port, void* data) -> iss_factory::base_t {
|
[](unsigned gdb_port, void* data) -> iss_factory::base_t {
|
||||||
auto cc = reinterpret_cast<sysc::tgfs::core_complex*>(data);
|
auto cc = reinterpret_cast<sysc::tgfs::core_complex_if*>(data);
|
||||||
auto* cpu = new sc_core_adapter<arch::riscv_hart_m_p<arch::tgc5c>>(cc);
|
auto* cpu = new sc_core_adapter<arch::riscv_hart_m_p<arch::tgc5c>>(cc);
|
||||||
return {sysc::sc_cpu_ptr{cpu}, vm_ptr{create(static_cast<arch::tgc5c*>(cpu), gdb_port)}};
|
return {sysc::sc_cpu_ptr{cpu}, vm_ptr{create(static_cast<arch::tgc5c*>(cpu), gdb_port)}};
|
||||||
}),
|
}),
|
||||||
iss_factory::instance().register_creator("tgc5c|mu_p|interp", [](unsigned gdb_port, void* data) -> iss_factory::base_t {
|
iss_factory::instance().register_creator("tgc5c|mu_p|interp", [](unsigned gdb_port, void* data) -> iss_factory::base_t {
|
||||||
auto cc = reinterpret_cast<sysc::tgfs::core_complex*>(data);
|
auto cc = reinterpret_cast<sysc::tgfs::core_complex_if*>(data);
|
||||||
auto* cpu = new sc_core_adapter<arch::riscv_hart_mu_p<arch::tgc5c>>(cc);
|
auto* cpu = new sc_core_adapter<arch::riscv_hart_mu_p<arch::tgc5c>>(cc);
|
||||||
return {sysc::sc_cpu_ptr{cpu}, vm_ptr{create(static_cast<arch::tgc5c*>(cpu), gdb_port)}};
|
return {sysc::sc_cpu_ptr{cpu}, vm_ptr{create(static_cast<arch::tgc5c*>(cpu), gdb_port)}};
|
||||||
})};
|
})};
|
||||||
|
@ -79,12 +79,12 @@ using namespace sysc;
|
||||||
volatile std::array<bool, 2> tgc_init = {
|
volatile std::array<bool, 2> tgc_init = {
|
||||||
iss_factory::instance().register_creator("tgc5c|m_p|tcc",
|
iss_factory::instance().register_creator("tgc5c|m_p|tcc",
|
||||||
[](unsigned gdb_port, void* data) -> iss_factory::base_t {
|
[](unsigned gdb_port, void* data) -> iss_factory::base_t {
|
||||||
auto cc = reinterpret_cast<sysc::tgfs::core_complex*>(data);
|
auto cc = reinterpret_cast<sysc::tgfs::core_complex_if*>(data);
|
||||||
auto* cpu = new sc_core_adapter<arch::riscv_hart_m_p<arch::tgc5c>>(cc);
|
auto* cpu = new sc_core_adapter<arch::riscv_hart_m_p<arch::tgc5c>>(cc);
|
||||||
return {sysc::sc_cpu_ptr{cpu}, vm_ptr{create(static_cast<arch::tgc5c*>(cpu), gdb_port)}};
|
return {sysc::sc_cpu_ptr{cpu}, vm_ptr{create(static_cast<arch::tgc5c*>(cpu), gdb_port)}};
|
||||||
}),
|
}),
|
||||||
iss_factory::instance().register_creator("tgc5c|mu_p|tcc", [](unsigned gdb_port, void* data) -> iss_factory::base_t {
|
iss_factory::instance().register_creator("tgc5c|mu_p|tcc", [](unsigned gdb_port, void* data) -> iss_factory::base_t {
|
||||||
auto cc = reinterpret_cast<sysc::tgfs::core_complex*>(data);
|
auto cc = reinterpret_cast<sysc::tgfs::core_complex_if*>(data);
|
||||||
auto* cpu = new sc_core_adapter<arch::riscv_hart_mu_p<arch::tgc5c>>(cc);
|
auto* cpu = new sc_core_adapter<arch::riscv_hart_mu_p<arch::tgc5c>>(cc);
|
||||||
return {sysc::sc_cpu_ptr{cpu}, vm_ptr{create(static_cast<arch::tgc5c*>(cpu), gdb_port)}};
|
return {sysc::sc_cpu_ptr{cpu}, vm_ptr{create(static_cast<arch::tgc5c*>(cpu), gdb_port)}};
|
||||||
})};
|
})};
|
||||||
|
@ -96,12 +96,12 @@ using namespace sysc;
|
||||||
volatile std::array<bool, 2> tgc_init = {
|
volatile std::array<bool, 2> tgc_init = {
|
||||||
iss_factory::instance().register_creator("tgc5c|m_p|asmjit",
|
iss_factory::instance().register_creator("tgc5c|m_p|asmjit",
|
||||||
[](unsigned gdb_port, void* data) -> iss_factory::base_t {
|
[](unsigned gdb_port, void* data) -> iss_factory::base_t {
|
||||||
auto cc = reinterpret_cast<sysc::tgfs::core_complex*>(data);
|
auto cc = reinterpret_cast<sysc::tgfs::core_complex_if*>(data);
|
||||||
auto* cpu = new sc_core_adapter<arch::riscv_hart_m_p<arch::tgc5c>>(cc);
|
auto* cpu = new sc_core_adapter<arch::riscv_hart_m_p<arch::tgc5c>>(cc);
|
||||||
return {sysc::sc_cpu_ptr{cpu}, vm_ptr{create(static_cast<arch::tgc5c*>(cpu), gdb_port)}};
|
return {sysc::sc_cpu_ptr{cpu}, vm_ptr{create(static_cast<arch::tgc5c*>(cpu), gdb_port)}};
|
||||||
}),
|
}),
|
||||||
iss_factory::instance().register_creator("tgc5c|mu_p|asmjit", [](unsigned gdb_port, void* data) -> iss_factory::base_t {
|
iss_factory::instance().register_creator("tgc5c|mu_p|asmjit", [](unsigned gdb_port, void* data) -> iss_factory::base_t {
|
||||||
auto cc = reinterpret_cast<sysc::tgfs::core_complex*>(data);
|
auto cc = reinterpret_cast<sysc::tgfs::core_complex_if*>(data);
|
||||||
auto* cpu = new sc_core_adapter<arch::riscv_hart_mu_p<arch::tgc5c>>(cc);
|
auto* cpu = new sc_core_adapter<arch::riscv_hart_mu_p<arch::tgc5c>>(cc);
|
||||||
return {sysc::sc_cpu_ptr{cpu}, vm_ptr{create(static_cast<arch::tgc5c*>(cpu), gdb_port)}};
|
return {sysc::sc_cpu_ptr{cpu}, vm_ptr{create(static_cast<arch::tgc5c*>(cpu), gdb_port)}};
|
||||||
})};
|
})};
|
||||||
|
|
|
@ -163,7 +163,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
sysc::tgfs::core_complex_if* const owner;
|
sysc::tgfs::core_complex_if* const owner{nullptr};
|
||||||
sc_core::sc_event wfi_evt;
|
sc_core::sc_event wfi_evt;
|
||||||
uint64_t hostvar{std::numeric_limits<uint64_t>::max()};
|
uint64_t hostvar{std::numeric_limits<uint64_t>::max()};
|
||||||
unsigned to_host_wr_cnt = 0;
|
unsigned to_host_wr_cnt = 0;
|
||||||
|
|
Loading…
Reference in New Issue