Browse Source

Refoctored to to move SystemC wrapper into riscv library

Eyck Jentzsch 9 months ago
parent
commit
58a446e6bc

+ 0
- 1
CMakeLists.txt View File

@@ -112,7 +112,6 @@ add_subdirectory(sc-components)
112 112
 add_subdirectory(softfloat)
113 113
 GET_DIRECTORY_PROPERTY(SOFTFLOAT_INCLUDE_DIRS DIRECTORY softfloat DEFINITION SOFTFLOAT_INCLUDE_DIRS)
114 114
 add_subdirectory(riscv)
115
-add_subdirectory(riscv.sc)
116 115
 add_subdirectory(platform)
117 116
 
118 117
 message(STATUS "Build Type: ${CMAKE_BUILD_TYPE}")

+ 0
- 1
platform/CMakeLists.txt View File

@@ -25,7 +25,6 @@ endif()
25 25
 add_dependent_subproject(dbt-core)
26 26
 add_dependent_subproject(sc-components)
27 27
 add_dependent_subproject(riscv)
28
-add_dependent_subproject(riscv.sc)
29 28
 
30 29
 include_directories(
31 30
     ${PROJECT_SOURCE_DIR}/../external/elfio

+ 0
- 1
platform/src/CMakeLists.txt View File

@@ -61,7 +61,6 @@ add_executable(${APPLICATION_NAME} ${APP_SOURCES})
61 61
 target_include_directories(${APPLICATION_NAME} SYSTEM PRIVATE ${LLVM_INCLUDE_DIRS})
62 62
 # Links the target exe against the libraries
63 63
 target_link_libraries(${APPLICATION_NAME} ${LIBRARY_NAME})
64
-target_link_libraries(${APPLICATION_NAME} riscv.sc)
65 64
 target_link_libraries(${APPLICATION_NAME} riscv)
66 65
 target_link_libraries(${APPLICATION_NAME} dbt-core)
67 66
 target_link_libraries(${APPLICATION_NAME} softfloat)

+ 0
- 93
riscv.sc/CMakeLists.txt View File

@@ -1,93 +0,0 @@
1
-cmake_minimum_required(VERSION 3.3)
2
-set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/../cmake) # main (top) cmake dir
3
-
4
-# CMake useful variables
5
-set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
6
-set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib") 
7
-set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib")
8
-
9
-# Set the name of your project here
10
-project("riscv.sc")
11
-
12
-include(Common)
13
-
14
-# check that we have averything we need
15
-if(!SystemC_FOUND)
16
-    message( FATAL_ERROR "SystemC library not found." )
17
-endif()
18
-
19
-if(!CCI_FOUND)
20
-    message( FATAL_ERROR "SystemC CCI library not found." )
21
-endif()
22
-
23
-add_definitions(-DWITH_SYSTEMC) 
24
-include_directories(${SystemC_INCLUDE_DIRS})
25
-link_directories(${SystemC_LIBRARY_DIRS})
26
-
27
-include_directories(${CCI_INCLUDE_DIRS})
28
-link_directories(${CCI_LIBRARY_DIRS})
29
-
30
-if(SCV_FOUND)   
31
-    add_definitions(-DWITH_SCV)
32
-    include_directories(${SCV_INCLUDE_DIRS})
33
-    link_directories(${SCV_LIBRARY_DIRS})
34
-endif()
35
-
36
-# This sets the include directory for the reference project. This is the -I flag in gcc.
37
-include_directories(
38
-    ${PROJECT_SOURCE_DIR}/incl
39
-    ${LLVM_INCLUDE_DIRS}
40
-)
41
-
42
-add_dependent_subproject(dbt-core)
43
-add_dependent_subproject(sc-components)
44
-add_dependent_subproject(riscv)
45
-
46
-include_directories(
47
-    ${PROJECT_SOURCE_DIR}/incl
48
-    ${PROJECT_SOURCE_DIR}/../riscv/incl
49
-    ${PROJECT_SOURCE_DIR}/../external/elfio
50
-    ${PROJECT_SOURCE_DIR}/../external/libGIS
51
-    ${Boost_INCLUDE_DIRS}
52
-)
53
-
54
-
55
-# Mac needed variables (adapt for your needs - http://www.cmake.org/Wiki/CMake_RPATH_handling#Mac_OS_X_and_the_RPATH)
56
-set(CMAKE_MACOSX_RPATH ON)
57
-set(CMAKE_SKIP_BUILD_RPATH FALSE)
58
-set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
59
-set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
60
-set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
61
-
62
-## the following setting needs to be consistent with the library
63
-#add_definitions(-DSC_DEFAULT_WRITER_POLICY=SC_MANY_WRITERS)
64
-
65
-# library files
66
-FILE(GLOB RiscVSCHeaders *.h */*.h)
67
-
68
-set(LIB_HEADERS ${RiscVSCHeaders} )
69
-set(LIB_SOURCES src/core_complex.cpp )
70
-
71
-# Define two variables in order not to repeat ourselves.
72
-set(LIBRARY_NAME riscv.sc)
73
-
74
-# Define the library
75
-add_library(${LIBRARY_NAME} ${LIB_SOURCES})
76
-
77
-set_target_properties(${LIBRARY_NAME} PROPERTIES
78
-  VERSION ${VERSION}  # ${VERSION} was defined in the main CMakeLists.
79
-  FRAMEWORK FALSE
80
-  PUBLIC_HEADER "${LIB_HEADERS}" # specify the public headers
81
-)
82
-
83
-#
84
-# SYSTEM PACKAGING (RPM, TGZ, ...)
85
-# _____________________________________________________________________________
86
-
87
-#include(CPackConfig)
88
-
89
-#
90
-# CMAKE PACKAGING (for other CMake projects to use this one easily)
91
-# _____________________________________________________________________________
92
-
93
-#include(PackageConfigurator)

riscv.sc/incl/sysc/core_complex.h → riscv/incl/sysc/core_complex.h View File


+ 16
- 0
riscv/src/CMakeLists.txt View File

@@ -12,6 +12,10 @@ set(LIB_SOURCES
12 12
     plugin/instruction_count.cpp
13 13
     plugin/cycle_estimate.cpp)
14 14
 
15
+if(SystemC_FOUND)
16
+	set(LIB_SOURCES ${LIB_SOURCES} sysc/core_complex.cpp)
17
+endif()
18
+
15 19
 set(APP_HEADERS )
16 20
 
17 21
 set(APP_SOURCES main.cpp)
@@ -28,6 +32,18 @@ set_target_properties(${LIBRARY_NAME} PROPERTIES
28 32
   PUBLIC_HEADER "${LIB_HEADERS}" # specify the public headers
29 33
 )
30 34
 
35
+if(SystemC_FOUND)
36
+	add_definitions(-DWITH_SYSTEMC) 
37
+	include_directories(${SystemC_INCLUDE_DIRS})
38
+	
39
+	include_directories(${CCI_INCLUDE_DIRS})
40
+	
41
+	if(SCV_FOUND)   
42
+	    add_definitions(-DWITH_SCV)
43
+	    include_directories(${SCV_INCLUDE_DIRS})
44
+	endif()
45
+endif()
46
+
31 47
 # This is a make target, so you can do a "make riscv-sc"
32 48
 set(APPLICATION_NAME riscv-sim)
33 49
 

riscv.sc/src/core_complex.cpp → riscv/src/sysc/core_complex.cpp View File