make tgc-sim include all available ISS
This commit is contained in:
parent
86da31033c
commit
6f8595759e
|
@ -28,15 +28,15 @@ endif()
|
||||||
add_subdirectory(softfloat)
|
add_subdirectory(softfloat)
|
||||||
|
|
||||||
# library files
|
# library files
|
||||||
FILE(GLOB TGC_SOURCES
|
FILE(GLOB TGC_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/src/iss/*.cpp)
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/src/iss/*.cpp
|
FILE(GLOB TGC_VM_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/src/vm/interp/vm_*.cpp)
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/src/vm/interp/vm_*.cpp
|
|
||||||
)
|
|
||||||
set(LIB_SOURCES
|
set(LIB_SOURCES
|
||||||
src/vm/fp_functions.cpp
|
src/vm/fp_functions.cpp
|
||||||
src/plugin/instruction_count.cpp
|
src/plugin/instruction_count.cpp
|
||||||
src/plugin/cycle_estimate.cpp
|
src/plugin/cycle_estimate.cpp
|
||||||
${TGC_SOURCES}
|
${TGC_SOURCES}
|
||||||
|
${TGC_VM_SOURCES}
|
||||||
)
|
)
|
||||||
|
|
||||||
if(WITH_LLVM)
|
if(WITH_LLVM)
|
||||||
|
@ -105,8 +105,12 @@ project(tgc-sim)
|
||||||
find_package(Boost COMPONENTS program_options thread REQUIRED)
|
find_package(Boost COMPONENTS program_options thread REQUIRED)
|
||||||
|
|
||||||
add_executable(${PROJECT_NAME} src/main.cpp)
|
add_executable(${PROJECT_NAME} src/main.cpp)
|
||||||
# This sets the include directory for the reference project. This is the -I flag in gcc.
|
foreach(F IN LISTS TGC_SOURCES)
|
||||||
|
string(REGEX REPLACE ".*/([^/]*)\.cpp" "\\1" CORE_NAME_LC ${F})
|
||||||
|
string(TOUPPER ${CORE_NAME_LC} CORE_NAME)
|
||||||
target_compile_definitions(${PROJECT_NAME} PRIVATE CORE_${CORE_NAME})
|
target_compile_definitions(${PROJECT_NAME} PRIVATE CORE_${CORE_NAME})
|
||||||
|
endforeach()
|
||||||
|
|
||||||
if(WITH_LLVM)
|
if(WITH_LLVM)
|
||||||
target_compile_definitions(${PROJECT_NAME} PRIVATE WITH_LLVM)
|
target_compile_definitions(${PROJECT_NAME} PRIVATE WITH_LLVM)
|
||||||
target_link_libraries(${PROJECT_NAME} PUBLIC ${llvm_libs})
|
target_link_libraries(${PROJECT_NAME} PUBLIC ${llvm_libs})
|
||||||
|
|
24
src/main.cpp
24
src/main.cpp
|
@ -54,6 +54,16 @@ using tgc_d_plat_type = iss::arch::riscv_hart_mu_p<iss::arch::tgc_d, (iss::arch:
|
||||||
#include "iss/arch/tgc_d_xrb_mac.h"
|
#include "iss/arch/tgc_d_xrb_mac.h"
|
||||||
using tgc_d_xrb_mac_plat_type = iss::arch::riscv_hart_mu_p<iss::arch::tgc_d_xrb_mac, (iss::arch::features_e)(iss::arch::FEAT_PMP | iss::arch::FEAT_CLIC | iss::arch::FEAT_EXT_N)>;
|
using tgc_d_xrb_mac_plat_type = iss::arch::riscv_hart_mu_p<iss::arch::tgc_d_xrb_mac, (iss::arch::features_e)(iss::arch::FEAT_PMP | iss::arch::FEAT_CLIC | iss::arch::FEAT_EXT_N)>;
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef CORE_TGC_D_XRB_NN
|
||||||
|
#include "iss/arch/riscv_hart_mu_p.h"
|
||||||
|
#include "iss/arch/tgc_d_xrb_nn.h"
|
||||||
|
using tgc_d_xrb_nn_plat_type = iss::arch::riscv_hart_mu_p<iss::arch::tgc_d_xrb_nn, (iss::arch::features_e)(iss::arch::FEAT_PMP | iss::arch::FEAT_CLIC | iss::arch::FEAT_EXT_N)>;
|
||||||
|
#endif
|
||||||
|
#ifdef CORE_TGC_E
|
||||||
|
#include "iss/arch/riscv_hart_mu_p.h"
|
||||||
|
#include "iss/arch/tgc_e.h"
|
||||||
|
using tgc_e_plat_type = iss::arch::riscv_hart_mu_p<iss::arch::tgc_e, (iss::arch::features_e)(iss::arch::FEAT_PMP | iss::arch::FEAT_CLIC | iss::arch::FEAT_EXT_N)>;
|
||||||
|
#endif
|
||||||
#ifdef WITH_LLVM
|
#ifdef WITH_LLVM
|
||||||
#include <iss/llvm/jit_helper.h>
|
#include <iss/llvm/jit_helper.h>
|
||||||
#endif
|
#endif
|
||||||
|
@ -153,9 +163,21 @@ int main(int argc, char *argv[]) {
|
||||||
std::tie(cpu, vm) =
|
std::tie(cpu, vm) =
|
||||||
iss::create_cpu<tgc_d_xrb_mac_plat_type>(clim["backend"].as<std::string>(), clim["gdb-port"].as<unsigned>());
|
iss::create_cpu<tgc_d_xrb_mac_plat_type>(clim["backend"].as<std::string>(), clim["gdb-port"].as<unsigned>());
|
||||||
} else
|
} else
|
||||||
|
#endif
|
||||||
|
#ifdef CORE_TGC_D_XRB_NN
|
||||||
|
if (isa_opt == "tgc_d_xrb_nn") {
|
||||||
|
std::tie(cpu, vm) =
|
||||||
|
iss::create_cpu<tgc_d_xrb_nn_plat_type>(clim["backend"].as<std::string>(), clim["gdb-port"].as<unsigned>());
|
||||||
|
} else
|
||||||
|
#endif
|
||||||
|
#ifdef CORE_TGC_E
|
||||||
|
if (isa_opt == "tgc_e") {
|
||||||
|
std::tie(cpu, vm) =
|
||||||
|
iss::create_cpu<tgc_e_plat_type>(clim["backend"].as<std::string>(), clim["gdb-port"].as<unsigned>());
|
||||||
|
} else
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
LOG(ERR) << "Illegal argument value for '--isa': " << clim["isa"].as<std::string>() << std::endl;
|
LOG(ERR) << "Illegal argument value for '--isa': " << isa_opt << std::endl;
|
||||||
return 127;
|
return 127;
|
||||||
}
|
}
|
||||||
if (clim.count("plugin")) {
|
if (clim.count("plugin")) {
|
||||||
|
|
Loading…
Reference in New Issue