From b7478965ab65ea14eb5c72c88b89528dcf18e265 Mon Sep 17 00:00:00 2001 From: Eyck Jentzsch Date: Mon, 23 Oct 2023 10:18:25 +0200 Subject: [PATCH] adds asmjit backend registration for SystemC --- gen_input/templates/asmjit/CORENAME.cpp.gtl | 2 +- src/sysc/register_tgc_c.cpp | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/gen_input/templates/asmjit/CORENAME.cpp.gtl b/gen_input/templates/asmjit/CORENAME.cpp.gtl index ad40e74..3cede3c 100644 --- a/gen_input/templates/asmjit/CORENAME.cpp.gtl +++ b/gen_input/templates/asmjit/CORENAME.cpp.gtl @@ -37,7 +37,7 @@ #include #include #include - +#include #ifndef FMT_HEADER_ONLY #define FMT_HEADER_ONLY #endif diff --git a/src/sysc/register_tgc_c.cpp b/src/sysc/register_tgc_c.cpp index 7ea4d5b..da2f72d 100644 --- a/src/sysc/register_tgc_c.cpp +++ b/src/sysc/register_tgc_c.cpp @@ -71,4 +71,21 @@ volatile std::array tgc_init = { }; } #endif +#if defined(WITH_ASMJIT) +namespace asmjit { +using namespace sysc; +volatile std::array tgc_init = { + iss_factory::instance().register_creator("tgc5c|m_p|asmjit", [](unsigned gdb_port, void* data) -> iss_factory::base_t { + auto cc = reinterpret_cast(data); + auto* cpu = new sc_core_adapter>(cc); + return {sysc::sc_cpu_ptr{cpu}, vm_ptr{create(static_cast(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(data); + auto* cpu = new sc_core_adapter>(cc); + return {sysc::sc_cpu_ptr{cpu}, vm_ptr{create(static_cast(cpu), gdb_port)}}; + }) +}; +} +#endif }