modernize build system and cleanup dependencies

This commit is contained in:
Eyck Jentzsch 2020-05-30 13:57:01 +02:00
parent 0ff6ccf9e2
commit 10797a473d
12 changed files with 104 additions and 205 deletions

View File

@ -1,42 +1,28 @@
cmake_minimum_required(VERSION 3.12) cmake_minimum_required(VERSION 3.12)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/../cmake) # main (top) cmake dir
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake) # project specific cmake dir
# CMake useful variables project("riscv" VERSION 1.0.0)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib")
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib")
# Set the name of your project here include(GNUInstallDirs)
project("riscv")
include(Common)
conan_basic_setup() conan_basic_setup()
find_package(Boost COMPONENTS program_options system thread filesystem REQUIRED) find_package(Boost COMPONENTS program_options system thread filesystem REQUIRED)
if(WITH_LLVM)
if(DEFINED ENV{LLVM_HOME})
find_path (LLVM_DIR LLVM-Config.cmake $ENV{LLVM_HOME}/lib/cmake/llvm)
endif(DEFINED ENV{LLVM_HOME})
find_package(LLVM REQUIRED CONFIG)
message(STATUS "Found LLVM ${LLVM_PACKAGE_VERSION}")
message(STATUS "Using LLVMConfig.cmake in: ${LLVM_DIR}")
llvm_map_components_to_libnames(llvm_libs support core mcjit x86codegen x86asmparser)
endif()
# This sets the include directory for the reference project. This is the -I flag in gcc. #Mac needed variables (adapt for your needs - http://www.cmake.org/Wiki/CMake_RPATH_handling#Mac_OS_X_and_the_RPATH)
include_directories( #set(CMAKE_MACOSX_RPATH ON)
${PROJECT_SOURCE_DIR}/incl #set(CMAKE_SKIP_BUILD_RPATH FALSE)
${SOFTFLOAT_INCLUDE_DIRS} #set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
${LLVM_INCLUDE_DIRS} #set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
) #set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
add_dependent_subproject(dbt-core)
include_directories(
${PROJECT_SOURCE_DIR}/incl
${PROJECT_SOURCE_DIR}/../external/elfio
${PROJECT_SOURCE_DIR}/../external/libGIS
${Boost_INCLUDE_DIRS}
)
# Mac needed variables (adapt for your needs - http://www.cmake.org/Wiki/CMake_RPATH_handling#Mac_OS_X_and_the_RPATH)
set(CMAKE_MACOSX_RPATH ON)
set(CMAKE_SKIP_BUILD_RPATH FALSE)
set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
add_subdirectory(softfloat) add_subdirectory(softfloat)
@ -50,12 +36,6 @@ set(LIB_SOURCES
src/iss/rv64gc.cpp src/iss/rv64gc.cpp
src/iss/mnrv32.cpp src/iss/mnrv32.cpp
src/vm/fp_functions.cpp src/vm/fp_functions.cpp
src/vm/llvm/fp_impl.cpp
src/vm/llvm/vm_mnrv32.cpp
src/vm/llvm/vm_rv32gc.cpp
src/vm/llvm/vm_rv32imac.cpp
src/vm/llvm/vm_rv64i.cpp
src/vm/llvm/vm_rv64gc.cpp
src/vm/tcc/vm_mnrv32.cpp src/vm/tcc/vm_mnrv32.cpp
src/vm/tcc/vm_rv32gc.cpp src/vm/tcc/vm_rv32gc.cpp
src/vm/tcc/vm_rv32imac.cpp src/vm/tcc/vm_rv32imac.cpp
@ -67,78 +47,78 @@ set(LIB_SOURCES
src/vm/interp/vm_rv64i.cpp src/vm/interp/vm_rv64i.cpp
src/vm/interp/vm_rv64gc.cpp src/vm/interp/vm_rv64gc.cpp
src/plugin/instruction_count.cpp src/plugin/instruction_count.cpp
src/plugin/cycle_estimate.cpp) src/plugin/cycle_estimate.cpp
)
# Define two variables in order not to repeat ourselves. if(WITH_LLVM)
set(LIBRARY_NAME riscv) set(LIB_SOURCES ${LIB_SOURCES}
src/vm/llvm/fp_impl.cpp
src/vm/llvm/vm_mnrv32.cpp
src/vm/llvm/vm_rv32gc.cpp
src/vm/llvm/vm_rv32imac.cpp
src/vm/llvm/vm_rv64i.cpp
src/vm/llvm/vm_rv64gc.cpp
)
endif()
# Define the library # Define the library
add_library(${LIBRARY_NAME} ${LIB_SOURCES}) add_library(riscv ${LIB_SOURCES})
SET(${LIBRARY_NAME} -Wl,-whole-archive -l${LIBRARY_NAME} -Wl,-no-whole-archive) SET(riscv -Wl,-whole-archive -lriscv -Wl,-no-whole-archive)
target_link_libraries(${LIBRARY_NAME} softfloat dbt-core scc-util) target_compile_options(riscv PRIVATE -Wno-shift-count-overflow)
set_target_properties(${LIBRARY_NAME} PROPERTIES target_include_directories(riscv PUBLIC incl ../external/elfio)
VERSION ${VERSION} # ${VERSION} was defined in the main CMakeLists. target_link_libraries(riscv PUBLIC softfloat dbt-core scc-util)
set_target_properties(riscv PROPERTIES
VERSION ${PROJECT_VERSION}
FRAMEWORK FALSE FRAMEWORK FALSE
PUBLIC_HEADER "${LIB_HEADERS}" # specify the public headers PUBLIC_HEADER "${LIB_HEADERS}" # specify the public headers
) )
if(SystemC_FOUND) if(SystemC_FOUND)
set(SC_LIBRARY_NAME riscv_sc) add_library(riscv_sc src/sysc/core_complex.cpp)
add_library(${SC_LIBRARY_NAME} src/sysc/core_complex.cpp) target_compile_definitions(riscv_sc PUBLIC WITH_SYSTEMC)
add_definitions(-DWITH_SYSTEMC) target_include_directories(riscv_sc PUBLIC ../incl ${SystemC_INCLUDE_DIRS} ${CCI_INCLUDE_DIRS})
include_directories(${SystemC_INCLUDE_DIRS})
include_directories(${CCI_INCLUDE_DIRS})
if(SCV_FOUND) if(SCV_FOUND)
add_definitions(-DWITH_SCV) target_compile_definitions(riscv_sc PUBLIC WITH_SCV)
include_directories(${SCV_INCLUDE_DIRS}) target_include_directories(riscv_sc PUBLIC ${SCV_INCLUDE_DIRS})
endif() endif()
target_link_libraries(${SC_LIBRARY_NAME} ${LIBRARY_NAME}) target_link_libraries(riscv_sc PUBLIC riscv scc )
target_link_libraries(${SC_LIBRARY_NAME} dbt-core) if(WITH_LLVM)
target_link_libraries(${SC_LIBRARY_NAME} softfloat) target_link_libraries(riscv_sc PUBLIC ${llvm_libs})
target_link_libraries(${SC_LIBRARY_NAME} scc) endif()
target_link_libraries(${SC_LIBRARY_NAME} external) target_link_libraries(riscv_sc PUBLIC ${Boost_LIBRARIES} )
target_link_libraries(${SC_LIBRARY_NAME} ${llvm_libs}) set_target_properties(riscv_sc PROPERTIES
target_link_libraries(${SC_LIBRARY_NAME} ${Boost_LIBRARIES} ) VERSION ${PROJECT_VERSION}
set_target_properties(${SC_LIBRARY_NAME} PROPERTIES
VERSION ${VERSION} # ${VERSION} was defined in the main CMakeLists.
FRAMEWORK FALSE FRAMEWORK FALSE
PUBLIC_HEADER "${LIB_HEADERS}" # specify the public headers PUBLIC_HEADER "${LIB_HEADERS}" # specify the public headers
) )
endif() endif()
project("riscv-sim") project("riscv-sim")
add_executable(riscv-sim src/main.cpp)
# This is a make target, so you can do a "make riscv-sc" # This sets the include directory for the reference project. This is the -I flag in gcc.
set(APPLICATION_NAME riscv-sim) target_include_directories(riscv-sim PRIVATE ../external/libGIS)
if(WITH_LLVM)
add_executable(${APPLICATION_NAME} src/main.cpp) target_compile_definitions(riscv-sim PRIVATE WITH_LLVM)
target_link_libraries(riscv-sim PUBLIC ${llvm_libs})
endif()
# Links the target exe against the libraries # Links the target exe against the libraries
target_link_libraries(${APPLICATION_NAME} ${LIBRARY_NAME}) target_link_libraries(riscv-sim riscv)
target_link_libraries(${APPLICATION_NAME} jsoncpp) target_link_libraries(riscv-sim jsoncpp)
target_link_libraries(${APPLICATION_NAME} dbt-core) target_link_libraries(riscv-sim dbt-core)
target_link_libraries(${APPLICATION_NAME} external) target_link_libraries(riscv-sim external)
target_link_libraries(${APPLICATION_NAME} ${llvm_libs}) target_link_libraries(riscv-sim ${Boost_LIBRARIES} )
target_link_libraries(${APPLICATION_NAME} ${Boost_LIBRARIES} )
if (Tcmalloc_FOUND) if (Tcmalloc_FOUND)
target_link_libraries(${APPLICATION_NAME} ${Tcmalloc_LIBRARIES}) target_link_libraries(riscv-sim ${Tcmalloc_LIBRARIES})
endif(Tcmalloc_FOUND) endif(Tcmalloc_FOUND)
# Says how and where to install software install(TARGETS riscv riscv-sim
# Targets:
# * <prefix>/lib/<libraries>
# * header location after install: <prefix>/include/<project>/*.h
# * headers can be included by C++ code `#<project>/Bar.hpp>`
install(TARGETS ${LIBRARY_NAME} ${APPLICATION_NAME}
EXPORT ${PROJECT_NAME}Targets # for downstream dependencies EXPORT ${PROJECT_NAME}Targets # for downstream dependencies
ARCHIVE DESTINATION lib COMPONENT libs # static lib ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT libs # static lib
RUNTIME DESTINATION bin COMPONENT libs # binaries RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT libs # binaries
LIBRARY DESTINATION lib COMPONENT libs # shared lib LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT libs # shared lib
FRAMEWORK DESTINATION bin COMPONENT libs # for mac FRAMEWORK DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT libs # for mac
PUBLIC_HEADER DESTINATION incl/${PROJECT_NAME} COMPONENT devel # headers for mac (note the different component -> different package) PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME} COMPONENT devel # headers for mac (note the different component -> different package)
INCLUDES DESTINATION incl # headers INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} # headers
) )

