34 lines
1.1 KiB
C++
34 lines
1.1 KiB
C++
|
/*
|
||
|
* 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)}};
|
||
|
})
|
||
|
};
|
||
|
}
|
||
|
}
|