From e151416f5878ccc2bfca00e7e7c86084c46e40bd Mon Sep 17 00:00:00 2001 From: Eyck Jentzsch Date: Mon, 31 Jul 2023 12:55:09 +0200 Subject: [PATCH] fixes systemc factory registration --- gen_input/templates/CORENAME_sysc.cpp.gtl | 14 ++++++++------ src/sysc/register_tgc_c.cpp | 14 ++++++++------ 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/gen_input/templates/CORENAME_sysc.cpp.gtl b/gen_input/templates/CORENAME_sysc.cpp.gtl index e56e7db..3ef2df9 100644 --- a/gen_input/templates/CORENAME_sysc.cpp.gtl +++ b/gen_input/templates/CORENAME_sysc.cpp.gtl @@ -36,6 +36,7 @@ #include #include "sc_core_adapter.h" #include "core_complex.h" +#include namespace iss { namespace interp { @@ -55,16 +56,17 @@ volatile std::array ${coreDef.name.toLowerCase()}_init = { } #if defined(WITH_TCC) namespace tcc { +using namespace sysc; volatile std::array ${coreDef.name.toLowerCase()}_init = { - core_factory::instance().register_creator("${coreDef.name.toLowerCase()}|m_p|tcc", [](unsigned gdb_port, void* data) -> std::tuple{ - auto cc = reinterpret_cast(data); + iss_factory::instance().register_creator("${coreDef.name.toLowerCase()}|m_p|tcc", [](unsigned gdb_port, void* data) -> iss_factory::base_t { + auto* cc = reinterpret_cast(data); auto* cpu = new sc_core_adapter>(cc); - return {cpu_ptr{cpu}, vm_ptr{create(static_cast(cpu), gdb_port)}}; + return {sysc::sc_cpu_ptr{cpu}, vm_ptr{create(static_cast(cpu), gdb_port)}}; }), - core_factory::instance().register_creator("${coreDef.name.toLowerCase()}|mu_p|tcc", [](unsigned gdb_port, void* data) -> std::tuple{ - auto cc = reinterpret_cast(data); + iss_factory::instance().register_creator("${coreDef.name.toLowerCase()}|mu_p|tcc", [](unsigned gdb_port, void* data) -> iss_factory::base_t { + auto* cc = reinterpret_cast(data); auto* cpu = new sc_core_adapter>(cc); - return {cpu_ptr{cpu}, vm_ptr{create(static_cast(cpu), gdb_port)}}; + return {sysc::sc_cpu_ptr{cpu}, vm_ptr{create(static_cast(cpu), gdb_port)}}; }) }; } diff --git a/src/sysc/register_tgc_c.cpp b/src/sysc/register_tgc_c.cpp index 31a99a5..4fd8eac 100644 --- a/src/sysc/register_tgc_c.cpp +++ b/src/sysc/register_tgc_c.cpp @@ -36,6 +36,7 @@ #include #include "sc_core_adapter.h" #include "core_complex.h" +#include namespace iss { namespace interp { @@ -55,16 +56,17 @@ volatile std::array tgc_init = { } #if defined(WITH_TCC) namespace tcc { +using namespace sysc; volatile std::array tgc_init = { - core_factory::instance().register_creator("tgc_c|m_p|tcc", [](unsigned gdb_port, void* data) -> std::tuple{ - auto cc = reinterpret_cast(data); + iss_factory::instance().register_creator("tgc_c|m_p|tcc", [](unsigned gdb_port, void* data) -> iss_factory::base_t { + auto* cc = reinterpret_cast(data); auto* cpu = new sc_core_adapter>(cc); - return {cpu_ptr{cpu}, vm_ptr{create(static_cast(cpu), gdb_port)}}; + return {sysc::sc_cpu_ptr{cpu}, vm_ptr{create(static_cast(cpu), gdb_port)}}; }), - core_factory::instance().register_creator("tgc_c|mu_p|tcc", [](unsigned gdb_port, void* data) -> std::tuple{ - auto cc = reinterpret_cast(data); + iss_factory::instance().register_creator("tgc_c|mu_p|tcc", [](unsigned gdb_port, void* data) -> iss_factory::base_t { + auto* cc = reinterpret_cast(data); auto* cpu = new sc_core_adapter>(cc); - return {cpu_ptr{cpu}, vm_ptr{create(static_cast(cpu), gdb_port)}}; + return {sysc::sc_cpu_ptr{cpu}, vm_ptr{create(static_cast(cpu), gdb_port)}}; }) }; }