From b7c0fb2b1c3b993a07a4bd7f09f698bb8ca83245 Mon Sep 17 00:00:00 2001 From: Stas Date: Wed, 10 Mar 2021 12:40:06 +0100 Subject: [PATCH 1/3] fix bitfield structure --- incl/iss/arch/riscv_hart_m_p.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/incl/iss/arch/riscv_hart_m_p.h b/incl/iss/arch/riscv_hart_m_p.h index d0ae20c..7d11c71 100644 --- a/incl/iss/arch/riscv_hart_m_p.h +++ b/incl/iss/arch/riscv_hart_m_p.h @@ -302,7 +302,7 @@ public: void write_mstatus(T val) { auto mask = get_mask(); - auto new_val = (mstatus.st.value & ~mask) | (val & mask); + auto new_val = (mstatus.backing.val & ~mask) | (val & mask); mstatus = new_val; } From c941890901248b64bf16f2c51a2e8e876417e382 Mon Sep 17 00:00:00 2001 From: Stanislaw Kaushanski Date: Mon, 22 Mar 2021 14:50:53 +0100 Subject: [PATCH 2/3] SCC refactoring --- CMakeLists.txt | 4 ++-- incl/sysc/core_complex.h | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 167dd8c..42ad3b2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -52,7 +52,7 @@ endif() add_library(riscv SHARED ${LIB_SOURCES}) target_compile_options(riscv PRIVATE -Wno-shift-count-overflow) target_include_directories(riscv PUBLIC incl ../external/elfio) -target_link_libraries(riscv PUBLIC softfloat scc-util) +target_link_libraries(riscv PUBLIC softfloat scc-util jsoncpp) target_link_libraries(riscv PUBLIC -Wl,--whole-archive dbt-core -Wl,--no-whole-archive) set_target_properties(riscv PROPERTIES VERSION ${PROJECT_VERSION} @@ -120,4 +120,4 @@ install(TARGETS riscv riscv-sim # CMAKE PACKAGING (for other CMake projects to use this one easily) # _____________________________________________________________________________ -#include(PackageConfigurator) \ No newline at end of file +#include(PackageConfigurator) diff --git a/incl/sysc/core_complex.h b/incl/sysc/core_complex.h index 8456f4e..f3f9787 100644 --- a/incl/sysc/core_complex.h +++ b/incl/sysc/core_complex.h @@ -33,10 +33,10 @@ #ifndef _SYSC_SIFIVE_FE310_H_ #define _SYSC_SIFIVE_FE310_H_ -#include "scc/initiator_mixin.h" +#include "tlm/scc/initiator_mixin.h" #include "scc/traceable.h" #include "scc/utilities.h" -#include "scv4tlm/tlm_rec_initiator_socket.h" +#include "tlm/scc/scv4tlm/tlm_rec_initiator_socket.h" #include #include #include @@ -75,7 +75,7 @@ class core_wrapper; class core_complex : public sc_core::sc_module, public scc::traceable { public: - scc::initiator_mixin> initiator{"intor"}; + tlm::scc::initiator_mixin> initiator{"intor"}; sc_core::sc_in clk_i{"clk_i"}; From ea3ff3c0cd58a31d3dc4a69619d7b6d2776a9b9e Mon Sep 17 00:00:00 2001 From: Stanislaw Kaushanski Date: Tue, 23 Mar 2021 11:57:47 +0100 Subject: [PATCH 3/3] build with SCV lib --- src/sysc/core_complex.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sysc/core_complex.cpp b/src/sysc/core_complex.cpp index 505e1d0..2a93efc 100644 --- a/src/sysc/core_complex.cpp +++ b/src/sysc/core_complex.cpp @@ -331,7 +331,7 @@ void core_complex::disass_output(uint64_t pc, const std::string instr_str) { tr_handle.record_attribute("PC", pc); tr_handle.record_attribute("INSTR", instr_str); tr_handle.record_attribute("MODE", lvl[cpu->get_mode()]); - tr_handle.record_attribute("MSTATUS", cpu->get_state().mstatus.st.value); + tr_handle.record_attribute("MSTATUS", cpu->get_state().mstatus.backing.val); tr_handle.record_attribute("LTIME_START", quantum_keeper.get_current_time().value() / 1000); #endif }