extends factory to support SystemC core wrapper
This commit is contained in:
33
src/sysc/register_tgc_c.cpp
Normal file
33
src/sysc/register_tgc_c.cpp
Normal file
@ -0,0 +1,33 @@
|
||||
/*
|
||||
* register_tgc_c.cpp
|
||||
*
|
||||
* Created on: Jul 5, 2023
|
||||
* Author: eyck
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
#include <iss/factory.h>
|
||||
#include <iss/arch/tgc_c.h>
|
||||
#include <iss/arch/riscv_hart_m_p.h>
|
||||
#include <iss/arch/riscv_hart_mu_p.h>
|
||||
#include "sc_core_adapter.h"
|
||||
#include "core_complex.h"
|
||||
|
||||
namespace iss {
|
||||
namespace {
|
||||
volatile std::array<bool, 2> dummy = {
|
||||
core_factory::instance().register_creator("tgc_c|m_p|interp", [](unsigned gdb_port, void* data) -> std::tuple<cpu_ptr, vm_ptr>{
|
||||
auto cc = reinterpret_cast<sysc::tgfs::core_complex*>(data);
|
||||
arch::tgc_c* lcpu = new sc_core_adapter<arch::riscv_hart_m_p<arch::tgc_c>>(cc);
|
||||
return {cpu_ptr{lcpu}, vm_ptr{interp::create(lcpu, gdb_port)}};
|
||||
}),
|
||||
core_factory::instance().register_creator("tgc_c|mu_p|interp", [](unsigned gdb_port, void* data) -> std::tuple<cpu_ptr, vm_ptr>{
|
||||
auto cc = reinterpret_cast<sysc::tgfs::core_complex*>(data);
|
||||
arch::tgc_c* lcpu = new sc_core_adapter<arch::riscv_hart_mu_p<arch::tgc_c>>(cc);
|
||||
return {cpu_ptr{lcpu}, vm_ptr{interp::create(lcpu, gdb_port)}};
|
||||
})
|
||||
};
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user