Compare commits
	
		
			1 Commits
		
	
	
		
			hotfix/lat
			...
			d43b35949e
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| d43b35949e | 
| @@ -1,6 +1,6 @@ | ||||
| cmake_minimum_required(VERSION 3.12) | ||||
|  | ||||
| project("riscv" VERSION 1.0.0) | ||||
| project("tgfs" VERSION 1.0.0) | ||||
|  | ||||
| include(GNUInstallDirs) | ||||
|  | ||||
| @@ -28,7 +28,7 @@ add_subdirectory(softfloat) | ||||
|  | ||||
| # library files | ||||
| FILE(GLOB RiscVSCHeaders ${CMAKE_CURRENT_SOURCE_DIR}/incl/sysc/*.h ${CMAKE_CURRENT_SOURCE_DIR}/incl/sysc/*/*.h) | ||||
| set(LIB_HEADERS ${RiscVSCHeaders} ) | ||||
| set(LIB_HEADERS tgfscVSCHeaders} ) | ||||
| set(LIB_SOURCES  | ||||
| 	src/iss/tgf_b.cpp | ||||
| 	src/iss/tgf_c.cpp | ||||
| @@ -49,56 +49,55 @@ set(LIB_SOURCES ${LIB_SOURCES} | ||||
| endif() | ||||
|  | ||||
| # Define the library | ||||
| 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 jsoncpp) | ||||
| target_link_libraries(riscv PUBLIC -Wl,--whole-archive dbt-core -Wl,--no-whole-archive) | ||||
| set_target_properties(riscv PROPERTIES | ||||
| add_library(tgfs SHARED ${LIB_SOURCES}) | ||||
| target_compile_options(tgfs PRIVATE -Wno-shift-count-overflow) | ||||
| target_include_directories(tgfs PUBLIC incl) | ||||
| target_link_libraries(tgfs PUBLIC softfloat scc-util) | ||||
| target_link_libraries(tgfs PUBLIC -Wl,--whole-archive dbt-core -Wl,--no-whole-archive) | ||||
| set_target_properties(tgfs PROPERTIES | ||||
|   VERSION ${PROJECT_VERSION} | ||||
|   FRAMEWORK FALSE | ||||
|   PUBLIC_HEADER "${LIB_HEADERS}" # specify the public headers | ||||
| ) | ||||
|  | ||||
| if(SystemC_FOUND) | ||||
| 	add_library(riscv_sc src/sysc/core_complex.cpp) | ||||
| 	target_compile_definitions(riscv_sc PUBLIC WITH_SYSTEMC)  | ||||
| 	target_include_directories(riscv_sc PUBLIC ../incl ${SystemC_INCLUDE_DIRS} ${CCI_INCLUDE_DIRS}) | ||||
| 	add_library(tgfs_sc src/sysc/core_complex.cpp) | ||||
| 	target_compile_definitions(tgfs_sc PUBLIC WITH_SYSTEMC)  | ||||
| 	target_include_directories(tgfs_sc PUBLIC ../incl ${SystemC_INCLUDE_DIRS} ${CCI_INCLUDE_DIRS}) | ||||
| 	 | ||||
| 	if(SCV_FOUND)    | ||||
| 	    target_compile_definitions(riscv_sc PUBLIC WITH_SCV) | ||||
| 	    target_include_directories(riscv_sc PUBLIC ${SCV_INCLUDE_DIRS}) | ||||
| 	    target_compile_definitions(tgfs_sc PUBLIC WITH_SCV) | ||||
| 	    target_include_directories(tgfs_sc PUBLIC ${SCV_INCLUDE_DIRS}) | ||||
| 	endif() | ||||
| 	target_link_libraries(riscv_sc PUBLIC riscv scc ) | ||||
| 	target_link_libraries(tgfs_sc PUBLIC tgfs scc ) | ||||
| 	if(WITH_LLVM) | ||||
| 		target_link_libraries(riscv_sc PUBLIC ${llvm_libs}) | ||||
| 		target_link_libraries(tgfs_sc PUBLIC ${llvm_libs}) | ||||
| 	endif() | ||||
| 	target_link_libraries(riscv_sc PUBLIC ${Boost_LIBRARIES} ) | ||||
| 	set_target_properties(riscv_sc PROPERTIES | ||||
| 	target_link_libraries(tgfs_sc PUBLIC ${Boost_LIBRARIES} ) | ||||
| 	set_target_properties(tgfs_sc PROPERTIES | ||||
| 	  VERSION ${PROJECT_VERSION} | ||||
| 	  FRAMEWORK FALSE | ||||
| 	  PUBLIC_HEADER "${LIB_HEADERS}" # specify the public headers | ||||
| 	) | ||||
| endif() | ||||
|  | ||||
| project("riscv-sim") | ||||
| add_executable(riscv-sim src/main.cpp) | ||||
| project("tgfs-sim") | ||||
| add_executable(tgfs-sim src/main.cpp) | ||||
| # This sets the include directory for the reference project. This is the -I flag in gcc. | ||||
| target_include_directories(riscv-sim PRIVATE ../external/libGIS) | ||||
|  | ||||
| if(WITH_LLVM) | ||||
| 	target_compile_definitions(riscv-sim PRIVATE WITH_LLVM) | ||||
| 	target_link_libraries(riscv-sim PUBLIC ${llvm_libs}) | ||||
| 	target_compile_definitions(tgfs-sim PRIVATE WITH_LLVM) | ||||
| 	target_link_libraries(tgfs-sim PUBLIC ${llvm_libs}) | ||||
| endif() | ||||
| # Links the target exe against the libraries | ||||
| target_link_libraries(riscv-sim riscv) | ||||
| target_link_libraries(riscv-sim jsoncpp) | ||||
| target_link_libraries(riscv-sim external) | ||||
| target_link_libraries(riscv-sim ${Boost_LIBRARIES} ) | ||||
| target_link_libraries(tgfs-sim tgfs) | ||||
| target_link_libraries(tgfs-sim jsoncpp) | ||||
| target_link_libraries(tgfs-sim ${Boost_LIBRARIES} ) | ||||
| if (Tcmalloc_FOUND) | ||||
|     target_link_libraries(riscv-sim ${Tcmalloc_LIBRARIES}) | ||||
|     target_link_libraries(tgfs-sim ${Tcmalloc_LIBRARIES}) | ||||
| endif(Tcmalloc_FOUND) | ||||
|  | ||||
| install(TARGETS riscv riscv-sim | ||||
| install(TARGETS tgfs tgfs-sim | ||||
|   EXPORT ${PROJECT_NAME}Targets            # for downstream dependencies | ||||
|   ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT libs   # static lib | ||||
|   RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT libs   # binaries | ||||
| @@ -120,4 +119,4 @@ install(TARGETS riscv riscv-sim | ||||
| # CMAKE PACKAGING (for other CMake projects to use this one easily) | ||||
| # _____________________________________________________________________________ | ||||
|  | ||||
| #include(PackageConfigurator) | ||||
| #include(PackageConfigurator) | ||||
| @@ -302,7 +302,7 @@ public: | ||||
|  | ||||
|         void write_mstatus(T val) { | ||||
|             auto mask = get_mask(); | ||||
|             auto new_val = (mstatus.backing.val & ~mask) | (val & mask); | ||||
|             auto new_val = (mstatus.st.value & ~mask) | (val & mask); | ||||
|             mstatus = new_val; | ||||
|         } | ||||
|  | ||||
|   | ||||
| @@ -33,10 +33,10 @@ | ||||
| #ifndef _SYSC_SIFIVE_FE310_H_ | ||||
| #define _SYSC_SIFIVE_FE310_H_ | ||||
|  | ||||
| #include <tlm/scc/scv/tlm_rec_initiator_socket.h> | ||||
| #include "tlm/scc/initiator_mixin.h" | ||||
| #include "scc/initiator_mixin.h" | ||||
| #include "scc/traceable.h" | ||||
| #include "scc/utilities.h" | ||||
| #include "scv4tlm/tlm_rec_initiator_socket.h" | ||||
| #include <cci_configuration> | ||||
| #include <tlm> | ||||
| #include <tlm_core/tlm_1/tlm_req_rsp/tlm_1_interfaces/tlm_core_ifs.h> | ||||
| @@ -75,7 +75,7 @@ class core_wrapper; | ||||
|  | ||||
| class core_complex : public sc_core::sc_module, public scc::traceable { | ||||
| public: | ||||
|     tlm::scc::initiator_mixin<tlm::scc::scv::tlm_rec_initiator_socket<32>> initiator{"intor"}; | ||||
|     scc::initiator_mixin<scv4tlm::tlm_rec_initiator_socket<32>> initiator{"intor"}; | ||||
|  | ||||
|     sc_core::sc_in<sc_core::sc_time> clk_i{"clk_i"}; | ||||
|  | ||||
|   | ||||
| @@ -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.backing.val); | ||||
|     tr_handle.record_attribute("MSTATUS", cpu->get_state().mstatus.st.value); | ||||
|     tr_handle.record_attribute("LTIME_START", quantum_keeper.get_current_time().value() / 1000); | ||||
| #endif | ||||
| } | ||||
| @@ -388,7 +388,7 @@ bool core_complex::read_mem(uint64_t addr, unsigned length, uint8_t *const data, | ||||
|             if (is_fetch && tr_handle.is_active()) { | ||||
|                 tr_handle.end_transaction(); | ||||
|             } | ||||
|             auto preExt = new tlm::scc::scv4tlm::tlm_recording_extension(tr_handle, this); | ||||
|             auto preExt = new scv4tlm::tlm_recording_extension(tr_handle, this); | ||||
|             gp.set_extension(preExt); | ||||
|         } | ||||
| #endif | ||||
| @@ -434,7 +434,7 @@ bool core_complex::write_mem(uint64_t addr, unsigned length, const uint8_t *cons | ||||
|         sc_time delay{quantum_keeper.get_local_time()}; | ||||
| #ifdef WITH_SCV | ||||
|         if (m_db != nullptr && tr_handle.is_valid()) { | ||||
|             auto preExt = new tlm::scc::scv4tlm::tlm_recording_extension(tr_handle, this); | ||||
|             auto preExt = new scv4tlm::tlm_recording_extension(tr_handle, this); | ||||
|             gp.set_extension(preExt); | ||||
|         } | ||||
| #endif | ||||
|   | ||||
		Reference in New Issue
	
	Block a user