adds asmjit backend registration for SystemC

This commit is contained in:
Eyck Jentzsch 2023-10-23 10:18:25 +02:00
parent bf4a6deb86
commit b7478965ab
2 changed files with 18 additions and 1 deletions

View File

@ -37,7 +37,7 @@
#include <iss/asmjit/vm_base.h> #include <iss/asmjit/vm_base.h>
#include <asmjit/asmjit.h> #include <asmjit/asmjit.h>
#include <util/logging.h> #include <util/logging.h>
#include <fp_functions.h>
#ifndef FMT_HEADER_ONLY #ifndef FMT_HEADER_ONLY
#define FMT_HEADER_ONLY #define FMT_HEADER_ONLY
#endif #endif

View File

@ -71,4 +71,21 @@ volatile std::array<bool, 2> tgc_init = {
}; };
} }
#endif #endif
#if defined(WITH_ASMJIT)
namespace asmjit {
using namespace sysc;
volatile std::array<bool, 2> tgc_init = {
iss_factory::instance().register_creator("tgc5c|m_p|asmjit", [](unsigned gdb_port, void* data) -> iss_factory::base_t {
auto cc = reinterpret_cast<sysc::tgfs::core_complex*>(data);
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)}};
}),
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* 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)}};
})
};
}
#endif
} }