From 7ce51e797cb2b53c0d144012f1a8a2b3795a8d60 Mon Sep 17 00:00:00 2001 From: Eyck Jentzsch Date: Sat, 5 Nov 2022 20:56:15 +0100 Subject: [PATCH] updates submodules to actual versions --- .cproject | 43 +++++----- .gitignore | 1 + .../org.eclipse.cdt.managedbuilder.core.prefs | 8 -- CMakeLists.txt | 68 ++++++++++++++- README.md | 82 +++++++------------ conanfile.txt | 44 ---------- dbt-rise-core | 2 +- dbt-rise-riscv | 2 +- external/CMakeLists.txt | 18 +--- external/elfio | 1 - platform/src/CLIParser.cpp | 2 +- platform/src/CMakeLists.txt | 2 +- platform/src/sc_main.cpp | 1 + scc | 2 +- system.json | 2 +- 15 files changed, 127 insertions(+), 151 deletions(-) delete mode 100644 conanfile.txt delete mode 160000 external/elfio diff --git a/.cproject b/.cproject index cb0ad00..e1ac187 100644 --- a/.cproject +++ b/.cproject @@ -7,37 +7,22 @@ - + + + - - - - - - - - - - - - - - - - - + + + + + + @@ -59,6 +44,9 @@ + + + @@ -110,6 +98,7 @@ + @@ -168,6 +157,12 @@ + + + + + + diff --git a/.gitignore b/.gitignore index 3dff9d4..418035a 100644 --- a/.gitignore +++ b/.gitignore @@ -31,3 +31,4 @@ language.settings.xml /*.out /dump.json /*.c +/_build/ diff --git a/.settings/org.eclipse.cdt.managedbuilder.core.prefs b/.settings/org.eclipse.cdt.managedbuilder.core.prefs index f299fce..a2bf967 100644 --- a/.settings/org.eclipse.cdt.managedbuilder.core.prefs +++ b/.settings/org.eclipse.cdt.managedbuilder.core.prefs @@ -1,10 +1,4 @@ eclipse.preferences.version=1 -environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.exe.debug.1751741082/CPATH/delimiter=\: -environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.exe.debug.1751741082/CPATH/operation=remove -environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.exe.debug.1751741082/CPLUS_INCLUDE_PATH/delimiter=\: -environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.exe.debug.1751741082/CPLUS_INCLUDE_PATH/operation=remove -environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.exe.debug.1751741082/C_INCLUDE_PATH/delimiter=\: -environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.exe.debug.1751741082/C_INCLUDE_PATH/operation=remove environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.exe.debug.1751741082/append=true environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.exe.debug.1751741082/appendContributed=true environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.exe.release.1745230171.1259602404/CPATH/delimiter=\: @@ -23,8 +17,6 @@ environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.exe.release.1745 environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.exe.release.1745230171/C_INCLUDE_PATH/operation=remove environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.exe.release.1745230171/append=true environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.exe.release.1745230171/appendContributed=true -environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.exe.debug.1751741082/LIBRARY_PATH/delimiter=\: -environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.exe.debug.1751741082/LIBRARY_PATH/operation=remove environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.exe.debug.1751741082/append=true environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.exe.debug.1751741082/appendContributed=true environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.exe.release.1745230171.1259602404/LIBRARY_PATH/delimiter=\: diff --git a/CMakeLists.txt b/CMakeLists.txt index 20b6f3d..189c533 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -39,7 +39,73 @@ elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") set(warnings "/W4 /WX /EHsc") endif() -setup_conan(TARGETS) +include(GNUInstallDirs) +include(ConanInline) + +set(CONAN_BOOST_OPTIONS +boost:fPIC=True +boost:shared=True +boost:header_only=False +boost:without_contract=True +boost:without_graph=True +boost:without_graph_parallel=True +boost:without_iostreams=True +boost:without_json=True +boost:without_locale=True +boost:without_log=True +boost:without_math=True +boost:without_mpi=True +boost:without_nowide=True +boost:without_python=True +boost:without_random=True +boost:without_regex=True +boost:without_stacktrace=True +boost:without_test=True +boost:without_timer=True +boost:without_type_erasure=True +boost:without_wave=True +) + +set(B2_VERSION 4.8.0) +set(CONAN_PACKAGE_LIST fmt/6.1.2 zlib/1.2.11 b2/${B2_VERSION} boost/1.75.0 gsl-lite/0.37.0 elfio/3.8 tcc/0.9.27 seasocks/1.4.4) + +set(CONAN_PACKAGE_OPTIONS seasocks:shared=True fmt:header_only=True ${CONAN_BOOST_OPTIONS}) +if(FORCE_SYSTEMC OR NOT DEFINED ENV{SYSTEMC_HOME}) + list(APPEND CONAN_PACKAGE_LIST systemc/2.3.3 systemc-cci/1.0.0) + list(APPEND CONAN_PACKAGE_OPTIONS systemc-cci:shared=False) +endif() + +conan_check() +conan_add_remote(NAME minres URL https://git.minres.com/api/packages/Tooling/conan) + +# Boost on CentOS 7 quirks: the b2 of conan-center is build against a newer libstdc++ and therefore does not run +# with the oooooold libs on CentOS 7. Therefore we build our own version of b2 if it is not there +set(B2_META $ENV{HOME}/.conan/data/b2/${B2_VERSION}/_/_/metadata.json) +if(DEFINED ENV{CONAN_USER_HOME}) + set(B2_META $ENV{CONAN_USER_HOME}/.conan/data/b2/${B2_VERSION}/_/_/metadata.json) +endif() +if(NOT EXISTS ${B2_META}) + conan_configure(REQUIRES b2/${B2_VERSION}) + conan_cmake_autodetect(settings) + conan_cmake_install(PATH_OR_REFERENCE . BUILD b2 SETTINGS ${settings}) +endif() +# Boost on CentOS 7 quirks end + +conan_cmake_configure(REQUIRES ${CONAN_PACKAGE_LIST} + GENERATORS cmake_find_package cmake + OPTIONS ${CONAN_PACKAGE_OPTIONS} + ) + +conan_install() +#conan_setup(TARGETS) +include(conanbuildinfo) +find_package(tcc) +find_package(elfio) +find_package(fmt) +find_package(gsl-lite) +find_package(ZLIB) +find_package(Seasocks) +find_package(Threads REQUIRED) # This line finds the boost lib and headers. set(Boost_NO_BOOST_CMAKE ON) # Don't do a find_package in config mode before searching for a regular boost install. diff --git a/README.md b/README.md index b4267fb..7ae92eb 100644 --- a/README.md +++ b/README.md @@ -1,71 +1,51 @@ -# RISCV-VP -An instruction set simulator based on DBT-RISE implementing the RISC-V ISA. The project is hosted at https://git.minres.com/VP/RISCV-VP. +# HIFIVE1-VP -**RISCV-VP README** +An instruction set simulator based on DBT-RISE implementing the RISC-V ISA. The project is hosted at https://github.com/Minres/HIFIVE1-VP. -This is work in progress, so use at your own risk. Goal is to implement an open-source ISS which can easily embedded e.g. into SystemC Virtual Prototypes. It uses code generation to allow easy extension and adaptation of the used instruction. Please see also [https://git.minres.com/DBT-RISE/DBT-RISE-RISCV](https://git.minres.com/DBT-RISE/DBT-RISE-RISCV) +## HIFIVE1-VP README + +This is work in progress, so use at your own risk. Goal is to implement an open-source ISS which can easily embedded e.g. into SystemC Virtual Prototypes. It uses code generation to allow easy extension and adaptation of the used instruction. Please see also [https://github.com/Minres/DBT-RISE-RISCV](https://github.com/Minres/DBT-RISE-RISCV) The RISC-V ISS reaches about 65MIPS running on a decent Intel Processor. -The implementation is based on LLVM > v4.0. Eclipse CDT 4.7 (Oxygen) is recommended as IDE. +HIFIVE1-VP uses libGIS (https://github.com/vsergeev/libGIS) under MIT license -RISCV-VP uses libGIS (https://github.com/vsergeev/libGIS) as well as ELFIO (http://elfio.sourceforge.net/), both under MIT license - - -**Quick start** +## Setup steps * you need to have a C++11 capable compiler (e.g. gcc >= 4.8), make, python, and cmake installed -* install LLVM >= 4.0 according to http://apt.llvm.org/ (if it is not already provided by your distribution e.g by Ubuntu 18.04) * install conan.io (see also http://docs.conan.io/en/latest/installation.html): -``` - pip install conan -``` - -* setup conan to use the minres repo: +### prepare Ubuntu 18.04/20.04 ``` - conan profile new default --detect --force - conan profile update settings.compiler.libcxx=libstdc++11 default - conan remote add minres https://artifactory.minres.com/artifactory/api/conan/oss" +sudo apt-get install -y git python3-pip build-essential cmake libloki-dev zlib1g-dev libncurses5-dev \ + libboost-dev libboost-program-options-dev libboost-system-dev libboost-thread-dev llvm-dev llvm-doc +pip3 install --user conan ``` -* if you encounter issues when linking wrt. c++11 symbols you might have run into GCC ABI incompatibility introduced from GCC 5.0 onwards. You can fix this by adding '-s compiler.libcxx=libstdc++11' to the conan call or changing compiler.libcxx to +### prepare Fedora 28 ``` -compiler.libcxx=libstdc++11 -``` - -in $HOME/.conan/profiles/default - -**Detailed Setup steps** - -***prepare Ubuntu 18.04/20.04*** - -``` - sudo apt-get install -y git python3-pip build-essential cmake libloki-dev zlib1g-dev libncurses5-dev \ - libboost-dev libboost-program-options-dev libboost-system-dev libboost-thread-dev llvm-dev llvm-doc - pip3 install --user conan -``` - -***prepare Fedora 28*** - -``` - #prepare system - dnf install @development-tools gcc-c++ boost-devel zlib-devel loki-lib-devel cmake python2 python3 llvm-devel llvm-static - #install conan - pip3 install --user conan - export PATH=${PATH}:$HOME/.local/bin +#prepare system +dnf install @development-tools gcc-c++ boost-devel zlib-devel loki-lib-devel cmake python2 python3 llvm-devel llvm-static +#install conan +pip3 install --user conan +export PATH=${PATH}:$HOME/.local/bin ``` -***Build the ISS*** +### Build the ISS ``` - # checkout source from git: - git clone --recursive https://git.minres.com/VP/HIFIVE1-VP.git - - # build ISS: - cd HIFIVE1-VP - mkdir build;cd build - MAKE_FLAGS="-j4" cmake .. - make -j4 +# checkout source from git: +git clone --recursive https://github.com/Minres/HIFIVE1-VP.git +# build ISS: +cd HIFIVE1-VP +cmake -S . -B build +cmake --build build -j8 +``` + +### Build the ISS + +``` +build/platform/src/riscv-vp -v4 -m 500ms + ``` diff --git a/conanfile.txt b/conanfile.txt deleted file mode 100644 index f4c8129..0000000 --- a/conanfile.txt +++ /dev/null @@ -1,44 +0,0 @@ -[requires] - gsl-lite/0.37.0 - fmt/6.1.2 - seasocks/1.4.4 - systemc/2.3.3 - systemc-cci/1.0.0 - tcc/0.9.27 - boost/1.75.0 - zlib/1.2.11 - -[generators] - cmake - -[options] - seasocks:shared=True - fmt:header_only=True - boost:fPIC=True - boost:shared=False - boost:header_only=False - boost:fPIC=True - boost:shared=True - boost:header_only=False - boost:without_context=True - boost:without_contract=True - boost:without_coroutine=True - boost:without_fiber=True - boost:without_graph=True - boost:without_graph_parallel=True - boost:without_iostreams=True - boost:without_json=True - boost:without_locale=True - boost:without_log=True - boost:without_math=True - boost:without_mpi=True - boost:without_nowide=True - boost:without_python=True - boost:without_random=True - boost:without_regex=True - boost:without_stacktrace=True - boost:without_test=True - boost:without_timer=True - boost:without_type_erasure=True - boost:without_wave=True - systemc-cci:shared=False diff --git a/dbt-rise-core b/dbt-rise-core index 44acf8a..061b788 160000 --- a/dbt-rise-core +++ b/dbt-rise-core @@ -1 +1 @@ -Subproject commit 44acf8a55936d5eedb5daf8cae0799ec1616413f +Subproject commit 061b78825a53fbb5568dd4d4351373ae71898bbe diff --git a/dbt-rise-riscv b/dbt-rise-riscv index ab9316b..a16bf4f 160000 --- a/dbt-rise-riscv +++ b/dbt-rise-riscv @@ -1 +1 @@ -Subproject commit ab9316b9b5a121ea29293ae5af419b7a25b5679c +Subproject commit a16bf4f375a96d2275b243d883fe5e2c82043cb3 diff --git a/external/CMakeLists.txt b/external/CMakeLists.txt index 6726dd1..cb3d434 100644 --- a/external/CMakeLists.txt +++ b/external/CMakeLists.txt @@ -1,28 +1,14 @@ cmake_minimum_required(VERSION 3.12) -set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/../cmake) - # Set the name of your project here project("external") -include(Common) - - -include_directories( ${PROJECT_SOURCE_DIR}/libGIS ) - -FILE(GLOB ElfioHeaders elfio *.hpp) -FILE(GLOB GISHeaders libGis *.h) - -set(LIB_HEADERS ${ElfioHeaders} ${GISHeaders}) set(LIB_SOURCES libGIS/atmel_generic.c libGIS/ihex.c libGIS/srecord.c ) -# Define two variables in order not to repeat ourselves. -set(LIBRARY_NAME external) - # Define the library -add_library(${LIBRARY_NAME} ${LIB_SOURCES}) - +add_library(${PROJECT_NAME} ${LIB_SOURCES}) +target_include_directories(${PROJECT_NAME} PUBLIC ${PROJECT_SOURCE_DIR}/libGIS) diff --git a/external/elfio b/external/elfio deleted file mode 160000 index 1c91bc2..0000000 --- a/external/elfio +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 1c91bc2bc506ffdb959d045dc45f571980757710 diff --git a/platform/src/CLIParser.cpp b/platform/src/CLIParser.cpp index d7e9e1b..ba1c77b 100644 --- a/platform/src/CLIParser.cpp +++ b/platform/src/CLIParser.cpp @@ -118,7 +118,7 @@ void CLIParser::build() { ("disass,d", po::value()->implicit_value(""), "Enables disassembly") ("elf,l", po::value(), "ELF file to load") ("gdb-port,g", po::value()->default_value(0), "enable gdb server and specify port to use") - ("ir-dump", "dump the intermediate representation") + ("dump-ir", "dump the intermediate representation") ("quantum", po::value(), "SystemC quantum time in ns") ("reset,r", po::value(), "reset address") ("trace-level,t", po::value()->default_value(0), "enable tracing, or combination of 1=signals and 2=TX text, 4=TX compressed text, 6=TX in SQLite") diff --git a/platform/src/CMakeLists.txt b/platform/src/CMakeLists.txt index 77614ab..e5100c5 100644 --- a/platform/src/CMakeLists.txt +++ b/platform/src/CMakeLists.txt @@ -41,7 +41,7 @@ endif() add_library(platform ${LIB_SOURCES}) target_include_directories(platform PUBLIC ../incl) -target_link_libraries(platform PUBLIC dbt-rise-riscv-sc CONAN_PKG::seasocks external) +target_link_libraries(platform PUBLIC dbt-rise-riscv-sc Seasocks::seasocks external) if(VERILATOR_FOUND) message(STATUS "Verilator found at ${VERILATOR_EXECUTABLE}") target_include_directories(platform PRIVATE ${PROJECT_SOURCE_DIR}/incl/sysc/rtl) diff --git a/platform/src/sc_main.cpp b/platform/src/sc_main.cpp index dbe00c3..2505aed 100644 --- a/platform/src/sc_main.cpp +++ b/platform/src/sc_main.cpp @@ -85,6 +85,7 @@ int sc_main(int argc, char *argv[]) { CLIParser parser(argc, argv); scc::stream_redirection cout_redir(std::cout, scc::log::INFO); scc::stream_redirection cerr_redir(std::cerr, scc::log::ERROR); + sc_report_handler::set_actions(SC_ERROR, SC_LOG | SC_CACHE_REPORT | SC_DISPLAY | SC_STOP); if (!parser.is_valid()) return ERROR_IN_COMMAND_LINE; /////////////////////////////////////////////////////////////////////////// // set up infrastructure diff --git a/scc b/scc index 0f0d594..8785c03 160000 --- a/scc +++ b/scc @@ -1 +1 @@ -Subproject commit 0f0d5943a83071ba3ad9af4db19053a7ab67f20b +Subproject commit 8785c03bd893776668e78a696876c28a14ba6640 diff --git a/system.json b/system.json index 33364c9..627e7af 100644 --- a/system.json +++ b/system.json @@ -11,7 +11,7 @@ "i_terminal.write_to_ws" : false, "i_fe310": { "enableTracing" : false, - "i_gpio.write_to_ws": true, + "i_gpio0.write_to_ws": true, "i_pwm0.enableTracing" : true, "i_pwm0.regs.enableTracing" : true, "i_uart0.bit_true_transfer": false,