View File

@ -70,17 +70,7 @@ def getRegisterAliasNames(){
%> %>
#include "util/ities.h" #include "util/ities.h"
#include <util/logging.h> #include <util/logging.h>
#include <elfio/elfio.hpp>
#include <iss/arch/${coreDef.name.toLowerCase()}.h> #include <iss/arch/${coreDef.name.toLowerCase()}.h>
#ifdef __cplusplus
extern "C" {
#endif
#include <ihex.h>
#ifdef __cplusplus
}
#endif
#include <cstdio> #include <cstdio>
#include <cstring> #include <cstring>
#include <fstream> #include <fstream>

View File

@ -70,17 +70,7 @@ def getRegisterAliasNames(){
%> %>
#include "util/ities.h" #include "util/ities.h"
#include <util/logging.h> #include <util/logging.h>
#include <elfio/elfio.hpp>
#include <iss/arch/${coreDef.name.toLowerCase()}.h> #include <iss/arch/${coreDef.name.toLowerCase()}.h>
#ifdef __cplusplus
extern "C" {
#endif
#include <ihex.h>
#ifdef __cplusplus
}
#endif
#include <cstdio> #include <cstdio>
#include <cstring> #include <cstring>
#include <fstream> #include <fstream>

View File

@ -70,17 +70,7 @@ def getRegisterAliasNames(){
%> %>
#include "util/ities.h" #include "util/ities.h"
#include <util/logging.h> #include <util/logging.h>
#include <elfio/elfio.hpp>
#include <iss/arch/${coreDef.name.toLowerCase()}.h> #include <iss/arch/${coreDef.name.toLowerCase()}.h>
#ifdef __cplusplus
extern "C" {
#endif
#include <ihex.h>
#ifdef __cplusplus
}
#endif
#include <cstdio> #include <cstdio>
#include <cstring> #include <cstring>
#include <fstream> #include <fstream>

View File

@ -2,31 +2,17 @@ cmake_minimum_required(VERSION 3.12)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/../cmake) # main (top) cmake dir set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/../cmake) # main (top) cmake dir
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake) # project specific cmake dir set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake) # project specific cmake dir
# CMake useful variables
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib")
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib")
# Set the name of your project here # Set the name of your project here
project("sotfloat") project("sotfloat" VERSION 3.0.0)
# Set the version number of your project here (format is MAJOR.MINOR.PATCHLEVEL - e.g. 1.0.0) # Set the version number of your project here (format is MAJOR.MINOR.PATCHLEVEL - e.g. 1.0.0)
set(VERSION "3e") set(VERSION "3e")
include(Common) include(Common)
include(GNUInstallDirs)
set(SPECIALIZATION RISCV) set(SPECIALIZATION RISCV)
add_definitions(
-DSOFTFLOAT_ROUND_ODD
-DINLINE_LEVEL=5
-DSOFTFLOAT_FAST_DIV32TO16
-DSOFTFLOAT_FAST_DIV64TO32
-DSOFTFLOAT_FAST_INT64
# -DTHREAD_LOCAL=__thread
)
set(LIB_HEADERS source/include/softfloat.h source/include/softfloat_types.h) set(LIB_HEADERS source/include/softfloat.h source/include/softfloat_types.h)
set(PRIMITIVES set(PRIMITIVES
source/s_eq128.c source/s_eq128.c
@ -341,32 +327,29 @@ set(OTHERS
set(LIB_SOURCES ${PRIMITIVES} ${SPECIALIZE} ${OTHERS}) set(LIB_SOURCES ${PRIMITIVES} ${SPECIALIZE} ${OTHERS})
# Define two variables in order not to repeat ourselves. add_library(softfloat ${LIB_SOURCES})
set(LIBRARY_NAME softfloat) set_property(TARGET softfloat PROPERTY C_STANDARD 99)
target_compile_definitions(softfloat PRIVATE
# Define the library SOFTFLOAT_ROUND_ODD
add_library(${LIBRARY_NAME} ${LIB_SOURCES}) INLINE_LEVEL=5
set_property(TARGET ${LIBRARY_NAME} PROPERTY C_STANDARD 99) SOFTFLOAT_FAST_DIV32TO16
target_include_directories(${LIBRARY_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/build/Linux-x86_64-GCC) SOFTFLOAT_FAST_DIV64TO32
target_include_directories(${LIBRARY_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/source/include ${CMAKE_CURRENT_SOURCE_DIR}/source/${SPECIALIZATION}) SOFTFLOAT_FAST_INT64
# Set the build version. It will be used in the name of the lib, with corresponding # THREAD_LOCAL=__thread
# symlinks created. SOVERSION could also be specified for api version. )
set_target_properties(${LIBRARY_NAME} PROPERTIES target_include_directories(softfloat PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/build/Linux-x86_64-GCC)
target_include_directories(softfloat PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/source/include ${CMAKE_CURRENT_SOURCE_DIR}/source/${SPECIALIZATION})
set_target_properties(softfloat PROPERTIES
VERSION ${VERSION} VERSION ${VERSION}
FRAMEWORK FALSE FRAMEWORK FALSE
PUBLIC_HEADER "${LIB_HEADERS}" PUBLIC_HEADER "${LIB_HEADERS}"
) )
# Says how and where to install software install(TARGETS softfloat
# Targets:
# * <prefix>/lib/<libraries>
# * header location after install: <prefix>/include/<project>/*.h
# * headers can be included by C++ code `#<project>/Bar.hpp>`
install(TARGETS ${LIBRARY_NAME}
EXPORT ${PROJECT_NAME}Targets # for downstream dependencies EXPORT ${PROJECT_NAME}Targets # for downstream dependencies
ARCHIVE DESTINATION lib COMPONENT libs # static lib ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT libs # static lib
LIBRARY DESTINATION lib COMPONENT libs # shared lib LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT libs # shared lib
FRAMEWORK DESTINATION bin COMPONENT libs # for mac FRAMEWORK DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT libs # for mac
PUBLIC_HEADER DESTINATION include COMPONENT devel # headers for mac (note the different component -> different package) PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} COMPONENT devel # headers for mac (note the different component -> different package)
INCLUDES DESTINATION include # headers INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} # headers
) )

View File

@ -33,16 +33,8 @@
#include "util/ities.h" #include "util/ities.h"
#include <util/logging.h> #include <util/logging.h>
#include <elfio/elfio.hpp>
#include <iss/arch/mnrv32.h> #include <iss/arch/mnrv32.h>
#ifdef __cplusplus
extern "C" {
#endif
#include <ihex.h>
#ifdef __cplusplus
}
#endif
#include <cstdio> #include <cstdio>
#include <cstring> #include <cstring>
#include <fstream> #include <fstream>

View File

@ -33,16 +33,8 @@
#include "util/ities.h" #include "util/ities.h"
#include <util/logging.h> #include <util/logging.h>
#include <elfio/elfio.hpp>
#include <iss/arch/rv32gc.h> #include <iss/arch/rv32gc.h>
#ifdef __cplusplus
extern "C" {
#endif
#include <ihex.h>
#ifdef __cplusplus
}
#endif
#include <fstream> #include <fstream>
#include <cstdio> #include <cstdio>
#include <cstring> #include <cstring>

View File

@ -33,16 +33,8 @@
#include "util/ities.h" #include "util/ities.h"
#include <util/logging.h> #include <util/logging.h>
#include <elfio/elfio.hpp>
#include <iss/arch/rv32imac.h> #include <iss/arch/rv32imac.h>
#ifdef __cplusplus
extern "C" {
#endif
#include <ihex.h>
#ifdef __cplusplus
}
#endif
#include <cstdio> #include <cstdio>
#include <cstring> #include <cstring>
#include <fstream> #include <fstream>

View File

@ -35,16 +35,8 @@
#include "util/ities.h" #include "util/ities.h"
#include <util/logging.h> #include <util/logging.h>
#include <elfio/elfio.hpp>
#include <iss/arch/rv64gc.h> #include <iss/arch/rv64gc.h>
#ifdef __cplusplus
extern "C" {
#endif
#include <ihex.h>
#ifdef __cplusplus
}
#endif
#include <cstdio> #include <cstdio>
#include <cstring> #include <cstring>
#include <fstream> #include <fstream>

View File

@ -33,16 +33,8 @@
#include "util/ities.h" #include "util/ities.h"
#include <util/logging.h> #include <util/logging.h>
#include <elfio/elfio.hpp>
#include <iss/arch/rv64i.h> #include <iss/arch/rv64i.h>
#ifdef __cplusplus
extern "C" {
#endif
#include <ihex.h>
#ifdef __cplusplus
}
#endif
#include <cstdio> #include <cstdio>
#include <cstring> #include <cstring>
#include <fstream> #include <fstream>

View File

@ -41,7 +41,9 @@
#include <iss/arch/rv64gc.h> #include <iss/arch/rv64gc.h>
#include <iss/arch/rv64i.h> #include <iss/arch/rv64i.h>
#include <iss/arch/mnrv32.h> #include <iss/arch/mnrv32.h>
#ifdef WITH_LLVM
#include <iss/llvm/jit_helper.h> #include <iss/llvm/jit_helper.h>
#endif
#include <iss/log_categories.h> #include <iss/log_categories.h>
#include <iss/plugin/cycle_estimate.h> #include <iss/plugin/cycle_estimate.h>
#include <iss/plugin/instruction_count.h> #include <iss/plugin/instruction_count.h>
@ -56,8 +58,10 @@ std::tuple<cpu_ptr, vm_ptr> create_cpu(std::string const& backend, unsigned gdb_
CORE* lcpu = new iss::arch::riscv_hart_msu_vp<CORE>(); CORE* lcpu = new iss::arch::riscv_hart_msu_vp<CORE>();
if(backend == "interp") if(backend == "interp")
return {cpu_ptr{lcpu}, vm_ptr{iss::interp::create(lcpu, gdb_port)}}; return {cpu_ptr{lcpu}, vm_ptr{iss::interp::create(lcpu, gdb_port)}};
#ifdef WITH_LLVM
if(backend == "llvm") if(backend == "llvm")
return {cpu_ptr{lcpu}, vm_ptr{iss::llvm::create(lcpu, gdb_port)}}; return {cpu_ptr{lcpu}, vm_ptr{iss::llvm::create(lcpu, gdb_port)}};
#endif
if(backend == "tcc") if(backend == "tcc")
return {cpu_ptr{lcpu}, vm_ptr{iss::tcc::create(lcpu, gdb_port)}}; return {cpu_ptr{lcpu}, vm_ptr{iss::tcc::create(lcpu, gdb_port)}};
return {nullptr, nullptr}; return {nullptr, nullptr};
@ -119,8 +123,10 @@ int main(int argc, char *argv[]) {
std::vector<iss::vm_plugin *> plugin_list; std::vector<iss::vm_plugin *> plugin_list;
auto res = 0; auto res = 0;
try { try {
#ifdef WITH_LLVM
// application code comes here // // application code comes here //
iss::init_jit_debug(argc, argv); iss::init_jit_debug(argc, argv);
#endif
bool dump = clim.count("dump-ir"); bool dump = clim.count("dump-ir");
// instantiate the simulator // instantiate the simulator
vm_ptr vm{nullptr}; vm_ptr vm{nullptr};
@ -130,19 +136,19 @@ int main(int argc, char *argv[]) {
std::tie(cpu, vm) = create_cpu<iss::arch::mnrv32>(clim["backend"].as<std::string>(), clim["gdb-port"].as<unsigned>()); std::tie(cpu, vm) = create_cpu<iss::arch::mnrv32>(clim["backend"].as<std::string>(), clim["gdb-port"].as<unsigned>());
} else if (isa_opt=="rv64i") { } else if (isa_opt=="rv64i") {
std::tie(cpu, vm) = create_cpu<iss::arch::rv64i>(clim["backend"].as<std::string>(), clim["gdb-port"].as<unsigned>()); std::tie(cpu, vm) = create_cpu<iss::arch::rv64i>(clim["backend"].as<std::string>(), clim["gdb-port"].as<unsigned>());
// } else if (isa_opt=="rv64gc") { } else if (isa_opt=="rv64gc") {
// std::tie(cpu, vm) = create_cpu<iss::arch::rv64gc>(clim["backend"].as<std::string>(), clim["gdb-port"].as<unsigned>()); std::tie(cpu, vm) = create_cpu<iss::arch::rv64gc>(clim["backend"].as<std::string>(), clim["gdb-port"].as<unsigned>());
// } else if (isa_opt=="rv32imac") { } else if (isa_opt=="rv32imac") {
// std::tie(cpu, vm) = create_cpu<iss::arch::rv32imac>(clim["backend"].as<std::string>(), clim["gdb-port"].as<unsigned>()); std::tie(cpu, vm) = create_cpu<iss::arch::rv32imac>(clim["backend"].as<std::string>(), clim["gdb-port"].as<unsigned>());
// } else if (isa_opt=="rv32gc") { } else if (isa_opt=="rv32gc") {
// std::tie(cpu, vm) = create_cpu<iss::arch::rv32gc>(clim["backend"].as<std::string>(), clim["gdb-port"].as<unsigned>()); std::tie(cpu, vm) = create_cpu<iss::arch::rv32gc>(clim["backend"].as<std::string>(), clim["gdb-port"].as<unsigned>());
} else { } else {
LOG(ERROR) << "Illegal argument value for '--isa': " << clim["isa"].as<std::string>() << std::endl; LOG(ERROR) << "Illegal argument value for '--isa': " << clim["isa"].as<std::string>() << std::endl;
return 127; return 127;
} }
if (clim.count("plugin")) { if (clim.count("plugin")) {
for (std::string opt_val : clim["plugin"].as<std::vector<std::string>>()) { for (std::string const& opt_val : clim["plugin"].as<std::vector<std::string>>()) {
std::string plugin_name{opt_val}; std::string plugin_name=opt_val;
std::string filename{"cycles.txt"}; std::string filename{"cycles.txt"};
std::size_t found = opt_val.find('='); std::size_t found = opt_val.find('=');
if (found != std::string::npos) { if (found != std::string::npos) {

View File

@ -286,7 +286,7 @@ void core_complex::trace(sc_trace_file *trf) const {}
void core_complex::before_end_of_elaboration() { void core_complex::before_end_of_elaboration() {
cpu = scc::make_unique<core_wrapper>(this); cpu = scc::make_unique<core_wrapper>(this);
vm = llvm::create<core_type>(cpu.get(), gdb_server_port.get_value(), dump_ir.get_value()); vm = tcc::create<core_type>(cpu.get(), gdb_server_port.get_value(), dump_ir.get_value());
#ifdef WITH_SCV #ifdef WITH_SCV
vm->setDisassEnabled(enable_disass.get_value() || m_db != nullptr); vm->setDisassEnabled(enable_disass.get_value() || m_db != nullptr);
#else #else